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

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

Issue 1208083002: Remove MimdRateControl and factories for RemoteBitrateEstimor. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Updated thresholds for TestTimestampGrouping Created 5 years, 5 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
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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 265
266 TraceObserver receiver_trace_; 266 TraceObserver receiver_trace_;
267 test::DirectTransport send_transport_; 267 test::DirectTransport send_transport_;
268 test::DirectTransport receive_transport_; 268 test::DirectTransport receive_transport_;
269 rtc::scoped_ptr<Call> sender_call_; 269 rtc::scoped_ptr<Call> sender_call_;
270 rtc::scoped_ptr<Call> receiver_call_; 270 rtc::scoped_ptr<Call> receiver_call_;
271 VideoReceiveStream::Config receive_config_; 271 VideoReceiveStream::Config receive_config_;
272 std::vector<Stream*> streams_; 272 std::vector<Stream*> streams_;
273 }; 273 };
274 274
275 static const char* kAbsSendTimeLog =
276 "RemoteBitrateEstimatorAbsSendTime: Instantiating.";
277 static const char* kSingleStreamLog =
278 "RemoteBitrateEstimatorSingleStream: Instantiating.";
279
275 TEST_F(BitrateEstimatorTest, InstantiatesTOFPerDefaultForVideo) { 280 TEST_F(BitrateEstimatorTest, InstantiatesTOFPerDefaultForVideo) {
276 send_config_.rtp.extensions.push_back( 281 send_config_.rtp.extensions.push_back(
277 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId)); 282 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId));
278 receiver_trace_.PushExpectedLogLine( 283 receiver_trace_.PushExpectedLogLine(kSingleStreamLog);
279 "RemoteBitrateEstimatorFactory: Instantiating."); 284 receiver_trace_.PushExpectedLogLine(kSingleStreamLog);
280 receiver_trace_.PushExpectedLogLine(
281 "RemoteBitrateEstimatorFactory: Instantiating.");
282 streams_.push_back(new Stream(this, false)); 285 streams_.push_back(new Stream(this, false));
283 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); 286 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait());
284 } 287 }
285 288
286 TEST_F(BitrateEstimatorTest, ImmediatelySwitchToASTForAudio) { 289 TEST_F(BitrateEstimatorTest, ImmediatelySwitchToASTForAudio) {
287 send_config_.rtp.extensions.push_back( 290 send_config_.rtp.extensions.push_back(
288 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId)); 291 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId));
289 receiver_trace_.PushExpectedLogLine( 292 receiver_trace_.PushExpectedLogLine(kSingleStreamLog);
290 "RemoteBitrateEstimatorFactory: Instantiating."); 293 receiver_trace_.PushExpectedLogLine(kSingleStreamLog);
291 receiver_trace_.PushExpectedLogLine(
292 "RemoteBitrateEstimatorFactory: Instantiating.");
293 receiver_trace_.PushExpectedLogLine("Switching to absolute send time RBE."); 294 receiver_trace_.PushExpectedLogLine("Switching to absolute send time RBE.");
294 receiver_trace_.PushExpectedLogLine( 295 receiver_trace_.PushExpectedLogLine(kAbsSendTimeLog);
295 "AbsoluteSendTimeRemoteBitrateEstimatorFactory: Instantiating.");
296 streams_.push_back(new Stream(this, true)); 296 streams_.push_back(new Stream(this, true));
297 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); 297 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait());
298 } 298 }
299 299
300 TEST_F(BitrateEstimatorTest, ImmediatelySwitchToASTForVideo) { 300 TEST_F(BitrateEstimatorTest, ImmediatelySwitchToASTForVideo) {
301 send_config_.rtp.extensions.push_back( 301 send_config_.rtp.extensions.push_back(
302 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId)); 302 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId));
303 receiver_trace_.PushExpectedLogLine( 303 receiver_trace_.PushExpectedLogLine(kSingleStreamLog);
304 "RemoteBitrateEstimatorFactory: Instantiating."); 304 receiver_trace_.PushExpectedLogLine(kSingleStreamLog);
305 receiver_trace_.PushExpectedLogLine(
306 "RemoteBitrateEstimatorFactory: Instantiating.");
307 receiver_trace_.PushExpectedLogLine("Switching to absolute send time RBE."); 305 receiver_trace_.PushExpectedLogLine("Switching to absolute send time RBE.");
308 receiver_trace_.PushExpectedLogLine( 306 receiver_trace_.PushExpectedLogLine(kAbsSendTimeLog);
309 "AbsoluteSendTimeRemoteBitrateEstimatorFactory: Instantiating.");
310 streams_.push_back(new Stream(this, false)); 307 streams_.push_back(new Stream(this, false));
311 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); 308 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait());
312 } 309 }
313 310
314 TEST_F(BitrateEstimatorTest, SwitchesToASTForAudio) { 311 TEST_F(BitrateEstimatorTest, SwitchesToASTForAudio) {
315 receiver_trace_.PushExpectedLogLine( 312 receiver_trace_.PushExpectedLogLine(kSingleStreamLog);
316 "RemoteBitrateEstimatorFactory: Instantiating."); 313 receiver_trace_.PushExpectedLogLine(kSingleStreamLog);
317 receiver_trace_.PushExpectedLogLine(
318 "RemoteBitrateEstimatorFactory: Instantiating.");
319 streams_.push_back(new Stream(this, true)); 314 streams_.push_back(new Stream(this, true));
320 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); 315 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait());
321 316
322 send_config_.rtp.extensions.push_back( 317 send_config_.rtp.extensions.push_back(
323 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId)); 318 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId));
324 receiver_trace_.PushExpectedLogLine("Switching to absolute send time RBE."); 319 receiver_trace_.PushExpectedLogLine("Switching to absolute send time RBE.");
325 receiver_trace_.PushExpectedLogLine( 320 receiver_trace_.PushExpectedLogLine(kAbsSendTimeLog);
326 "AbsoluteSendTimeRemoteBitrateEstimatorFactory: Instantiating.");
327 streams_.push_back(new Stream(this, true)); 321 streams_.push_back(new Stream(this, true));
328 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); 322 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait());
329 } 323 }
330 324
331 TEST_F(BitrateEstimatorTest, SwitchesToASTForVideo) { 325 TEST_F(BitrateEstimatorTest, SwitchesToASTForVideo) {
332 send_config_.rtp.extensions.push_back( 326 send_config_.rtp.extensions.push_back(
333 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId)); 327 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId));
334 receiver_trace_.PushExpectedLogLine( 328 receiver_trace_.PushExpectedLogLine(kSingleStreamLog);
335 "RemoteBitrateEstimatorFactory: Instantiating."); 329 receiver_trace_.PushExpectedLogLine(kSingleStreamLog);
336 receiver_trace_.PushExpectedLogLine(
337 "RemoteBitrateEstimatorFactory: Instantiating.");
338 streams_.push_back(new Stream(this, false)); 330 streams_.push_back(new Stream(this, false));
339 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); 331 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait());
340 332
341 send_config_.rtp.extensions[0] = 333 send_config_.rtp.extensions[0] =
342 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId); 334 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId);
343 receiver_trace_.PushExpectedLogLine("Switching to absolute send time RBE."); 335 receiver_trace_.PushExpectedLogLine("Switching to absolute send time RBE.");
344 receiver_trace_.PushExpectedLogLine( 336 receiver_trace_.PushExpectedLogLine(kAbsSendTimeLog);
345 "AbsoluteSendTimeRemoteBitrateEstimatorFactory: Instantiating.");
346 streams_.push_back(new Stream(this, false)); 337 streams_.push_back(new Stream(this, false));
347 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); 338 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait());
348 } 339 }
349 340
350 TEST_F(BitrateEstimatorTest, SwitchesToASTThenBackToTOFForVideo) { 341 TEST_F(BitrateEstimatorTest, SwitchesToASTThenBackToTOFForVideo) {
351 send_config_.rtp.extensions.push_back( 342 send_config_.rtp.extensions.push_back(
352 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId)); 343 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId));
353 receiver_trace_.PushExpectedLogLine( 344 receiver_trace_.PushExpectedLogLine(kSingleStreamLog);
354 "RemoteBitrateEstimatorFactory: Instantiating."); 345 receiver_trace_.PushExpectedLogLine(kSingleStreamLog);
355 receiver_trace_.PushExpectedLogLine(
356 "RemoteBitrateEstimatorFactory: Instantiating.");
357 streams_.push_back(new Stream(this, false)); 346 streams_.push_back(new Stream(this, false));
358 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); 347 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait());
359 348
360 send_config_.rtp.extensions[0] = 349 send_config_.rtp.extensions[0] =
361 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId); 350 RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId);
362 receiver_trace_.PushExpectedLogLine("Switching to absolute send time RBE."); 351 receiver_trace_.PushExpectedLogLine("Switching to absolute send time RBE.");
363 receiver_trace_.PushExpectedLogLine( 352 receiver_trace_.PushExpectedLogLine(kAbsSendTimeLog);
364 "AbsoluteSendTimeRemoteBitrateEstimatorFactory: Instantiating.");
365 streams_.push_back(new Stream(this, false)); 353 streams_.push_back(new Stream(this, false));
366 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); 354 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait());
367 355
368 send_config_.rtp.extensions[0] = 356 send_config_.rtp.extensions[0] =
369 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId); 357 RtpExtension(RtpExtension::kTOffset, kTOFExtensionId);
370 receiver_trace_.PushExpectedLogLine( 358 receiver_trace_.PushExpectedLogLine(
371 "WrappingBitrateEstimator: Switching to transmission time offset RBE."); 359 "WrappingBitrateEstimator: Switching to transmission time offset RBE.");
372 receiver_trace_.PushExpectedLogLine( 360 receiver_trace_.PushExpectedLogLine(kSingleStreamLog);
373 "RemoteBitrateEstimatorFactory: Instantiating.");
374 streams_.push_back(new Stream(this, false)); 361 streams_.push_back(new Stream(this, false));
375 streams_[0]->StopSending(); 362 streams_[0]->StopSending();
376 streams_[1]->StopSending(); 363 streams_[1]->StopSending();
377 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); 364 EXPECT_EQ(kEventSignaled, receiver_trace_.Wait());
378 } 365 }
379 } // namespace webrtc 366 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698