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 |
11 #include <list> | 11 #include <list> |
12 | 12 |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 #include "webrtc/audio_state.h" | 15 #include "webrtc/audio_state.h" |
16 #include "webrtc/call.h" | 16 #include "webrtc/call.h" |
17 #include "webrtc/test/mock_voice_engine.h" | 17 #include "webrtc/test/mock_voice_engine.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 struct CallHelper { | 21 struct CallHelper { |
22 CallHelper() { | 22 CallHelper() { |
23 EXPECT_CALL(voice_engine_, | |
24 RegisterVoiceEngineObserver(testing::_)).WillOnce(testing::Return(0)); | |
25 EXPECT_CALL(voice_engine_, | |
26 DeRegisterVoiceEngineObserver()).WillOnce(testing::Return(0)); | |
27 EXPECT_CALL(voice_engine_, | |
28 GetEventLog()).WillOnce(testing::Return(nullptr)); | |
29 webrtc::AudioState::Config audio_state_config; | 23 webrtc::AudioState::Config audio_state_config; |
30 audio_state_config.voice_engine = &voice_engine_; | 24 audio_state_config.voice_engine = &voice_engine_; |
31 webrtc::Call::Config config; | 25 webrtc::Call::Config config; |
32 config.audio_state = webrtc::AudioState::Create(audio_state_config); | 26 config.audio_state = webrtc::AudioState::Create(audio_state_config); |
33 call_.reset(webrtc::Call::Create(config)); | 27 call_.reset(webrtc::Call::Create(config)); |
34 } | 28 } |
35 | 29 |
36 webrtc::Call* operator->() { return call_.get(); } | 30 webrtc::Call* operator->() { return call_.get(); } |
37 | 31 |
38 private: | 32 private: |
39 webrtc::test::MockVoiceEngine voice_engine_; | 33 testing::NiceMock<webrtc::test::MockVoiceEngine> voice_engine_; |
40 rtc::scoped_ptr<webrtc::Call> call_; | 34 rtc::scoped_ptr<webrtc::Call> call_; |
41 }; | 35 }; |
42 } // namespace | 36 } // namespace |
43 | 37 |
44 namespace webrtc { | 38 namespace webrtc { |
45 | 39 |
46 TEST(CallTest, ConstructDestruct) { | 40 TEST(CallTest, ConstructDestruct) { |
47 CallHelper call; | 41 CallHelper call; |
48 } | 42 } |
49 | 43 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 streams.push_front(stream); | 100 streams.push_front(stream); |
107 } | 101 } |
108 } | 102 } |
109 for (auto s : streams) { | 103 for (auto s : streams) { |
110 call->DestroyAudioReceiveStream(s); | 104 call->DestroyAudioReceiveStream(s); |
111 } | 105 } |
112 streams.clear(); | 106 streams.clear(); |
113 } | 107 } |
114 } | 108 } |
115 } // namespace webrtc | 109 } // namespace webrtc |
OLD | NEW |