OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #include <functional> | 10 #include <functional> |
11 #include <list> | 11 #include <list> |
12 #include <memory> | 12 #include <memory> |
13 #include <string> | 13 #include <string> |
14 | 14 |
15 #include "webrtc/api/call/audio_state.h" | 15 #include "webrtc/api/call/audio_state.h" |
16 #include "webrtc/base/checks.h" | 16 #include "webrtc/base/checks.h" |
17 #include "webrtc/base/event.h" | 17 #include "webrtc/base/event.h" |
18 #include "webrtc/base/logging.h" | 18 #include "webrtc/base/logging.h" |
19 #include "webrtc/base/thread_annotations.h" | 19 #include "webrtc/base/thread_annotations.h" |
20 #include "webrtc/call.h" | 20 #include "webrtc/call.h" |
21 #include "webrtc/modules/audio_device/include/mock_audio_device.h" | |
21 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | 22 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
22 #include "webrtc/system_wrappers/include/trace.h" | 23 #include "webrtc/system_wrappers/include/trace.h" |
23 #include "webrtc/test/call_test.h" | 24 #include "webrtc/test/call_test.h" |
24 #include "webrtc/test/direct_transport.h" | 25 #include "webrtc/test/direct_transport.h" |
25 #include "webrtc/test/encoder_settings.h" | 26 #include "webrtc/test/encoder_settings.h" |
26 #include "webrtc/test/fake_decoder.h" | 27 #include "webrtc/test/fake_decoder.h" |
27 #include "webrtc/test/fake_encoder.h" | 28 #include "webrtc/test/fake_encoder.h" |
28 #include "webrtc/test/frame_generator_capturer.h" | 29 #include "webrtc/test/frame_generator_capturer.h" |
29 #include "webrtc/test/gtest.h" | 30 #include "webrtc/test/gtest.h" |
30 #include "webrtc/test/mock_voice_engine.h" | 31 #include "webrtc/test/mock_voice_engine.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 class BitrateEstimatorTest : public test::CallTest { | 103 class BitrateEstimatorTest : public test::CallTest { |
103 public: | 104 public: |
104 BitrateEstimatorTest() : mock_voice_engine_(decoder_factory_), | 105 BitrateEstimatorTest() : mock_voice_engine_(decoder_factory_), |
105 receive_config_(nullptr) {} | 106 receive_config_(nullptr) {} |
106 | 107 |
107 virtual ~BitrateEstimatorTest() { EXPECT_TRUE(streams_.empty()); } | 108 virtual ~BitrateEstimatorTest() { EXPECT_TRUE(streams_.empty()); } |
108 | 109 |
109 virtual void SetUp() { | 110 virtual void SetUp() { |
110 AudioState::Config audio_state_config; | 111 AudioState::Config audio_state_config; |
111 audio_state_config.voice_engine = &mock_voice_engine_; | 112 audio_state_config.voice_engine = &mock_voice_engine_; |
113 ON_CALL(mock_voice_engine_, audio_device_module()) | |
114 .WillByDefault(Return(&mock_audio_device_)); | |
stefan-webrtc
2016/11/03 14:33:53
Could you try to remove everything audio related h
aleloi
2016/11/08 11:46:41
I've done it in another CL; I'll rebase this one a
| |
112 Call::Config config(&event_log_); | 115 Call::Config config(&event_log_); |
113 config.audio_state = AudioState::Create(audio_state_config); | 116 config.audio_state = AudioState::Create(audio_state_config); |
114 receiver_call_.reset(Call::Create(config)); | 117 receiver_call_.reset(Call::Create(config)); |
115 sender_call_.reset(Call::Create(config)); | 118 sender_call_.reset(Call::Create(config)); |
116 | 119 |
117 send_transport_.reset(new test::DirectTransport(sender_call_.get())); | 120 send_transport_.reset(new test::DirectTransport(sender_call_.get())); |
118 send_transport_->SetReceiver(receiver_call_->Receiver()); | 121 send_transport_->SetReceiver(receiver_call_->Receiver()); |
119 receive_transport_.reset(new test::DirectTransport(receiver_call_.get())); | 122 receive_transport_.reset(new test::DirectTransport(receiver_call_.get())); |
120 receive_transport_->SetReceiver(sender_call_->Receiver()); | 123 receive_transport_->SetReceiver(sender_call_->Receiver()); |
121 | 124 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
245 bool is_sending_receiving_; | 248 bool is_sending_receiving_; |
246 VideoSendStream* send_stream_; | 249 VideoSendStream* send_stream_; |
247 AudioReceiveStream* audio_receive_stream_; | 250 AudioReceiveStream* audio_receive_stream_; |
248 VideoReceiveStream* video_receive_stream_; | 251 VideoReceiveStream* video_receive_stream_; |
249 std::unique_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_; | 252 std::unique_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_; |
250 test::FakeEncoder fake_encoder_; | 253 test::FakeEncoder fake_encoder_; |
251 test::FakeDecoder fake_decoder_; | 254 test::FakeDecoder fake_decoder_; |
252 }; | 255 }; |
253 | 256 |
254 testing::NiceMock<test::MockVoiceEngine> mock_voice_engine_; | 257 testing::NiceMock<test::MockVoiceEngine> mock_voice_engine_; |
258 testing::NiceMock<webrtc::test::MockAudioDeviceModule> mock_audio_device_; | |
255 LogObserver receiver_log_; | 259 LogObserver receiver_log_; |
256 std::unique_ptr<test::DirectTransport> send_transport_; | 260 std::unique_ptr<test::DirectTransport> send_transport_; |
257 std::unique_ptr<test::DirectTransport> receive_transport_; | 261 std::unique_ptr<test::DirectTransport> receive_transport_; |
258 std::unique_ptr<Call> sender_call_; | 262 std::unique_ptr<Call> sender_call_; |
259 std::unique_ptr<Call> receiver_call_; | 263 std::unique_ptr<Call> receiver_call_; |
260 VideoReceiveStream::Config receive_config_; | 264 VideoReceiveStream::Config receive_config_; |
261 std::vector<Stream*> streams_; | 265 std::vector<Stream*> streams_; |
262 }; | 266 }; |
263 | 267 |
264 static const char* kAbsSendTimeLog = | 268 static const char* kAbsSendTimeLog = |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId); | 327 RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId); |
324 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog); | 328 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog); |
325 receiver_log_.PushExpectedLogLine( | 329 receiver_log_.PushExpectedLogLine( |
326 "WrappingBitrateEstimator: Switching to transmission time offset RBE."); | 330 "WrappingBitrateEstimator: Switching to transmission time offset RBE."); |
327 streams_.push_back(new Stream(this, false)); | 331 streams_.push_back(new Stream(this, false)); |
328 streams_[0]->StopSending(); | 332 streams_[0]->StopSending(); |
329 streams_[1]->StopSending(); | 333 streams_[1]->StopSending(); |
330 EXPECT_TRUE(receiver_log_.Wait()); | 334 EXPECT_TRUE(receiver_log_.Wait()); |
331 } | 335 } |
332 } // namespace webrtc | 336 } // namespace webrtc |
OLD | NEW |