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

Side by Side Diff: webrtc/media/engine/webrtcvoiceengine_unittest.cc

Issue 2780783004: Fix issue with conflicting behavior if setting a max BW with b=AS on both audio and video. (Closed)
Patch Set: Created 3 years, 8 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/media/engine/webrtcvoiceengine.cc ('k') | no next file » | 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) 2008 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2008 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 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 TEST_F(WebRtcVoiceEngineTestFake, 1497 TEST_F(WebRtcVoiceEngineTestFake,
1498 SetSendCodecsWithoutBitratesUsesCorrectDefaults) { 1498 SetSendCodecsWithoutBitratesUsesCorrectDefaults) {
1499 SetSendCodecsShouldWorkForBitrates("", 0, "", -1, "", -1); 1499 SetSendCodecsShouldWorkForBitrates("", 0, "", -1, "", -1);
1500 } 1500 }
1501 1501
1502 TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsCapsMinAndStartBitrate) { 1502 TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecsCapsMinAndStartBitrate) {
1503 SetSendCodecsShouldWorkForBitrates("-1", 0, "-100", -1, "", -1); 1503 SetSendCodecsShouldWorkForBitrates("-1", 0, "-100", -1, "", -1);
1504 } 1504 }
1505 1505
1506 TEST_F(WebRtcVoiceEngineTestFake, 1506 TEST_F(WebRtcVoiceEngineTestFake,
1507 SetMaxSendBandwidthShouldPreserveOtherBitrates) { 1507 SetMaxSendBandwidthForAudioDoesntAffectBwe) {
1508 SetSendCodecsShouldWorkForBitrates("100", 100000, "150", 150000, "200", 1508 SetSendCodecsShouldWorkForBitrates("100", 100000, "150", 150000, "200",
1509 200000); 1509 200000);
1510 send_parameters_.max_bandwidth_bps = 300000; 1510 send_parameters_.max_bandwidth_bps = 100000;
1511 SetSendParameters(send_parameters_); 1511 SetSendParameters(send_parameters_);
1512 EXPECT_EQ(100000, call_.GetConfig().bitrate_config.min_bitrate_bps) 1512 EXPECT_EQ(100000, call_.GetConfig().bitrate_config.min_bitrate_bps)
1513 << "Setting max bitrate should keep previous min bitrate."; 1513 << "Setting max bitrate should keep previous min bitrate.";
1514 EXPECT_EQ(-1, call_.GetConfig().bitrate_config.start_bitrate_bps) 1514 EXPECT_EQ(-1, call_.GetConfig().bitrate_config.start_bitrate_bps)
1515 << "Setting max bitrate should not reset start bitrate."; 1515 << "Setting max bitrate should not reset start bitrate.";
1516 EXPECT_EQ(300000, call_.GetConfig().bitrate_config.max_bitrate_bps); 1516 EXPECT_EQ(200000, call_.GetConfig().bitrate_config.max_bitrate_bps);
1517 } 1517 }
1518 1518
1519 // Test that we can enable NACK with opus as caller. 1519 // Test that we can enable NACK with opus as caller.
1520 TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecEnableNackAsCaller) { 1520 TEST_F(WebRtcVoiceEngineTestFake, SetSendCodecEnableNackAsCaller) {
1521 EXPECT_TRUE(SetupSendStream()); 1521 EXPECT_TRUE(SetupSendStream());
1522 cricket::AudioSendParameters parameters; 1522 cricket::AudioSendParameters parameters;
1523 parameters.codecs.push_back(kOpusCodec); 1523 parameters.codecs.push_back(kOpusCodec);
1524 parameters.codecs[0].AddFeedbackParam( 1524 parameters.codecs[0].AddFeedbackParam(
1525 cricket::FeedbackParam(cricket::kRtcpFbParamNack, 1525 cricket::FeedbackParam(cricket::kRtcpFbParamNack,
1526 cricket::kParamValueEmpty)); 1526 cricket::kParamValueEmpty));
(...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after
3730 // Without this cast, the comparison turned unsigned and, thus, failed for -1. 3730 // Without this cast, the comparison turned unsigned and, thus, failed for -1.
3731 const int num_specs = static_cast<int>(specs.size()); 3731 const int num_specs = static_cast<int>(specs.size());
3732 EXPECT_GE(find_codec({"cn", 8000, 1}), num_specs); 3732 EXPECT_GE(find_codec({"cn", 8000, 1}), num_specs);
3733 EXPECT_GE(find_codec({"cn", 16000, 1}), num_specs); 3733 EXPECT_GE(find_codec({"cn", 16000, 1}), num_specs);
3734 EXPECT_EQ(find_codec({"cn", 32000, 1}), -1); 3734 EXPECT_EQ(find_codec({"cn", 32000, 1}), -1);
3735 EXPECT_GE(find_codec({"telephone-event", 8000, 1}), num_specs); 3735 EXPECT_GE(find_codec({"telephone-event", 8000, 1}), num_specs);
3736 EXPECT_GE(find_codec({"telephone-event", 16000, 1}), num_specs); 3736 EXPECT_GE(find_codec({"telephone-event", 16000, 1}), num_specs);
3737 EXPECT_GE(find_codec({"telephone-event", 32000, 1}), num_specs); 3737 EXPECT_GE(find_codec({"telephone-event", 32000, 1}), num_specs);
3738 EXPECT_GE(find_codec({"telephone-event", 48000, 1}), num_specs); 3738 EXPECT_GE(find_codec({"telephone-event", 48000, 1}), num_specs);
3739 } 3739 }
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698