Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: webrtc/test/mock_voice_engine.h

Issue 1702983002: Replace scoped_ptr with unique_ptr in webrtc/voice_engine/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/base/scoped_ptr.h ('k') | webrtc/voice_engine/channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #ifndef WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_ 11 #ifndef WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_
12 #define WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_ 12 #define WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_
13 13
14 #include <memory>
15
14 #include "testing/gmock/include/gmock/gmock.h" 16 #include "testing/gmock/include/gmock/gmock.h"
15 #include "webrtc/test/mock_voe_channel_proxy.h" 17 #include "webrtc/test/mock_voe_channel_proxy.h"
16 #include "webrtc/voice_engine/voice_engine_impl.h" 18 #include "webrtc/voice_engine/voice_engine_impl.h"
17 19
18 namespace webrtc { 20 namespace webrtc {
19 namespace test { 21 namespace test {
20 22
21 // 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
22 // able to get the various interfaces as usual, via T::GetInterface(). 24 // able to get the various interfaces as usual, via T::GetInterface().
23 class MockVoiceEngine : public VoiceEngineImpl { 25 class MockVoiceEngine : public VoiceEngineImpl {
(...skipping 12 matching lines...) Expand all
36 } 38 }
37 ~MockVoiceEngine() override { 39 ~MockVoiceEngine() override {
38 // Decrease ref count before base class d-tor is called; otherwise it will 40 // Decrease ref count before base class d-tor is called; otherwise it will
39 // trigger an assertion. 41 // trigger an assertion.
40 --_ref_count; 42 --_ref_count;
41 } 43 }
42 // Allows injecting a ChannelProxy factory. 44 // Allows injecting a ChannelProxy factory.
43 MOCK_METHOD1(ChannelProxyFactory, voe::ChannelProxy*(int channel_id)); 45 MOCK_METHOD1(ChannelProxyFactory, voe::ChannelProxy*(int channel_id));
44 46
45 // VoiceEngineImpl 47 // VoiceEngineImpl
46 rtc::scoped_ptr<voe::ChannelProxy> GetChannelProxy(int channel_id) override { 48 std::unique_ptr<voe::ChannelProxy> GetChannelProxy(int channel_id) override {
47 return rtc::scoped_ptr<voe::ChannelProxy>(ChannelProxyFactory(channel_id)); 49 return std::unique_ptr<voe::ChannelProxy>(ChannelProxyFactory(channel_id));
48 } 50 }
49 51
50 // VoEAudioProcessing 52 // VoEAudioProcessing
51 MOCK_METHOD2(SetNsStatus, int(bool enable, NsModes mode)); 53 MOCK_METHOD2(SetNsStatus, int(bool enable, NsModes mode));
52 MOCK_METHOD2(GetNsStatus, int(bool& enabled, NsModes& mode)); 54 MOCK_METHOD2(GetNsStatus, int(bool& enabled, NsModes& mode));
53 MOCK_METHOD2(SetAgcStatus, int(bool enable, AgcModes mode)); 55 MOCK_METHOD2(SetAgcStatus, int(bool enable, AgcModes mode));
54 MOCK_METHOD2(GetAgcStatus, int(bool& enabled, AgcModes& mode)); 56 MOCK_METHOD2(GetAgcStatus, int(bool& enabled, AgcModes& mode));
55 MOCK_METHOD1(SetAgcConfig, int(AgcConfig config)); 57 MOCK_METHOD1(SetAgcConfig, int(AgcConfig config));
56 MOCK_METHOD1(GetAgcConfig, int(AgcConfig& config)); 58 MOCK_METHOD1(GetAgcConfig, int(AgcConfig& config));
57 MOCK_METHOD2(SetEcStatus, int(bool enable, EcModes mode)); 59 MOCK_METHOD2(SetEcStatus, int(bool enable, EcModes mode));
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 int(int channel, unsigned& level)); 330 int(int channel, unsigned& level));
329 MOCK_METHOD2(SetChannelOutputVolumeScaling, int(int channel, float scaling)); 331 MOCK_METHOD2(SetChannelOutputVolumeScaling, int(int channel, float scaling));
330 MOCK_METHOD2(GetChannelOutputVolumeScaling, int(int channel, float& scaling)); 332 MOCK_METHOD2(GetChannelOutputVolumeScaling, int(int channel, float& scaling));
331 MOCK_METHOD3(SetOutputVolumePan, int(int channel, float left, float right)); 333 MOCK_METHOD3(SetOutputVolumePan, int(int channel, float left, float right));
332 MOCK_METHOD3(GetOutputVolumePan, int(int channel, float& left, float& right)); 334 MOCK_METHOD3(GetOutputVolumePan, int(int channel, float& left, float& right));
333 }; 335 };
334 } // namespace test 336 } // namespace test
335 } // namespace webrtc 337 } // namespace webrtc
336 338
337 #endif // WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_ 339 #endif // WEBRTC_AUDIO_MOCK_VOICE_ENGINE_H_
OLDNEW
« no previous file with comments | « webrtc/base/scoped_ptr.h ('k') | webrtc/voice_engine/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698