Fredrik Solenberg | 0ccae13 | 2015-11-03 10:15:49 +0100 | [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 | |
| 11 | #ifndef WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_ |
| 12 | #define WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_ |
| 13 | |
kwiberg | b7f89d6 | 2016-02-17 10:04:18 -0800 | [diff] [blame] | 14 | #include <memory> |
| 15 | |
Fredrik Solenberg | 0ccae13 | 2015-11-03 10:15:49 +0100 | [diff] [blame] | 16 | #include "testing/gmock/include/gmock/gmock.h" |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 17 | #include "webrtc/test/mock_voe_channel_proxy.h" |
Fredrik Solenberg | 0ccae13 | 2015-11-03 10:15:49 +0100 | [diff] [blame] | 18 | #include "webrtc/voice_engine/voice_engine_impl.h" |
| 19 | |
| 20 | namespace webrtc { |
| 21 | namespace test { |
| 22 | |
| 23 | // NOTE: This class inherits from VoiceEngineImpl so that its clients will be |
| 24 | // able to get the various interfaces as usual, via T::GetInterface(). |
solenberg | 3a94154 | 2015-11-16 07:34:50 -0800 | [diff] [blame] | 25 | class MockVoiceEngine : public VoiceEngineImpl { |
Fredrik Solenberg | 0ccae13 | 2015-11-03 10:15:49 +0100 | [diff] [blame] | 26 | public: |
nisse | ef8b61e | 2016-04-29 06:09:15 -0700 | [diff] [blame] | 27 | // TODO(nisse): Valid overrides commented out, because the gmock |
| 28 | // methods don't use any override declarations, and we want to avoid |
| 29 | // warnings from -Winconsistent-missing-override. See |
| 30 | // http://crbug.com/428099. |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 31 | MockVoiceEngine( |
| 32 | rtc::scoped_refptr<AudioDecoderFactory> decoder_factory = nullptr) |
solenberg | 88499ec | 2016-09-07 07:34:41 -0700 | [diff] [blame^] | 33 | : decoder_factory_(decoder_factory) { |
Fredrik Solenberg | 0ccae13 | 2015-11-03 10:15:49 +0100 | [diff] [blame] | 34 | // Increase ref count so this object isn't automatically deleted whenever |
| 35 | // interfaces are Release():d. |
| 36 | ++_ref_count; |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 37 | // We add this default behavior to make the mock easier to use in tests. It |
| 38 | // will create a NiceMock of a voe::ChannelProxy. |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 39 | // TODO(ossu): As long as AudioReceiveStream is implmented as a wrapper |
| 40 | // around Channel, we need to make sure ChannelProxy returns the same |
| 41 | // decoder factory as the one passed in when creating an AudioReceiveStream. |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 42 | ON_CALL(*this, ChannelProxyFactory(testing::_)) |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 43 | .WillByDefault(testing::Invoke([this](int channel_id) { |
| 44 | auto* proxy = |
| 45 | new testing::NiceMock<webrtc::test::MockVoEChannelProxy>(); |
| 46 | EXPECT_CALL(*proxy, GetAudioDecoderFactory()) |
| 47 | .WillRepeatedly(testing::ReturnRef(decoder_factory_)); |
| 48 | return proxy; |
| 49 | })); |
Fredrik Solenberg | 0ccae13 | 2015-11-03 10:15:49 +0100 | [diff] [blame] | 50 | } |
nisse | ef8b61e | 2016-04-29 06:09:15 -0700 | [diff] [blame] | 51 | ~MockVoiceEngine() /* override */ { |
Fredrik Solenberg | 0ccae13 | 2015-11-03 10:15:49 +0100 | [diff] [blame] | 52 | // Decrease ref count before base class d-tor is called; otherwise it will |
| 53 | // trigger an assertion. |
| 54 | --_ref_count; |
| 55 | } |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 56 | // Allows injecting a ChannelProxy factory. |
| 57 | MOCK_METHOD1(ChannelProxyFactory, voe::ChannelProxy*(int channel_id)); |
| 58 | |
| 59 | // VoiceEngineImpl |
nisse | ef8b61e | 2016-04-29 06:09:15 -0700 | [diff] [blame] | 60 | std::unique_ptr<voe::ChannelProxy> GetChannelProxy( |
| 61 | int channel_id) /* override */ { |
kwiberg | b7f89d6 | 2016-02-17 10:04:18 -0800 | [diff] [blame] | 62 | return std::unique_ptr<voe::ChannelProxy>(ChannelProxyFactory(channel_id)); |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 63 | } |
Fredrik Solenberg | 0ccae13 | 2015-11-03 10:15:49 +0100 | [diff] [blame] | 64 | |
| 65 | // VoEAudioProcessing |
| 66 | MOCK_METHOD2(SetNsStatus, int(bool enable, NsModes mode)); |
| 67 | MOCK_METHOD2(GetNsStatus, int(bool& enabled, NsModes& mode)); |
| 68 | MOCK_METHOD2(SetAgcStatus, int(bool enable, AgcModes mode)); |
| 69 | MOCK_METHOD2(GetAgcStatus, int(bool& enabled, AgcModes& mode)); |
| 70 | MOCK_METHOD1(SetAgcConfig, int(AgcConfig config)); |
| 71 | MOCK_METHOD1(GetAgcConfig, int(AgcConfig& config)); |
| 72 | MOCK_METHOD2(SetEcStatus, int(bool enable, EcModes mode)); |
| 73 | MOCK_METHOD2(GetEcStatus, int(bool& enabled, EcModes& mode)); |
| 74 | MOCK_METHOD1(EnableDriftCompensation, int(bool enable)); |
| 75 | MOCK_METHOD0(DriftCompensationEnabled, bool()); |
| 76 | MOCK_METHOD1(SetDelayOffsetMs, void(int offset)); |
| 77 | MOCK_METHOD0(DelayOffsetMs, int()); |
| 78 | MOCK_METHOD2(SetAecmMode, int(AecmModes mode, bool enableCNG)); |
| 79 | MOCK_METHOD2(GetAecmMode, int(AecmModes& mode, bool& enabledCNG)); |
| 80 | MOCK_METHOD1(EnableHighPassFilter, int(bool enable)); |
| 81 | MOCK_METHOD0(IsHighPassFilterEnabled, bool()); |
| 82 | MOCK_METHOD3(SetRxNsStatus, int(int channel, bool enable, NsModes mode)); |
| 83 | MOCK_METHOD3(GetRxNsStatus, int(int channel, bool& enabled, NsModes& mode)); |
| 84 | MOCK_METHOD3(SetRxAgcStatus, int(int channel, bool enable, AgcModes mode)); |
| 85 | MOCK_METHOD3(GetRxAgcStatus, int(int channel, bool& enabled, AgcModes& mode)); |
| 86 | MOCK_METHOD2(SetRxAgcConfig, int(int channel, AgcConfig config)); |
| 87 | MOCK_METHOD2(GetRxAgcConfig, int(int channel, AgcConfig& config)); |
| 88 | MOCK_METHOD2(RegisterRxVadObserver, |
| 89 | int(int channel, VoERxVadCallback& observer)); |
| 90 | MOCK_METHOD1(DeRegisterRxVadObserver, int(int channel)); |
| 91 | MOCK_METHOD1(VoiceActivityIndicator, int(int channel)); |
| 92 | MOCK_METHOD1(SetEcMetricsStatus, int(bool enable)); |
| 93 | MOCK_METHOD1(GetEcMetricsStatus, int(bool& enabled)); |
| 94 | MOCK_METHOD4(GetEchoMetrics, int(int& ERL, int& ERLE, int& RERL, int& A_NLP)); |
| 95 | MOCK_METHOD3(GetEcDelayMetrics, |
| 96 | int(int& delay_median, |
| 97 | int& delay_std, |
| 98 | float& fraction_poor_delays)); |
| 99 | MOCK_METHOD1(StartDebugRecording, int(const char* fileNameUTF8)); |
| 100 | MOCK_METHOD1(StartDebugRecording, int(FILE* file_handle)); |
| 101 | MOCK_METHOD0(StopDebugRecording, int()); |
| 102 | MOCK_METHOD1(SetTypingDetectionStatus, int(bool enable)); |
| 103 | MOCK_METHOD1(GetTypingDetectionStatus, int(bool& enabled)); |
| 104 | MOCK_METHOD1(TimeSinceLastTyping, int(int& seconds)); |
| 105 | MOCK_METHOD5(SetTypingDetectionParameters, |
| 106 | int(int timeWindow, |
| 107 | int costPerTyping, |
| 108 | int reportingThreshold, |
| 109 | int penaltyDecay, |
| 110 | int typeEventDelay)); |
| 111 | MOCK_METHOD1(EnableStereoChannelSwapping, void(bool enable)); |
| 112 | MOCK_METHOD0(IsStereoChannelSwappingEnabled, bool()); |
| 113 | |
| 114 | // VoEBase |
| 115 | MOCK_METHOD1(RegisterVoiceEngineObserver, int(VoiceEngineObserver& observer)); |
| 116 | MOCK_METHOD0(DeRegisterVoiceEngineObserver, int()); |
ossu | 5f7cfa5 | 2016-05-30 08:11:28 -0700 | [diff] [blame] | 117 | MOCK_METHOD3( |
| 118 | Init, |
| 119 | int(AudioDeviceModule* external_adm, |
| 120 | AudioProcessing* audioproc, |
| 121 | const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory)); |
Fredrik Solenberg | 0ccae13 | 2015-11-03 10:15:49 +0100 | [diff] [blame] | 122 | MOCK_METHOD0(audio_processing, AudioProcessing*()); |
| 123 | MOCK_METHOD0(Terminate, int()); |
| 124 | MOCK_METHOD0(CreateChannel, int()); |
solenberg | 88499ec | 2016-09-07 07:34:41 -0700 | [diff] [blame^] | 125 | MOCK_METHOD1(CreateChannel, int(const ChannelConfig& config)); |
Fredrik Solenberg | 0ccae13 | 2015-11-03 10:15:49 +0100 | [diff] [blame] | 126 | MOCK_METHOD1(DeleteChannel, int(int channel)); |
| 127 | MOCK_METHOD1(StartReceive, int(int channel)); |
| 128 | MOCK_METHOD1(StopReceive, int(int channel)); |
| 129 | MOCK_METHOD1(StartPlayout, int(int channel)); |
| 130 | MOCK_METHOD1(StopPlayout, int(int channel)); |
| 131 | MOCK_METHOD1(StartSend, int(int channel)); |
| 132 | MOCK_METHOD1(StopSend, int(int channel)); |
| 133 | MOCK_METHOD1(GetVersion, int(char version[1024])); |
| 134 | MOCK_METHOD0(LastError, int()); |
| 135 | MOCK_METHOD0(audio_transport, AudioTransport*()); |
| 136 | MOCK_METHOD2(AssociateSendChannel, |
| 137 | int(int channel, int accociate_send_channel)); |
| 138 | |
| 139 | // VoECodec |
| 140 | MOCK_METHOD0(NumOfCodecs, int()); |
| 141 | MOCK_METHOD2(GetCodec, int(int index, CodecInst& codec)); |
| 142 | MOCK_METHOD2(SetSendCodec, int(int channel, const CodecInst& codec)); |
| 143 | MOCK_METHOD2(GetSendCodec, int(int channel, CodecInst& codec)); |
| 144 | MOCK_METHOD2(SetBitRate, int(int channel, int bitrate_bps)); |
| 145 | MOCK_METHOD2(GetRecCodec, int(int channel, CodecInst& codec)); |
| 146 | MOCK_METHOD2(SetRecPayloadType, int(int channel, const CodecInst& codec)); |
| 147 | MOCK_METHOD2(GetRecPayloadType, int(int channel, CodecInst& codec)); |
| 148 | MOCK_METHOD3(SetSendCNPayloadType, |
| 149 | int(int channel, int type, PayloadFrequencies frequency)); |
| 150 | MOCK_METHOD2(SetFECStatus, int(int channel, bool enable)); |
| 151 | MOCK_METHOD2(GetFECStatus, int(int channel, bool& enabled)); |
| 152 | MOCK_METHOD4(SetVADStatus, |
| 153 | int(int channel, bool enable, VadModes mode, bool disableDTX)); |
| 154 | MOCK_METHOD4( |
| 155 | GetVADStatus, |
| 156 | int(int channel, bool& enabled, VadModes& mode, bool& disabledDTX)); |
| 157 | MOCK_METHOD2(SetOpusMaxPlaybackRate, int(int channel, int frequency_hz)); |
| 158 | MOCK_METHOD2(SetOpusDtx, int(int channel, bool enable_dtx)); |
Fredrik Solenberg | 0ccae13 | 2015-11-03 10:15:49 +0100 | [diff] [blame] | 159 | |
Fredrik Solenberg | 0ccae13 | 2015-11-03 10:15:49 +0100 | [diff] [blame] | 160 | // VoEExternalMedia |
| 161 | MOCK_METHOD3(RegisterExternalMediaProcessing, |
| 162 | int(int channel, |
| 163 | ProcessingTypes type, |
| 164 | VoEMediaProcess& processObject)); |
| 165 | MOCK_METHOD2(DeRegisterExternalMediaProcessing, |
| 166 | int(int channel, ProcessingTypes type)); |
| 167 | MOCK_METHOD3(GetAudioFrame, |
| 168 | int(int channel, int desired_sample_rate_hz, AudioFrame* frame)); |
| 169 | MOCK_METHOD2(SetExternalMixing, int(int channel, bool enable)); |
| 170 | |
| 171 | // VoEFile |
| 172 | MOCK_METHOD7(StartPlayingFileLocally, |
| 173 | int(int channel, |
| 174 | const char fileNameUTF8[1024], |
| 175 | bool loop, |
| 176 | FileFormats format, |
| 177 | float volumeScaling, |
| 178 | int startPointMs, |
| 179 | int stopPointMs)); |
| 180 | MOCK_METHOD6(StartPlayingFileLocally, |
| 181 | int(int channel, |
| 182 | InStream* stream, |
| 183 | FileFormats format, |
| 184 | float volumeScaling, |
| 185 | int startPointMs, |
| 186 | int stopPointMs)); |
| 187 | MOCK_METHOD1(StopPlayingFileLocally, int(int channel)); |
| 188 | MOCK_METHOD1(IsPlayingFileLocally, int(int channel)); |
| 189 | MOCK_METHOD6(StartPlayingFileAsMicrophone, |
| 190 | int(int channel, |
| 191 | const char fileNameUTF8[1024], |
| 192 | bool loop, |
| 193 | bool mixWithMicrophone, |
| 194 | FileFormats format, |
| 195 | float volumeScaling)); |
| 196 | MOCK_METHOD5(StartPlayingFileAsMicrophone, |
| 197 | int(int channel, |
| 198 | InStream* stream, |
| 199 | bool mixWithMicrophone, |
| 200 | FileFormats format, |
| 201 | float volumeScaling)); |
| 202 | MOCK_METHOD1(StopPlayingFileAsMicrophone, int(int channel)); |
| 203 | MOCK_METHOD1(IsPlayingFileAsMicrophone, int(int channel)); |
| 204 | MOCK_METHOD4(StartRecordingPlayout, |
| 205 | int(int channel, |
| 206 | const char* fileNameUTF8, |
| 207 | CodecInst* compression, |
| 208 | int maxSizeBytes)); |
| 209 | MOCK_METHOD1(StopRecordingPlayout, int(int channel)); |
| 210 | MOCK_METHOD3(StartRecordingPlayout, |
| 211 | int(int channel, OutStream* stream, CodecInst* compression)); |
| 212 | MOCK_METHOD3(StartRecordingMicrophone, |
| 213 | int(const char* fileNameUTF8, |
| 214 | CodecInst* compression, |
| 215 | int maxSizeBytes)); |
| 216 | MOCK_METHOD2(StartRecordingMicrophone, |
| 217 | int(OutStream* stream, CodecInst* compression)); |
| 218 | MOCK_METHOD0(StopRecordingMicrophone, int()); |
| 219 | |
| 220 | // VoEHardware |
| 221 | MOCK_METHOD1(GetNumOfRecordingDevices, int(int& devices)); |
| 222 | MOCK_METHOD1(GetNumOfPlayoutDevices, int(int& devices)); |
| 223 | MOCK_METHOD3(GetRecordingDeviceName, |
| 224 | int(int index, char strNameUTF8[128], char strGuidUTF8[128])); |
| 225 | MOCK_METHOD3(GetPlayoutDeviceName, |
| 226 | int(int index, char strNameUTF8[128], char strGuidUTF8[128])); |
| 227 | MOCK_METHOD2(SetRecordingDevice, |
| 228 | int(int index, StereoChannel recordingChannel)); |
| 229 | MOCK_METHOD1(SetPlayoutDevice, int(int index)); |
| 230 | MOCK_METHOD1(SetAudioDeviceLayer, int(AudioLayers audioLayer)); |
| 231 | MOCK_METHOD1(GetAudioDeviceLayer, int(AudioLayers& audioLayer)); |
| 232 | MOCK_METHOD1(SetRecordingSampleRate, int(unsigned int samples_per_sec)); |
| 233 | MOCK_CONST_METHOD1(RecordingSampleRate, int(unsigned int* samples_per_sec)); |
| 234 | MOCK_METHOD1(SetPlayoutSampleRate, int(unsigned int samples_per_sec)); |
| 235 | MOCK_CONST_METHOD1(PlayoutSampleRate, int(unsigned int* samples_per_sec)); |
| 236 | MOCK_CONST_METHOD0(BuiltInAECIsAvailable, bool()); |
| 237 | MOCK_METHOD1(EnableBuiltInAEC, int(bool enable)); |
| 238 | MOCK_CONST_METHOD0(BuiltInAGCIsAvailable, bool()); |
| 239 | MOCK_METHOD1(EnableBuiltInAGC, int(bool enable)); |
| 240 | MOCK_CONST_METHOD0(BuiltInNSIsAvailable, bool()); |
| 241 | MOCK_METHOD1(EnableBuiltInNS, int(bool enable)); |
| 242 | |
| 243 | // VoENetEqStats |
| 244 | MOCK_METHOD2(GetNetworkStatistics, |
| 245 | int(int channel, NetworkStatistics& stats)); |
| 246 | MOCK_CONST_METHOD2(GetDecodingCallStatistics, |
| 247 | int(int channel, AudioDecodingCallStats* stats)); |
| 248 | |
| 249 | // VoENetwork |
| 250 | MOCK_METHOD2(RegisterExternalTransport, |
| 251 | int(int channel, Transport& transport)); |
| 252 | MOCK_METHOD1(DeRegisterExternalTransport, int(int channel)); |
| 253 | MOCK_METHOD3(ReceivedRTPPacket, |
| 254 | int(int channel, const void* data, size_t length)); |
| 255 | MOCK_METHOD4(ReceivedRTPPacket, |
| 256 | int(int channel, |
| 257 | const void* data, |
| 258 | size_t length, |
| 259 | const PacketTime& packet_time)); |
| 260 | MOCK_METHOD3(ReceivedRTCPPacket, |
| 261 | int(int channel, const void* data, size_t length)); |
| 262 | |
| 263 | // VoERTP_RTCP |
| 264 | MOCK_METHOD2(SetLocalSSRC, int(int channel, unsigned int ssrc)); |
| 265 | MOCK_METHOD2(GetLocalSSRC, int(int channel, unsigned int& ssrc)); |
| 266 | MOCK_METHOD2(GetRemoteSSRC, int(int channel, unsigned int& ssrc)); |
| 267 | MOCK_METHOD3(SetSendAudioLevelIndicationStatus, |
| 268 | int(int channel, bool enable, unsigned char id)); |
| 269 | MOCK_METHOD3(SetReceiveAudioLevelIndicationStatus, |
| 270 | int(int channel, bool enable, unsigned char id)); |
| 271 | MOCK_METHOD3(SetSendAbsoluteSenderTimeStatus, |
| 272 | int(int channel, bool enable, unsigned char id)); |
| 273 | MOCK_METHOD3(SetReceiveAbsoluteSenderTimeStatus, |
| 274 | int(int channel, bool enable, unsigned char id)); |
| 275 | MOCK_METHOD2(SetRTCPStatus, int(int channel, bool enable)); |
| 276 | MOCK_METHOD2(GetRTCPStatus, int(int channel, bool& enabled)); |
| 277 | MOCK_METHOD2(SetRTCP_CNAME, int(int channel, const char cName[256])); |
| 278 | MOCK_METHOD2(GetRTCP_CNAME, int(int channel, char cName[256])); |
| 279 | MOCK_METHOD2(GetRemoteRTCP_CNAME, int(int channel, char cName[256])); |
| 280 | MOCK_METHOD7(GetRemoteRTCPData, |
| 281 | int(int channel, |
| 282 | unsigned int& NTPHigh, |
| 283 | unsigned int& NTPLow, |
| 284 | unsigned int& timestamp, |
| 285 | unsigned int& playoutTimestamp, |
| 286 | unsigned int* jitter, |
| 287 | unsigned short* fractionLost)); |
| 288 | MOCK_METHOD4(GetRTPStatistics, |
| 289 | int(int channel, |
| 290 | unsigned int& averageJitterMs, |
| 291 | unsigned int& maxJitterMs, |
| 292 | unsigned int& discardedPackets)); |
| 293 | MOCK_METHOD2(GetRTCPStatistics, int(int channel, CallStatistics& stats)); |
| 294 | MOCK_METHOD2(GetRemoteRTCPReportBlocks, |
| 295 | int(int channel, std::vector<ReportBlock>* receive_blocks)); |
| 296 | MOCK_METHOD3(SetREDStatus, int(int channel, bool enable, int redPayloadtype)); |
| 297 | MOCK_METHOD3(GetREDStatus, |
| 298 | int(int channel, bool& enable, int& redPayloadtype)); |
| 299 | MOCK_METHOD3(SetNACKStatus, int(int channel, bool enable, int maxNoPackets)); |
| 300 | |
| 301 | // VoEVideoSync |
| 302 | MOCK_METHOD1(GetPlayoutBufferSize, int(int& buffer_ms)); |
| 303 | MOCK_METHOD2(SetMinimumPlayoutDelay, int(int channel, int delay_ms)); |
| 304 | MOCK_METHOD3(GetDelayEstimate, |
| 305 | int(int channel, |
| 306 | int* jitter_buffer_delay_ms, |
| 307 | int* playout_buffer_delay_ms)); |
| 308 | MOCK_CONST_METHOD1(GetLeastRequiredDelayMs, int(int channel)); |
| 309 | MOCK_METHOD2(SetInitTimestamp, int(int channel, unsigned int timestamp)); |
| 310 | MOCK_METHOD2(SetInitSequenceNumber, int(int channel, short sequenceNumber)); |
| 311 | MOCK_METHOD2(GetPlayoutTimestamp, int(int channel, unsigned int& timestamp)); |
| 312 | MOCK_METHOD3(GetRtpRtcp, |
| 313 | int(int channel, |
| 314 | RtpRtcp** rtpRtcpModule, |
| 315 | RtpReceiver** rtp_receiver)); |
| 316 | |
| 317 | // VoEVolumeControl |
| 318 | MOCK_METHOD1(SetSpeakerVolume, int(unsigned int volume)); |
| 319 | MOCK_METHOD1(GetSpeakerVolume, int(unsigned int& volume)); |
| 320 | MOCK_METHOD1(SetMicVolume, int(unsigned int volume)); |
| 321 | MOCK_METHOD1(GetMicVolume, int(unsigned int& volume)); |
| 322 | MOCK_METHOD2(SetInputMute, int(int channel, bool enable)); |
| 323 | MOCK_METHOD2(GetInputMute, int(int channel, bool& enabled)); |
| 324 | MOCK_METHOD1(GetSpeechInputLevel, int(unsigned int& level)); |
| 325 | MOCK_METHOD2(GetSpeechOutputLevel, int(int channel, unsigned int& level)); |
| 326 | MOCK_METHOD1(GetSpeechInputLevelFullRange, int(unsigned int& level)); |
| 327 | MOCK_METHOD2(GetSpeechOutputLevelFullRange, |
| 328 | int(int channel, unsigned& level)); |
| 329 | MOCK_METHOD2(SetChannelOutputVolumeScaling, int(int channel, float scaling)); |
| 330 | MOCK_METHOD2(GetChannelOutputVolumeScaling, int(int channel, float& scaling)); |
| 331 | MOCK_METHOD3(SetOutputVolumePan, int(int channel, float left, float right)); |
| 332 | MOCK_METHOD3(GetOutputVolumePan, int(int channel, float& left, float& right)); |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 333 | |
| 334 | private: |
| 335 | // TODO(ossu): I'm not particularly happy about keeping the decoder factory |
| 336 | // here, but due to how gmock is implemented, I cannot just keep it in the |
| 337 | // functor implementing the default version of ChannelProxyFactory, above. |
| 338 | // GMock creates an unfortunate copy of the functor, which would cause us to |
| 339 | // return a dangling reference. Fortunately, this should go away once |
| 340 | // voe::Channel does. |
| 341 | rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; |
Fredrik Solenberg | 0ccae13 | 2015-11-03 10:15:49 +0100 | [diff] [blame] | 342 | }; |
| 343 | } // namespace test |
| 344 | } // namespace webrtc |
| 345 | |
| 346 | #endif // WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_ |