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

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

Issue 1845673002: Removing `preference` field from `cricket::Codec`. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 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 2399 matching lines...) Expand 10 before | Expand all | Expand 10 after
2410 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsAcceptAllValidPayloadTypes) { 2410 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsAcceptAllValidPayloadTypes) {
2411 cricket::VideoSendParameters parameters; 2411 cricket::VideoSendParameters parameters;
2412 parameters.codecs.push_back(kVp8Codec); 2412 parameters.codecs.push_back(kVp8Codec);
2413 for (int payload_type = 0; payload_type <= 127; ++payload_type) { 2413 for (int payload_type = 0; payload_type <= 127; ++payload_type) {
2414 parameters.codecs[0].id = payload_type; 2414 parameters.codecs[0].id = payload_type;
2415 EXPECT_TRUE(channel_->SetSendParameters(parameters)) 2415 EXPECT_TRUE(channel_->SetSendParameters(parameters))
2416 << "Payload type '" << payload_type << "' rejected."; 2416 << "Payload type '" << payload_type << "' rejected.";
2417 } 2417 }
2418 } 2418 }
2419 2419
2420 // Test that setting the same codecs but with a different preference for the
2421 // first codec doesn't result in the stream being recreated.
2422 // This may happen when a subsequent negotiation includes few codecs, as a
2423 // result of one of the codecs being rejected.
2424 TEST_F(WebRtcVideoChannel2Test,
2425 SetSendCodecsDifferentPreferenceDoesntRecreateStream) {
2426 cricket::VideoSendParameters parameters1;
2427 parameters1.codecs.push_back(kVp8Codec);
2428 parameters1.codecs.push_back(kVp9Codec);
2429 parameters1.codecs[0].preference += 1;
2430 EXPECT_TRUE(channel_->SetSendParameters(parameters1));
2431
2432 AddSendStream();
2433 EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams());
2434
2435 cricket::VideoSendParameters parameters2;
2436 parameters2.codecs.push_back(kVp8Codec);
2437 EXPECT_TRUE(channel_->SetSendParameters(parameters2));
2438 EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams());
2439 }
2440
2420 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithOnlyVp8) { 2441 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithOnlyVp8) {
2421 cricket::VideoRecvParameters parameters; 2442 cricket::VideoRecvParameters parameters;
2422 parameters.codecs.push_back(kVp8Codec); 2443 parameters.codecs.push_back(kVp8Codec);
2423 EXPECT_TRUE(channel_->SetRecvParameters(parameters)); 2444 EXPECT_TRUE(channel_->SetRecvParameters(parameters));
2424 } 2445 }
2425 2446
2426 // Test that we set our inbound RTX codecs properly. 2447 // Test that we set our inbound RTX codecs properly.
2427 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithRtx) { 2448 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithRtx) {
2428 cricket::VideoRecvParameters parameters; 2449 cricket::VideoRecvParameters parameters;
2429 parameters.codecs.push_back(kVp8Codec); 2450 parameters.codecs.push_back(kVp8Codec);
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
3490 } 3511 }
3491 3512
3492 // Test that we normalize send codec format size in simulcast. 3513 // Test that we normalize send codec format size in simulcast.
3493 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 3514 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
3494 cricket::VideoCodec codec(kVp8Codec270p); 3515 cricket::VideoCodec codec(kVp8Codec270p);
3495 codec.width += 1; 3516 codec.width += 1;
3496 codec.height += 1; 3517 codec.height += 1;
3497 VerifySimulcastSettings(codec, 2, 2); 3518 VerifySimulcastSettings(codec, 2, 2);
3498 } 3519 }
3499 } // namespace cricket 3520 } // namespace cricket
OLDNEW
« webrtc/media/engine/webrtcvideoengine2.cc ('K') | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698