Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: webrtc/call/bitrate_estimator_tests.cc

Issue 1390753002: Implement AudioReceiveStream::GetStats(). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: merge master Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/audio_receive_stream.h ('k') | webrtc/call/call.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <string> 12 #include <string>
13 13
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 #include "webrtc/base/checks.h" 16 #include "webrtc/base/checks.h"
17 #include "webrtc/base/scoped_ptr.h" 17 #include "webrtc/base/scoped_ptr.h"
18 #include "webrtc/base/thread_annotations.h" 18 #include "webrtc/base/thread_annotations.h"
19 #include "webrtc/call.h" 19 #include "webrtc/call.h"
20 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" 20 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
21 #include "webrtc/system_wrappers/interface/event_wrapper.h" 21 #include "webrtc/system_wrappers/interface/event_wrapper.h"
22 #include "webrtc/system_wrappers/interface/trace.h" 22 #include "webrtc/system_wrappers/interface/trace.h"
23 #include "webrtc/test/call_test.h" 23 #include "webrtc/test/call_test.h"
24 #include "webrtc/test/direct_transport.h" 24 #include "webrtc/test/direct_transport.h"
25 #include "webrtc/test/encoder_settings.h" 25 #include "webrtc/test/encoder_settings.h"
26 #include "webrtc/test/fake_decoder.h" 26 #include "webrtc/test/fake_decoder.h"
27 #include "webrtc/test/fake_encoder.h" 27 #include "webrtc/test/fake_encoder.h"
28 #include "webrtc/test/fake_voice_engine.h"
28 #include "webrtc/test/frame_generator_capturer.h" 29 #include "webrtc/test/frame_generator_capturer.h"
29 30
30 namespace webrtc { 31 namespace webrtc {
31 namespace { 32 namespace {
32 // Note: If you consider to re-use this class, think twice and instead consider 33 // Note: If you consider to re-use this class, think twice and instead consider
33 // writing tests that don't depend on the trace system. 34 // writing tests that don't depend on the trace system.
34 class TraceObserver { 35 class TraceObserver {
35 public: 36 public:
36 TraceObserver() { 37 TraceObserver() {
37 Trace::set_level_filter(kTraceTerseInfo); 38 Trace::set_level_filter(kTraceTerseInfo);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 receiver_call_(), 124 receiver_call_(),
124 receive_config_(nullptr), 125 receive_config_(nullptr),
125 streams_() { 126 streams_() {
126 } 127 }
127 128
128 virtual ~BitrateEstimatorTest() { 129 virtual ~BitrateEstimatorTest() {
129 EXPECT_TRUE(streams_.empty()); 130 EXPECT_TRUE(streams_.empty());
130 } 131 }
131 132
132 virtual void SetUp() { 133 virtual void SetUp() {
133 receiver_call_.reset(Call::Create(Call::Config())); 134 Call::Config config;
134 sender_call_.reset(Call::Create(Call::Config())); 135 config.voice_engine = &fake_voice_engine_;
136 receiver_call_.reset(Call::Create(config));
137 sender_call_.reset(Call::Create(config));
135 138
136 send_transport_.SetReceiver(receiver_call_->Receiver()); 139 send_transport_.SetReceiver(receiver_call_->Receiver());
137 receive_transport_.SetReceiver(sender_call_->Receiver()); 140 receive_transport_.SetReceiver(sender_call_->Receiver());
138 141
139 send_config_ = VideoSendStream::Config(&send_transport_); 142 send_config_ = VideoSendStream::Config(&send_transport_);
140 send_config_.rtp.ssrcs.push_back(kSendSsrcs[0]); 143 send_config_.rtp.ssrcs.push_back(kSendSsrcs[0]);
141 // Encoders will be set separately per stream. 144 // Encoders will be set separately per stream.
142 send_config_.encoder_settings.encoder = nullptr; 145 send_config_.encoder_settings.encoder = nullptr;
143 send_config_.encoder_settings.payload_name = "FAKE"; 146 send_config_.encoder_settings.payload_name = "FAKE";
144 send_config_.encoder_settings.payload_type = kFakeSendPayloadType; 147 send_config_.encoder_settings.payload_type = kFakeSendPayloadType;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 BitrateEstimatorTest* test_; 261 BitrateEstimatorTest* test_;
259 bool is_sending_receiving_; 262 bool is_sending_receiving_;
260 VideoSendStream* send_stream_; 263 VideoSendStream* send_stream_;
261 AudioReceiveStream* audio_receive_stream_; 264 AudioReceiveStream* audio_receive_stream_;
262 VideoReceiveStream* video_receive_stream_; 265 VideoReceiveStream* video_receive_stream_;
263 rtc::scoped_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_; 266 rtc::scoped_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_;
264 test::FakeEncoder fake_encoder_; 267 test::FakeEncoder fake_encoder_;
265 test::FakeDecoder fake_decoder_; 268 test::FakeDecoder fake_decoder_;
266 }; 269 };
267 270
271 test::FakeVoiceEngine fake_voice_engine_;
268 TraceObserver receiver_trace_; 272 TraceObserver receiver_trace_;
269 test::DirectTransport send_transport_; 273 test::DirectTransport send_transport_;
270 test::DirectTransport receive_transport_; 274 test::DirectTransport receive_transport_;
271 rtc::scoped_ptr<Call> sender_call_; 275 rtc::scoped_ptr<Call> sender_call_;
272 rtc::scoped_ptr<Call> receiver_call_; 276 rtc::scoped_ptr<Call> receiver_call_;
273 VideoReceiveStream::Config receive_config_; 277 VideoReceiveStream::Config receive_config_;
274 std::vector<Stream*> streams_; 278 std::vector<Stream*> streams_;
275 }; 279 };
276 280
277 static const char* kAbsSendTimeLog = 281 static const char* kAbsSendTimeLog =
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId); 363 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId);
360 receiver_trace_.PushExpectedLogLine( 364 receiver_trace_.PushExpectedLogLine(
361 "WrappingBitrateEstimator: Switching to transmission time offset RBE."); 365 "WrappingBitrateEstimator: Switching to transmission time offset RBE.");
362 receiver_trace_.PushExpectedLogLine(kSingleStreamLog); 366 receiver_trace_.PushExpectedLogLine(kSingleStreamLog);
363 streams_.push_back(new Stream(this, false)); 367 streams_.push_back(new Stream(this, false));
364 streams_[0]->StopSending(); 368 streams_[0]->StopSending();
365 streams_[1]->StopSending(); 369 streams_[1]->StopSending();
366 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); 370 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait());
367 } 371 }
368 } // namespace webrtc 372 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/audio_receive_stream.h ('k') | webrtc/call/call.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698