OLD | NEW |
(Empty) | |
| 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 |
| 11 #ifndef WEBRTC_MODULES_AUDIO_DEVICE_INCLUDE_MOCK_AUDIO_DEVICE_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_DEVICE_INCLUDE_MOCK_AUDIO_DEVICE_H_ |
| 13 |
| 14 #include <string> |
| 15 #include "testing/gmock/include/gmock/gmock.h" |
| 16 #include "webrtc/modules/audio_device/include/audio_device.h" |
| 17 |
| 18 namespace webrtc { |
| 19 namespace test { |
| 20 |
| 21 class MockAudioDeviceModule : public AudioDeviceModule { |
| 22 public: |
| 23 // Module. |
| 24 MOCK_METHOD0(TimeUntilNextProcess, int64_t()); |
| 25 MOCK_METHOD0(Process, void()); |
| 26 MOCK_METHOD1(ProcessThreadAttached, void(ProcessThread*)); |
| 27 // RefCountedModule. |
| 28 MOCK_CONST_METHOD0(AddRef, int32_t()); |
| 29 MOCK_CONST_METHOD0(Release, int32_t()); |
| 30 // AudioDeviceModule. |
| 31 MOCK_CONST_METHOD1(ActiveAudioLayer, int32_t(AudioLayer* audioLayer)); |
| 32 MOCK_CONST_METHOD0(LastError, ErrorCode()); |
| 33 MOCK_METHOD1(RegisterEventObserver, |
| 34 int32_t(AudioDeviceObserver* eventCallback)); |
| 35 MOCK_METHOD1(RegisterAudioCallback, int32_t(AudioTransport* audioCallback)); |
| 36 MOCK_METHOD0(Init, int32_t()); |
| 37 MOCK_METHOD0(Terminate, int32_t()); |
| 38 MOCK_CONST_METHOD0(Initialized, bool()); |
| 39 MOCK_METHOD0(PlayoutDevices, int16_t()); |
| 40 MOCK_METHOD0(RecordingDevices, int16_t()); |
| 41 MOCK_METHOD3(PlayoutDeviceName, int32_t(uint16_t index, |
| 42 char name[kAdmMaxDeviceNameSize], |
| 43 char guid[kAdmMaxGuidSize])); |
| 44 MOCK_METHOD3(RecordingDeviceName, int32_t(uint16_t index, |
| 45 char name[kAdmMaxDeviceNameSize], |
| 46 char guid[kAdmMaxGuidSize])); |
| 47 MOCK_METHOD1(SetPlayoutDevice, int32_t(uint16_t index)); |
| 48 MOCK_METHOD1(SetPlayoutDevice, int32_t(WindowsDeviceType device)); |
| 49 MOCK_METHOD1(SetRecordingDevice, int32_t(uint16_t index)); |
| 50 MOCK_METHOD1(SetRecordingDevice, int32_t(WindowsDeviceType device)); |
| 51 MOCK_METHOD1(PlayoutIsAvailable, int32_t(bool* available)); |
| 52 MOCK_METHOD0(InitPlayout, int32_t()); |
| 53 MOCK_CONST_METHOD0(PlayoutIsInitialized, bool()); |
| 54 MOCK_METHOD1(RecordingIsAvailable, int32_t(bool* available)); |
| 55 MOCK_METHOD0(InitRecording, int32_t()); |
| 56 MOCK_CONST_METHOD0(RecordingIsInitialized, bool()); |
| 57 MOCK_METHOD0(StartPlayout, int32_t()); |
| 58 MOCK_METHOD0(StopPlayout, int32_t()); |
| 59 MOCK_CONST_METHOD0(Playing, bool()); |
| 60 MOCK_METHOD0(StartRecording, int32_t()); |
| 61 MOCK_METHOD0(StopRecording, int32_t()); |
| 62 MOCK_CONST_METHOD0(Recording, bool()); |
| 63 MOCK_METHOD1(SetAGC, int32_t(bool enable)); |
| 64 MOCK_CONST_METHOD0(AGC, bool()); |
| 65 MOCK_METHOD2(SetWaveOutVolume, int32_t(uint16_t volumeLeft, |
| 66 uint16_t volumeRight)); |
| 67 MOCK_CONST_METHOD2(WaveOutVolume, int32_t(uint16_t* volumeLeft, |
| 68 uint16_t* volumeRight)); |
| 69 MOCK_METHOD0(InitSpeaker, int32_t()); |
| 70 MOCK_CONST_METHOD0(SpeakerIsInitialized, bool()); |
| 71 MOCK_METHOD0(InitMicrophone, int32_t()); |
| 72 MOCK_CONST_METHOD0(MicrophoneIsInitialized, bool()); |
| 73 MOCK_METHOD1(SpeakerVolumeIsAvailable, int32_t(bool* available)); |
| 74 MOCK_METHOD1(SetSpeakerVolume, int32_t(uint32_t volume)); |
| 75 MOCK_CONST_METHOD1(SpeakerVolume, int32_t(uint32_t* volume)); |
| 76 MOCK_CONST_METHOD1(MaxSpeakerVolume, int32_t(uint32_t* maxVolume)); |
| 77 MOCK_CONST_METHOD1(MinSpeakerVolume, int32_t(uint32_t* minVolume)); |
| 78 MOCK_CONST_METHOD1(SpeakerVolumeStepSize, int32_t(uint16_t* stepSize)); |
| 79 MOCK_METHOD1(MicrophoneVolumeIsAvailable, int32_t(bool* available)); |
| 80 MOCK_METHOD1(SetMicrophoneVolume, int32_t(uint32_t volume)); |
| 81 MOCK_CONST_METHOD1(MicrophoneVolume, int32_t(uint32_t* volume)); |
| 82 MOCK_CONST_METHOD1(MaxMicrophoneVolume, int32_t(uint32_t* maxVolume)); |
| 83 MOCK_CONST_METHOD1(MinMicrophoneVolume, int32_t(uint32_t* minVolume)); |
| 84 MOCK_CONST_METHOD1(MicrophoneVolumeStepSize, int32_t(uint16_t* stepSize)); |
| 85 MOCK_METHOD1(SpeakerMuteIsAvailable, int32_t(bool* available)); |
| 86 MOCK_METHOD1(SetSpeakerMute, int32_t(bool enable)); |
| 87 MOCK_CONST_METHOD1(SpeakerMute, int32_t(bool* enabled)); |
| 88 MOCK_METHOD1(MicrophoneMuteIsAvailable, int32_t(bool* available)); |
| 89 MOCK_METHOD1(SetMicrophoneMute, int32_t(bool enable)); |
| 90 MOCK_CONST_METHOD1(MicrophoneMute, int32_t(bool* enabled)); |
| 91 MOCK_METHOD1(MicrophoneBoostIsAvailable, int32_t(bool* available)); |
| 92 MOCK_METHOD1(SetMicrophoneBoost, int32_t(bool enable)); |
| 93 MOCK_CONST_METHOD1(MicrophoneBoost, int32_t(bool* enabled)); |
| 94 MOCK_CONST_METHOD1(StereoPlayoutIsAvailable, int32_t(bool* available)); |
| 95 MOCK_METHOD1(SetStereoPlayout, int32_t(bool enable)); |
| 96 MOCK_CONST_METHOD1(StereoPlayout, int32_t(bool* enabled)); |
| 97 MOCK_CONST_METHOD1(StereoRecordingIsAvailable, int32_t(bool* available)); |
| 98 MOCK_METHOD1(SetStereoRecording, int32_t(bool enable)); |
| 99 MOCK_CONST_METHOD1(StereoRecording, int32_t(bool* enabled)); |
| 100 MOCK_METHOD1(SetRecordingChannel, int32_t(const ChannelType channel)); |
| 101 MOCK_CONST_METHOD1(RecordingChannel, int32_t(ChannelType* channel)); |
| 102 MOCK_METHOD2(SetPlayoutBuffer, int32_t(const BufferType type, |
| 103 uint16_t sizeMS)); |
| 104 MOCK_CONST_METHOD2(PlayoutBuffer, int32_t(BufferType* type, |
| 105 uint16_t* sizeMS)); |
| 106 MOCK_CONST_METHOD1(PlayoutDelay, int32_t(uint16_t* delayMS)); |
| 107 MOCK_CONST_METHOD1(RecordingDelay, int32_t(uint16_t* delayMS)); |
| 108 MOCK_CONST_METHOD1(CPULoad, int32_t(uint16_t* load)); |
| 109 MOCK_METHOD1(StartRawOutputFileRecording, |
| 110 int32_t(const char pcmFileNameUTF8[kAdmMaxFileNameSize])); |
| 111 MOCK_METHOD0(StopRawOutputFileRecording, int32_t()); |
| 112 MOCK_METHOD1(StartRawInputFileRecording, |
| 113 int32_t(const char pcmFileNameUTF8[kAdmMaxFileNameSize])); |
| 114 MOCK_METHOD0(StopRawInputFileRecording, int32_t()); |
| 115 MOCK_METHOD1(SetRecordingSampleRate, int32_t(const uint32_t samplesPerSec)); |
| 116 MOCK_CONST_METHOD1(RecordingSampleRate, int32_t(uint32_t* samplesPerSec)); |
| 117 MOCK_METHOD1(SetPlayoutSampleRate, int32_t(const uint32_t samplesPerSec)); |
| 118 MOCK_CONST_METHOD1(PlayoutSampleRate, int32_t(uint32_t* samplesPerSec)); |
| 119 MOCK_METHOD0(ResetAudioDevice, int32_t()); |
| 120 MOCK_METHOD1(SetLoudspeakerStatus, int32_t(bool enable)); |
| 121 MOCK_CONST_METHOD1(GetLoudspeakerStatus, int32_t(bool* enabled)); |
| 122 MOCK_CONST_METHOD0(BuiltInAECIsAvailable, bool()); |
| 123 MOCK_CONST_METHOD0(BuiltInAGCIsAvailable, bool()); |
| 124 MOCK_CONST_METHOD0(BuiltInNSIsAvailable, bool()); |
| 125 MOCK_METHOD1(EnableBuiltInAEC, int32_t(bool enable)); |
| 126 MOCK_METHOD1(EnableBuiltInAGC, int32_t(bool enable)); |
| 127 MOCK_METHOD1(EnableBuiltInNS, int32_t(bool enable)); |
| 128 MOCK_CONST_METHOD0(BuiltInAECIsEnabled, bool()); |
| 129 MOCK_CONST_METHOD1(GetPlayoutAudioParameters, int(AudioParameters* params)); |
| 130 MOCK_CONST_METHOD1(GetRecordAudioParameters, int(AudioParameters* params)); |
| 131 }; |
| 132 } // namespace test |
| 133 } // namespace webrtc |
| 134 |
| 135 #endif // WEBRTC_MODULES_AUDIO_DEVICE_INCLUDE_MOCK_AUDIO_DEVICE_H_ |
OLD | NEW |