solenberg | bc37fc8 | 2016-04-04 09:54:44 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef MODULES_AUDIO_DEVICE_INCLUDE_MOCK_AUDIO_DEVICE_H_ |
| 12 | #define MODULES_AUDIO_DEVICE_INCLUDE_MOCK_AUDIO_DEVICE_H_ |
solenberg | bc37fc8 | 2016-04-04 09:54:44 -0700 | [diff] [blame] | 13 | |
| 14 | #include <string> |
kwiberg | ac9f876 | 2016-09-30 22:29:43 -0700 | [diff] [blame] | 15 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 16 | #include "modules/audio_device/include/audio_device.h" |
| 17 | #include "test/gmock.h" |
solenberg | bc37fc8 | 2016-04-04 09:54:44 -0700 | [diff] [blame] | 18 | |
| 19 | namespace webrtc { |
| 20 | namespace test { |
| 21 | |
| 22 | class MockAudioDeviceModule : public AudioDeviceModule { |
| 23 | public: |
Fredrik Solenberg | a32dd01 | 2017-10-04 13:27:21 +0200 | [diff] [blame] | 24 | // RefCounted |
Niels Möller | 6f72f56 | 2017-10-19 13:15:17 +0200 | [diff] [blame] | 25 | MOCK_CONST_METHOD0(AddRef, void()); |
| 26 | MOCK_CONST_METHOD0(Release, rtc::RefCountReleaseStatus()); |
solenberg | bc37fc8 | 2016-04-04 09:54:44 -0700 | [diff] [blame] | 27 | // AudioDeviceModule. |
| 28 | MOCK_CONST_METHOD1(ActiveAudioLayer, int32_t(AudioLayer* audioLayer)); |
| 29 | MOCK_CONST_METHOD0(LastError, ErrorCode()); |
solenberg | bc37fc8 | 2016-04-04 09:54:44 -0700 | [diff] [blame] | 30 | MOCK_METHOD1(RegisterAudioCallback, int32_t(AudioTransport* audioCallback)); |
| 31 | MOCK_METHOD0(Init, int32_t()); |
| 32 | MOCK_METHOD0(Terminate, int32_t()); |
| 33 | MOCK_CONST_METHOD0(Initialized, bool()); |
| 34 | MOCK_METHOD0(PlayoutDevices, int16_t()); |
| 35 | MOCK_METHOD0(RecordingDevices, int16_t()); |
| 36 | MOCK_METHOD3(PlayoutDeviceName, int32_t(uint16_t index, |
| 37 | char name[kAdmMaxDeviceNameSize], |
| 38 | char guid[kAdmMaxGuidSize])); |
| 39 | MOCK_METHOD3(RecordingDeviceName, int32_t(uint16_t index, |
| 40 | char name[kAdmMaxDeviceNameSize], |
| 41 | char guid[kAdmMaxGuidSize])); |
| 42 | MOCK_METHOD1(SetPlayoutDevice, int32_t(uint16_t index)); |
| 43 | MOCK_METHOD1(SetPlayoutDevice, int32_t(WindowsDeviceType device)); |
| 44 | MOCK_METHOD1(SetRecordingDevice, int32_t(uint16_t index)); |
| 45 | MOCK_METHOD1(SetRecordingDevice, int32_t(WindowsDeviceType device)); |
| 46 | MOCK_METHOD1(PlayoutIsAvailable, int32_t(bool* available)); |
| 47 | MOCK_METHOD0(InitPlayout, int32_t()); |
| 48 | MOCK_CONST_METHOD0(PlayoutIsInitialized, bool()); |
| 49 | MOCK_METHOD1(RecordingIsAvailable, int32_t(bool* available)); |
| 50 | MOCK_METHOD0(InitRecording, int32_t()); |
| 51 | MOCK_CONST_METHOD0(RecordingIsInitialized, bool()); |
| 52 | MOCK_METHOD0(StartPlayout, int32_t()); |
| 53 | MOCK_METHOD0(StopPlayout, int32_t()); |
| 54 | MOCK_CONST_METHOD0(Playing, bool()); |
| 55 | MOCK_METHOD0(StartRecording, int32_t()); |
| 56 | MOCK_METHOD0(StopRecording, int32_t()); |
| 57 | MOCK_CONST_METHOD0(Recording, bool()); |
| 58 | MOCK_METHOD1(SetAGC, int32_t(bool enable)); |
| 59 | MOCK_CONST_METHOD0(AGC, bool()); |
solenberg | bc37fc8 | 2016-04-04 09:54:44 -0700 | [diff] [blame] | 60 | MOCK_METHOD0(InitSpeaker, int32_t()); |
| 61 | MOCK_CONST_METHOD0(SpeakerIsInitialized, bool()); |
| 62 | MOCK_METHOD0(InitMicrophone, int32_t()); |
| 63 | MOCK_CONST_METHOD0(MicrophoneIsInitialized, bool()); |
| 64 | MOCK_METHOD1(SpeakerVolumeIsAvailable, int32_t(bool* available)); |
| 65 | MOCK_METHOD1(SetSpeakerVolume, int32_t(uint32_t volume)); |
| 66 | MOCK_CONST_METHOD1(SpeakerVolume, int32_t(uint32_t* volume)); |
| 67 | MOCK_CONST_METHOD1(MaxSpeakerVolume, int32_t(uint32_t* maxVolume)); |
| 68 | MOCK_CONST_METHOD1(MinSpeakerVolume, int32_t(uint32_t* minVolume)); |
solenberg | bc37fc8 | 2016-04-04 09:54:44 -0700 | [diff] [blame] | 69 | MOCK_METHOD1(MicrophoneVolumeIsAvailable, int32_t(bool* available)); |
| 70 | MOCK_METHOD1(SetMicrophoneVolume, int32_t(uint32_t volume)); |
| 71 | MOCK_CONST_METHOD1(MicrophoneVolume, int32_t(uint32_t* volume)); |
| 72 | MOCK_CONST_METHOD1(MaxMicrophoneVolume, int32_t(uint32_t* maxVolume)); |
| 73 | MOCK_CONST_METHOD1(MinMicrophoneVolume, int32_t(uint32_t* minVolume)); |
solenberg | bc37fc8 | 2016-04-04 09:54:44 -0700 | [diff] [blame] | 74 | MOCK_METHOD1(SpeakerMuteIsAvailable, int32_t(bool* available)); |
| 75 | MOCK_METHOD1(SetSpeakerMute, int32_t(bool enable)); |
| 76 | MOCK_CONST_METHOD1(SpeakerMute, int32_t(bool* enabled)); |
| 77 | MOCK_METHOD1(MicrophoneMuteIsAvailable, int32_t(bool* available)); |
| 78 | MOCK_METHOD1(SetMicrophoneMute, int32_t(bool enable)); |
| 79 | MOCK_CONST_METHOD1(MicrophoneMute, int32_t(bool* enabled)); |
solenberg | bc37fc8 | 2016-04-04 09:54:44 -0700 | [diff] [blame] | 80 | MOCK_CONST_METHOD1(StereoPlayoutIsAvailable, int32_t(bool* available)); |
| 81 | MOCK_METHOD1(SetStereoPlayout, int32_t(bool enable)); |
| 82 | MOCK_CONST_METHOD1(StereoPlayout, int32_t(bool* enabled)); |
| 83 | MOCK_CONST_METHOD1(StereoRecordingIsAvailable, int32_t(bool* available)); |
| 84 | MOCK_METHOD1(SetStereoRecording, int32_t(bool enable)); |
| 85 | MOCK_CONST_METHOD1(StereoRecording, int32_t(bool* enabled)); |
solenberg | bc37fc8 | 2016-04-04 09:54:44 -0700 | [diff] [blame] | 86 | MOCK_CONST_METHOD1(PlayoutDelay, int32_t(uint16_t* delayMS)); |
solenberg | bc37fc8 | 2016-04-04 09:54:44 -0700 | [diff] [blame] | 87 | MOCK_CONST_METHOD0(BuiltInAECIsAvailable, bool()); |
| 88 | MOCK_CONST_METHOD0(BuiltInAGCIsAvailable, bool()); |
| 89 | MOCK_CONST_METHOD0(BuiltInNSIsAvailable, bool()); |
| 90 | MOCK_METHOD1(EnableBuiltInAEC, int32_t(bool enable)); |
| 91 | MOCK_METHOD1(EnableBuiltInAGC, int32_t(bool enable)); |
| 92 | MOCK_METHOD1(EnableBuiltInNS, int32_t(bool enable)); |
maxmorin | 88e31a3 | 2016-08-16 00:56:09 -0700 | [diff] [blame] | 93 | #if defined(WEBRTC_IOS) |
solenberg | bc37fc8 | 2016-04-04 09:54:44 -0700 | [diff] [blame] | 94 | MOCK_CONST_METHOD1(GetPlayoutAudioParameters, int(AudioParameters* params)); |
| 95 | MOCK_CONST_METHOD1(GetRecordAudioParameters, int(AudioParameters* params)); |
maxmorin | 88e31a3 | 2016-08-16 00:56:09 -0700 | [diff] [blame] | 96 | #endif // WEBRTC_IOS |
solenberg | bc37fc8 | 2016-04-04 09:54:44 -0700 | [diff] [blame] | 97 | }; |
| 98 | } // namespace test |
| 99 | } // namespace webrtc |
| 100 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 101 | #endif // MODULES_AUDIO_DEVICE_INCLUDE_MOCK_AUDIO_DEVICE_H_ |