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> |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 static const int kTOFExtensionId = 4; | 111 static const int kTOFExtensionId = 4; |
112 static const int kASTExtensionId = 5; | 112 static const int kASTExtensionId = 5; |
113 | 113 |
114 class BitrateEstimatorTest : public test::CallTest { | 114 class BitrateEstimatorTest : public test::CallTest { |
115 public: | 115 public: |
116 BitrateEstimatorTest() : receive_config_(nullptr) {} | 116 BitrateEstimatorTest() : receive_config_(nullptr) {} |
117 | 117 |
118 virtual ~BitrateEstimatorTest() { EXPECT_TRUE(streams_.empty()); } | 118 virtual ~BitrateEstimatorTest() { EXPECT_TRUE(streams_.empty()); } |
119 | 119 |
120 virtual void SetUp() { | 120 virtual void SetUp() { |
121 EXPECT_CALL(mock_voice_engine_, | |
122 RegisterVoiceEngineObserver(testing::_)).WillOnce(testing::Return(0)); | |
123 EXPECT_CALL(mock_voice_engine_, | |
124 DeRegisterVoiceEngineObserver()).WillOnce(testing::Return(0)); | |
125 EXPECT_CALL(mock_voice_engine_, GetEventLog()) | |
126 .WillRepeatedly(testing::Return(nullptr)); | |
127 | |
128 AudioState::Config audio_state_config; | 121 AudioState::Config audio_state_config; |
129 audio_state_config.voice_engine = &mock_voice_engine_; | 122 audio_state_config.voice_engine = &mock_voice_engine_; |
130 Call::Config config; | 123 Call::Config config; |
131 config.audio_state = AudioState::Create(audio_state_config); | 124 config.audio_state = AudioState::Create(audio_state_config); |
132 receiver_call_.reset(Call::Create(config)); | 125 receiver_call_.reset(Call::Create(config)); |
133 sender_call_.reset(Call::Create(config)); | 126 sender_call_.reset(Call::Create(config)); |
134 | 127 |
135 send_transport_.reset(new test::DirectTransport(sender_call_.get())); | 128 send_transport_.reset(new test::DirectTransport(sender_call_.get())); |
136 send_transport_->SetReceiver(receiver_call_->Receiver()); | 129 send_transport_->SetReceiver(receiver_call_->Receiver()); |
137 receive_transport_.reset(new test::DirectTransport(receiver_call_.get())); | 130 receive_transport_.reset(new test::DirectTransport(receiver_call_.get())); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 BitrateEstimatorTest* test_; | 251 BitrateEstimatorTest* test_; |
259 bool is_sending_receiving_; | 252 bool is_sending_receiving_; |
260 VideoSendStream* send_stream_; | 253 VideoSendStream* send_stream_; |
261 AudioReceiveStream* audio_receive_stream_; | 254 AudioReceiveStream* audio_receive_stream_; |
262 VideoReceiveStream* video_receive_stream_; | 255 VideoReceiveStream* video_receive_stream_; |
263 rtc::scoped_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_; | 256 rtc::scoped_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_; |
264 test::FakeEncoder fake_encoder_; | 257 test::FakeEncoder fake_encoder_; |
265 test::FakeDecoder fake_decoder_; | 258 test::FakeDecoder fake_decoder_; |
266 }; | 259 }; |
267 | 260 |
268 test::MockVoiceEngine mock_voice_engine_; | 261 testing::NiceMock<test::MockVoiceEngine> mock_voice_engine_; |
269 TraceObserver receiver_trace_; | 262 TraceObserver receiver_trace_; |
270 rtc::scoped_ptr<test::DirectTransport> send_transport_; | 263 rtc::scoped_ptr<test::DirectTransport> send_transport_; |
271 rtc::scoped_ptr<test::DirectTransport> receive_transport_; | 264 rtc::scoped_ptr<test::DirectTransport> receive_transport_; |
272 rtc::scoped_ptr<Call> sender_call_; | 265 rtc::scoped_ptr<Call> sender_call_; |
273 rtc::scoped_ptr<Call> receiver_call_; | 266 rtc::scoped_ptr<Call> receiver_call_; |
274 VideoReceiveStream::Config receive_config_; | 267 VideoReceiveStream::Config receive_config_; |
275 std::vector<Stream*> streams_; | 268 std::vector<Stream*> streams_; |
276 }; | 269 }; |
277 | 270 |
278 static const char* kAbsSendTimeLog = | 271 static const char* kAbsSendTimeLog = |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId); | 353 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId); |
361 receiver_trace_.PushExpectedLogLine( | 354 receiver_trace_.PushExpectedLogLine( |
362 "WrappingBitrateEstimator: Switching to transmission time offset RBE."); | 355 "WrappingBitrateEstimator: Switching to transmission time offset RBE."); |
363 receiver_trace_.PushExpectedLogLine(kSingleStreamLog); | 356 receiver_trace_.PushExpectedLogLine(kSingleStreamLog); |
364 streams_.push_back(new Stream(this, false)); | 357 streams_.push_back(new Stream(this, false)); |
365 streams_[0]->StopSending(); | 358 streams_[0]->StopSending(); |
366 streams_[1]->StopSending(); | 359 streams_[1]->StopSending(); |
367 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); | 360 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); |
368 } | 361 } |
369 } // namespace webrtc | 362 } // namespace webrtc |
OLD | NEW |