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