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

Side by Side Diff: webrtc/api/peerconnectioninterface_unittest.cc

Issue 1745003002: Move suspend_below_min_bitrate from VideoOptions to MediaConfig. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 4 years, 9 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/api/peerconnection.cc ('k') | webrtc/api/webrtcsession.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 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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 10
(...skipping 2365 matching lines...) Expand 10 before | Expand all | Expand 10 after
2376 // This test verifies the default behaviour with no constraints and a 2376 // This test verifies the default behaviour with no constraints and a
2377 // default RTCConfiguration. 2377 // default RTCConfiguration.
2378 TEST_F(PeerConnectionMediaConfigTest, TestDefaults) { 2378 TEST_F(PeerConnectionMediaConfigTest, TestDefaults) {
2379 PeerConnectionInterface::RTCConfiguration config; 2379 PeerConnectionInterface::RTCConfiguration config;
2380 FakeConstraints constraints; 2380 FakeConstraints constraints;
2381 2381
2382 const cricket::MediaConfig& media_config = 2382 const cricket::MediaConfig& media_config =
2383 TestCreatePeerConnection(config, &constraints); 2383 TestCreatePeerConnection(config, &constraints);
2384 2384
2385 EXPECT_FALSE(media_config.enable_dscp); 2385 EXPECT_FALSE(media_config.enable_dscp);
2386 EXPECT_TRUE(media_config.enable_cpu_overuse_detection); 2386 EXPECT_TRUE(media_config.video.enable_cpu_overuse_detection);
2387 EXPECT_FALSE(media_config.disable_prerenderer_smoothing); 2387 EXPECT_FALSE(media_config.video.disable_prerenderer_smoothing);
2388 EXPECT_FALSE(media_config.video.suspend_below_min_bitrate);
2388 } 2389 }
2389 2390
2390 // This test verifies the DSCP constraint is recognized and passed to 2391 // This test verifies the DSCP constraint is recognized and passed to
2391 // the CreateMediaController call. 2392 // the CreateMediaController call.
2392 TEST_F(PeerConnectionMediaConfigTest, TestDscpConstraintTrue) { 2393 TEST_F(PeerConnectionMediaConfigTest, TestDscpConstraintTrue) {
2393 PeerConnectionInterface::RTCConfiguration config; 2394 PeerConnectionInterface::RTCConfiguration config;
2394 FakeConstraints constraints; 2395 FakeConstraints constraints;
2395 2396
2396 constraints.AddOptional(webrtc::MediaConstraintsInterface::kEnableDscp, true); 2397 constraints.AddOptional(webrtc::MediaConstraintsInterface::kEnableDscp, true);
2397 const cricket::MediaConfig& media_config = 2398 const cricket::MediaConfig& media_config =
2398 TestCreatePeerConnection(config, &constraints); 2399 TestCreatePeerConnection(config, &constraints);
2399 2400
2400 EXPECT_TRUE(media_config.enable_dscp); 2401 EXPECT_TRUE(media_config.enable_dscp);
2401 } 2402 }
2402 2403
2403 // This test verifies the cpu overuse detection constraint is 2404 // This test verifies the cpu overuse detection constraint is
2404 // recognized and passed to the CreateMediaController call. 2405 // recognized and passed to the CreateMediaController call.
2405 TEST_F(PeerConnectionMediaConfigTest, TestCpuOveruseConstraintFalse) { 2406 TEST_F(PeerConnectionMediaConfigTest, TestCpuOveruseConstraintFalse) {
2406 PeerConnectionInterface::RTCConfiguration config; 2407 PeerConnectionInterface::RTCConfiguration config;
2407 FakeConstraints constraints; 2408 FakeConstraints constraints;
2408 2409
2409 constraints.AddOptional( 2410 constraints.AddOptional(
2410 webrtc::MediaConstraintsInterface::kCpuOveruseDetection, false); 2411 webrtc::MediaConstraintsInterface::kCpuOveruseDetection, false);
2411 const cricket::MediaConfig media_config = 2412 const cricket::MediaConfig media_config =
2412 TestCreatePeerConnection(config, &constraints); 2413 TestCreatePeerConnection(config, &constraints);
2413 2414
2414 EXPECT_FALSE(media_config.enable_cpu_overuse_detection); 2415 EXPECT_FALSE(media_config.video.enable_cpu_overuse_detection);
2415 } 2416 }
2416 2417
2417 // This test verifies that the disable_prerenderer_smoothing flag is 2418 // This test verifies that the disable_prerenderer_smoothing flag is
2418 // propagated from RTCConfiguration to the CreateMediaController call. 2419 // propagated from RTCConfiguration to the CreateMediaController call.
2419 TEST_F(PeerConnectionMediaConfigTest, TestDisablePrerendererSmoothingTrue) { 2420 TEST_F(PeerConnectionMediaConfigTest, TestDisablePrerendererSmoothingTrue) {
2420 PeerConnectionInterface::RTCConfiguration config; 2421 PeerConnectionInterface::RTCConfiguration config;
2421 FakeConstraints constraints; 2422 FakeConstraints constraints;
2422 2423
2423 config.disable_prerenderer_smoothing = true; 2424 config.disable_prerenderer_smoothing = true;
2424 const cricket::MediaConfig& media_config = 2425 const cricket::MediaConfig& media_config =
2425 TestCreatePeerConnection(config, &constraints); 2426 TestCreatePeerConnection(config, &constraints);
2426 2427
2427 EXPECT_TRUE(media_config.disable_prerenderer_smoothing); 2428 EXPECT_TRUE(media_config.video.disable_prerenderer_smoothing);
2429 }
2430
2431 // This test verifies the suspend below min bitrate constraint is
2432 // recognized and passed to the CreateMediaController call.
2433 TEST_F(PeerConnectionMediaConfigTest,
2434 TestSuspendBelowMinBitrateConstraintTrue) {
2435 PeerConnectionInterface::RTCConfiguration config;
2436 FakeConstraints constraints;
2437
2438 constraints.AddOptional(
2439 webrtc::MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate,
2440 true);
2441 const cricket::MediaConfig media_config =
2442 TestCreatePeerConnection(config, &constraints);
2443
2444 EXPECT_TRUE(media_config.video.suspend_below_min_bitrate);
2428 } 2445 }
2429 2446
2430 // The following tests verify that session options are created correctly. 2447 // The following tests verify that session options are created correctly.
2431 // TODO(deadbeef): Convert these tests to be more end-to-end. Instead of 2448 // TODO(deadbeef): Convert these tests to be more end-to-end. Instead of
2432 // "verify options are converted correctly", should be "pass options into 2449 // "verify options are converted correctly", should be "pass options into
2433 // CreateOffer and verify the correct offer is produced." 2450 // CreateOffer and verify the correct offer is produced."
2434 2451
2435 TEST(CreateSessionOptionsTest, GetOptionsForOfferWithInvalidAudioOption) { 2452 TEST(CreateSessionOptionsTest, GetOptionsForOfferWithInvalidAudioOption) {
2436 RTCOfferAnswerOptions rtc_options; 2453 RTCOfferAnswerOptions rtc_options;
2437 rtc_options.offer_to_receive_audio = RTCOfferAnswerOptions::kUndefined - 1; 2454 rtc_options.offer_to_receive_audio = RTCOfferAnswerOptions::kUndefined - 1;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
2589 FakeConstraints updated_answer_c; 2606 FakeConstraints updated_answer_c;
2590 answer_c.SetMandatoryReceiveAudio(false); 2607 answer_c.SetMandatoryReceiveAudio(false);
2591 answer_c.SetMandatoryReceiveVideo(false); 2608 answer_c.SetMandatoryReceiveVideo(false);
2592 2609
2593 cricket::MediaSessionOptions updated_answer_options; 2610 cricket::MediaSessionOptions updated_answer_options;
2594 EXPECT_TRUE( 2611 EXPECT_TRUE(
2595 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); 2612 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options));
2596 EXPECT_TRUE(updated_answer_options.has_audio()); 2613 EXPECT_TRUE(updated_answer_options.has_audio());
2597 EXPECT_TRUE(updated_answer_options.has_video()); 2614 EXPECT_TRUE(updated_answer_options.has_video());
2598 } 2615 }
OLDNEW
« no previous file with comments | « webrtc/api/peerconnection.cc ('k') | webrtc/api/webrtcsession.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698