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

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

Issue 1704983002: Simplify CongestionController. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Comments addressed. Created 4 years, 10 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/audio_send_stream_unittest.cc ('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>
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 static const char* kAbsSendTimeLog = 261 static const char* kAbsSendTimeLog =
262 "RemoteBitrateEstimatorAbsSendTime: Instantiating."; 262 "RemoteBitrateEstimatorAbsSendTime: Instantiating.";
263 static const char* kSingleStreamLog = 263 static const char* kSingleStreamLog =
264 "RemoteBitrateEstimatorSingleStream: Instantiating."; 264 "RemoteBitrateEstimatorSingleStream: Instantiating.";
265 265
266 TEST_F(BitrateEstimatorTest, InstantiatesTOFPerDefaultForVideo) { 266 TEST_F(BitrateEstimatorTest, InstantiatesTOFPerDefaultForVideo) {
267 video_send_config_.rtp.extensions.push_back( 267 video_send_config_.rtp.extensions.push_back(
268 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId)); 268 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId));
269 receiver_log_.PushExpectedLogLine(kSingleStreamLog); 269 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
270 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
270 receiver_log_.PushExpectedLogLine(kSingleStreamLog); 271 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
271 streams_.push_back(new Stream(this, false)); 272 streams_.push_back(new Stream(this, false));
272 EXPECT_TRUE(receiver_log_.Wait()); 273 EXPECT_TRUE(receiver_log_.Wait());
273 } 274 }
274 275
275 TEST_F(BitrateEstimatorTest, ImmediatelySwitchToASTForVideo) { 276 TEST_F(BitrateEstimatorTest, ImmediatelySwitchToASTForVideo) {
276 video_send_config_.rtp.extensions.push_back( 277 video_send_config_.rtp.extensions.push_back(
277 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId)); 278 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId));
278 receiver_log_.PushExpectedLogLine(kSingleStreamLog); 279 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
280 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
279 receiver_log_.PushExpectedLogLine(kSingleStreamLog); 281 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
280 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog); 282 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
281 receiver_log_.PushExpectedLogLine("Switching to absolute send time RBE."); 283 receiver_log_.PushExpectedLogLine("Switching to absolute send time RBE.");
282 streams_.push_back(new Stream(this, false)); 284 streams_.push_back(new Stream(this, false));
283 EXPECT_TRUE(receiver_log_.Wait()); 285 EXPECT_TRUE(receiver_log_.Wait());
284 } 286 }
285 287
286 TEST_F(BitrateEstimatorTest, SwitchesToASTForVideo) { 288 TEST_F(BitrateEstimatorTest, SwitchesToASTForVideo) {
287 video_send_config_.rtp.extensions.push_back( 289 video_send_config_.rtp.extensions.push_back(
288 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId)); 290 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId));
289 receiver_log_.PushExpectedLogLine(kSingleStreamLog); 291 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
292 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
290 receiver_log_.PushExpectedLogLine(kSingleStreamLog); 293 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
291 streams_.push_back(new Stream(this, false)); 294 streams_.push_back(new Stream(this, false));
292 EXPECT_TRUE(receiver_log_.Wait()); 295 EXPECT_TRUE(receiver_log_.Wait());
293 296
294 video_send_config_.rtp.extensions[0] = 297 video_send_config_.rtp.extensions[0] =
295 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId); 298 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId);
296 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog); 299 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
297 receiver_log_.PushExpectedLogLine("Switching to absolute send time RBE."); 300 receiver_log_.PushExpectedLogLine("Switching to absolute send time RBE.");
298 streams_.push_back(new Stream(this, false)); 301 streams_.push_back(new Stream(this, false));
299 EXPECT_TRUE(receiver_log_.Wait()); 302 EXPECT_TRUE(receiver_log_.Wait());
300 } 303 }
301 304
302 TEST_F(BitrateEstimatorTest, SwitchesToASTThenBackToTOFForVideo) { 305 TEST_F(BitrateEstimatorTest, SwitchesToASTThenBackToTOFForVideo) {
303 video_send_config_.rtp.extensions.push_back( 306 video_send_config_.rtp.extensions.push_back(
304 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId)); 307 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId));
305 receiver_log_.PushExpectedLogLine(kSingleStreamLog); 308 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
309 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
306 receiver_log_.PushExpectedLogLine(kSingleStreamLog); 310 receiver_log_.PushExpectedLogLine(kSingleStreamLog);
307 streams_.push_back(new Stream(this, false)); 311 streams_.push_back(new Stream(this, false));
308 EXPECT_TRUE(receiver_log_.Wait()); 312 EXPECT_TRUE(receiver_log_.Wait());
309 313
310 video_send_config_.rtp.extensions[0] = 314 video_send_config_.rtp.extensions[0] =
311 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId); 315 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId);
312 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog); 316 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
313 receiver_log_.PushExpectedLogLine("Switching to absolute send time RBE."); 317 receiver_log_.PushExpectedLogLine("Switching to absolute send time RBE.");
314 streams_.push_back(new Stream(this, false)); 318 streams_.push_back(new Stream(this, false));
315 EXPECT_TRUE(receiver_log_.Wait()); 319 EXPECT_TRUE(receiver_log_.Wait());
316 320
317 video_send_config_.rtp.extensions[0] = 321 video_send_config_.rtp.extensions[0] =
318 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId); 322 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId);
319 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog); 323 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
320 receiver_log_.PushExpectedLogLine( 324 receiver_log_.PushExpectedLogLine(
321 "WrappingBitrateEstimator: Switching to transmission time offset RBE."); 325 "WrappingBitrateEstimator: Switching to transmission time offset RBE.");
322 streams_.push_back(new Stream(this, false)); 326 streams_.push_back(new Stream(this, false));
323 streams_[0]->StopSending(); 327 streams_[0]->StopSending();
324 streams_[1]->StopSending(); 328 streams_[1]->StopSending();
325 EXPECT_TRUE(receiver_log_.Wait()); 329 EXPECT_TRUE(receiver_log_.Wait());
326 } 330 }
327 } // namespace webrtc 331 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/audio/audio_send_stream_unittest.cc ('k') | webrtc/call/call.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698