OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... | |
23 // NOTE: This class inherits from VoiceEngineImpl so that its clients will be | 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(). | 24 // able to get the various interfaces as usual, via T::GetInterface(). |
25 class MockVoiceEngine : public VoiceEngineImpl { | 25 class MockVoiceEngine : public VoiceEngineImpl { |
26 public: | 26 public: |
27 // TODO(nisse): Valid overrides commented out, because the gmock | 27 // TODO(nisse): Valid overrides commented out, because the gmock |
28 // methods don't use any override declarations, and we want to avoid | 28 // methods don't use any override declarations, and we want to avoid |
29 // warnings from -Winconsistent-missing-override. See | 29 // warnings from -Winconsistent-missing-override. See |
30 // http://crbug.com/428099. | 30 // http://crbug.com/428099. |
31 MockVoiceEngine( | 31 MockVoiceEngine( |
32 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory = nullptr) | 32 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory = nullptr) |
33 : VoiceEngineImpl(new Config(), true), | 33 : VoiceEngineImpl(), |
tommi
2016/09/01 21:02:11
necessary?
the sun
2016/09/02 07:02:46
Done.
| |
34 decoder_factory_(decoder_factory) { | 34 decoder_factory_(decoder_factory) { |
35 // Increase ref count so this object isn't automatically deleted whenever | 35 // Increase ref count so this object isn't automatically deleted whenever |
36 // interfaces are Release():d. | 36 // interfaces are Release():d. |
37 ++_ref_count; | 37 ++_ref_count; |
38 // We add this default behavior to make the mock easier to use in tests. It | 38 // We add this default behavior to make the mock easier to use in tests. It |
39 // will create a NiceMock of a voe::ChannelProxy. | 39 // will create a NiceMock of a voe::ChannelProxy. |
40 // TODO(ossu): As long as AudioReceiveStream is implmented as a wrapper | 40 // TODO(ossu): As long as AudioReceiveStream is implmented as a wrapper |
41 // around Channel, we need to make sure ChannelProxy returns the same | 41 // around Channel, we need to make sure ChannelProxy returns the same |
42 // decoder factory as the one passed in when creating an AudioReceiveStream. | 42 // decoder factory as the one passed in when creating an AudioReceiveStream. |
43 ON_CALL(*this, ChannelProxyFactory(testing::_)) | 43 ON_CALL(*this, ChannelProxyFactory(testing::_)) |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 MOCK_METHOD1(RegisterVoiceEngineObserver, int(VoiceEngineObserver& observer)); | 116 MOCK_METHOD1(RegisterVoiceEngineObserver, int(VoiceEngineObserver& observer)); |
117 MOCK_METHOD0(DeRegisterVoiceEngineObserver, int()); | 117 MOCK_METHOD0(DeRegisterVoiceEngineObserver, int()); |
118 MOCK_METHOD3( | 118 MOCK_METHOD3( |
119 Init, | 119 Init, |
120 int(AudioDeviceModule* external_adm, | 120 int(AudioDeviceModule* external_adm, |
121 AudioProcessing* audioproc, | 121 AudioProcessing* audioproc, |
122 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory)); | 122 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory)); |
123 MOCK_METHOD0(audio_processing, AudioProcessing*()); | 123 MOCK_METHOD0(audio_processing, AudioProcessing*()); |
124 MOCK_METHOD0(Terminate, int()); | 124 MOCK_METHOD0(Terminate, int()); |
125 MOCK_METHOD0(CreateChannel, int()); | 125 MOCK_METHOD0(CreateChannel, int()); |
126 MOCK_METHOD1(CreateChannel, int(const Config& config)); | 126 MOCK_METHOD1(CreateChannel, int(const AudioCodingModule::Config& acm_config)); |
127 MOCK_METHOD1(DeleteChannel, int(int channel)); | 127 MOCK_METHOD1(DeleteChannel, int(int channel)); |
128 MOCK_METHOD1(StartReceive, int(int channel)); | 128 MOCK_METHOD1(StartReceive, int(int channel)); |
129 MOCK_METHOD1(StopReceive, int(int channel)); | 129 MOCK_METHOD1(StopReceive, int(int channel)); |
130 MOCK_METHOD1(StartPlayout, int(int channel)); | 130 MOCK_METHOD1(StartPlayout, int(int channel)); |
131 MOCK_METHOD1(StopPlayout, int(int channel)); | 131 MOCK_METHOD1(StopPlayout, int(int channel)); |
132 MOCK_METHOD1(StartSend, int(int channel)); | 132 MOCK_METHOD1(StartSend, int(int channel)); |
133 MOCK_METHOD1(StopSend, int(int channel)); | 133 MOCK_METHOD1(StopSend, int(int channel)); |
134 MOCK_METHOD1(GetVersion, int(char version[1024])); | 134 MOCK_METHOD1(GetVersion, int(char version[1024])); |
135 MOCK_METHOD0(LastError, int()); | 135 MOCK_METHOD0(LastError, int()); |
136 MOCK_METHOD0(audio_transport, AudioTransport*()); | 136 MOCK_METHOD0(audio_transport, AudioTransport*()); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
338 // functor implementing the default version of ChannelProxyFactory, above. | 338 // functor implementing the default version of ChannelProxyFactory, above. |
339 // GMock creates an unfortunate copy of the functor, which would cause us to | 339 // GMock creates an unfortunate copy of the functor, which would cause us to |
340 // return a dangling reference. Fortunately, this should go away once | 340 // return a dangling reference. Fortunately, this should go away once |
341 // voe::Channel does. | 341 // voe::Channel does. |
342 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; | 342 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; |
343 }; | 343 }; |
344 } // namespace test | 344 } // namespace test |
345 } // namespace webrtc | 345 } // namespace webrtc |
346 | 346 |
347 #endif // WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_ | 347 #endif // WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_ |
OLD | NEW |