Chromium Code Reviews| 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/logging/rtc_event_log/rtc_event_log.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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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_; |
| 112 Call::Config config; | 113 Call::Config config; |
| 114 config.event_log = &event_log_; | |
| 113 config.audio_state = AudioState::Create(audio_state_config); | 115 config.audio_state = AudioState::Create(audio_state_config); |
| 114 receiver_call_.reset(Call::Create(config)); | 116 receiver_call_.reset(Call::Create(config)); |
| 115 sender_call_.reset(Call::Create(config)); | 117 sender_call_.reset(Call::Create(config)); |
| 116 | 118 |
| 117 send_transport_.reset(new test::DirectTransport(sender_call_.get())); | 119 send_transport_.reset(new test::DirectTransport(sender_call_.get())); |
| 118 send_transport_->SetReceiver(receiver_call_->Receiver()); | 120 send_transport_->SetReceiver(receiver_call_->Receiver()); |
| 119 receive_transport_.reset(new test::DirectTransport(receiver_call_.get())); | 121 receive_transport_.reset(new test::DirectTransport(receiver_call_.get())); |
| 120 receive_transport_->SetReceiver(sender_call_->Receiver()); | 122 receive_transport_->SetReceiver(sender_call_->Receiver()); |
| 121 | 123 |
| 122 video_send_config_ = VideoSendStream::Config(send_transport_.get()); | 124 video_send_config_ = VideoSendStream::Config(send_transport_.get()); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 244 BitrateEstimatorTest* test_; | 246 BitrateEstimatorTest* test_; |
| 245 bool is_sending_receiving_; | 247 bool is_sending_receiving_; |
| 246 VideoSendStream* send_stream_; | 248 VideoSendStream* send_stream_; |
| 247 AudioReceiveStream* audio_receive_stream_; | 249 AudioReceiveStream* audio_receive_stream_; |
| 248 VideoReceiveStream* video_receive_stream_; | 250 VideoReceiveStream* video_receive_stream_; |
| 249 std::unique_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_; | 251 std::unique_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_; |
| 250 test::FakeEncoder fake_encoder_; | 252 test::FakeEncoder fake_encoder_; |
| 251 test::FakeDecoder fake_decoder_; | 253 test::FakeDecoder fake_decoder_; |
| 252 }; | 254 }; |
| 253 | 255 |
| 256 webrtc::RtcEventLogNullImpl event_log_; | |
|
stefan-webrtc
2016/10/05 07:35:22
This is a CallTest and should already have the eve
skvlad
2016/10/06 01:31:38
Done.
| |
| 254 testing::NiceMock<test::MockVoiceEngine> mock_voice_engine_; | 257 testing::NiceMock<test::MockVoiceEngine> mock_voice_engine_; |
| 255 LogObserver receiver_log_; | 258 LogObserver receiver_log_; |
| 256 std::unique_ptr<test::DirectTransport> send_transport_; | 259 std::unique_ptr<test::DirectTransport> send_transport_; |
| 257 std::unique_ptr<test::DirectTransport> receive_transport_; | 260 std::unique_ptr<test::DirectTransport> receive_transport_; |
| 258 std::unique_ptr<Call> sender_call_; | 261 std::unique_ptr<Call> sender_call_; |
| 259 std::unique_ptr<Call> receiver_call_; | 262 std::unique_ptr<Call> receiver_call_; |
| 260 VideoReceiveStream::Config receive_config_; | 263 VideoReceiveStream::Config receive_config_; |
| 261 std::vector<Stream*> streams_; | 264 std::vector<Stream*> streams_; |
| 262 }; | 265 }; |
| 263 | 266 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 323 RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId); | 326 RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId); |
| 324 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog); | 327 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog); |
| 325 receiver_log_.PushExpectedLogLine( | 328 receiver_log_.PushExpectedLogLine( |
| 326 "WrappingBitrateEstimator: Switching to transmission time offset RBE."); | 329 "WrappingBitrateEstimator: Switching to transmission time offset RBE."); |
| 327 streams_.push_back(new Stream(this, false)); | 330 streams_.push_back(new Stream(this, false)); |
| 328 streams_[0]->StopSending(); | 331 streams_[0]->StopSending(); |
| 329 streams_[1]->StopSending(); | 332 streams_[1]->StopSending(); |
| 330 EXPECT_TRUE(receiver_log_.Wait()); | 333 EXPECT_TRUE(receiver_log_.Wait()); |
| 331 } | 334 } |
| 332 } // namespace webrtc | 335 } // namespace webrtc |
| OLD | NEW |