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

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

Issue 1917193008: Adding getParameters/setParameters APIs to RtpReceiver. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding nil check and removing unneeded methods. Created 4 years, 7 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 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 3370 matching lines...) Expand 10 before | Expand all | Expand 10 after
3381 } 3381 }
3382 3382
3383 TEST_F(WebRtcSessionTest, SetAudioMaxSendBitrate) { 3383 TEST_F(WebRtcSessionTest, SetAudioMaxSendBitrate) {
3384 Init(); 3384 Init();
3385 SendAudioVideoStream1(); 3385 SendAudioVideoStream1();
3386 CreateAndSetRemoteOfferAndLocalAnswer(); 3386 CreateAndSetRemoteOfferAndLocalAnswer();
3387 cricket::FakeVoiceMediaChannel* channel = media_engine_->GetVoiceChannel(0); 3387 cricket::FakeVoiceMediaChannel* channel = media_engine_->GetVoiceChannel(0);
3388 ASSERT_TRUE(channel != NULL); 3388 ASSERT_TRUE(channel != NULL);
3389 uint32_t send_ssrc = channel->send_streams()[0].first_ssrc(); 3389 uint32_t send_ssrc = channel->send_streams()[0].first_ssrc();
3390 EXPECT_EQ(-1, channel->max_bps()); 3390 EXPECT_EQ(-1, channel->max_bps());
3391 webrtc::RtpParameters params = session_->GetAudioRtpParameters(send_ssrc); 3391 webrtc::RtpParameters params = session_->GetAudioRtpSendParameters(send_ssrc);
3392 EXPECT_EQ(1, params.encodings.size()); 3392 EXPECT_EQ(1, params.encodings.size());
3393 EXPECT_EQ(-1, params.encodings[0].max_bitrate_bps); 3393 EXPECT_EQ(-1, params.encodings[0].max_bitrate_bps);
3394 params.encodings[0].max_bitrate_bps = 1000; 3394 params.encodings[0].max_bitrate_bps = 1000;
3395 EXPECT_TRUE(session_->SetAudioRtpParameters(send_ssrc, params)); 3395 EXPECT_TRUE(session_->SetAudioRtpSendParameters(send_ssrc, params));
3396 3396
3397 // Read back the parameters and verify they have been changed. 3397 // Read back the parameters and verify they have been changed.
3398 params = session_->GetAudioRtpParameters(send_ssrc); 3398 params = session_->GetAudioRtpSendParameters(send_ssrc);
3399 EXPECT_EQ(1, params.encodings.size()); 3399 EXPECT_EQ(1, params.encodings.size());
3400 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); 3400 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
3401 3401
3402 // Verify that the audio channel received the new parameters. 3402 // Verify that the audio channel received the new parameters.
3403 params = channel->GetRtpParameters(send_ssrc); 3403 params = channel->GetRtpSendParameters(send_ssrc);
3404 EXPECT_EQ(1, params.encodings.size()); 3404 EXPECT_EQ(1, params.encodings.size());
3405 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); 3405 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
3406 3406
3407 // Verify that the global bitrate limit has not been changed. 3407 // Verify that the global bitrate limit has not been changed.
3408 EXPECT_EQ(-1, channel->max_bps()); 3408 EXPECT_EQ(-1, channel->max_bps());
3409 } 3409 }
3410 3410
3411 TEST_F(WebRtcSessionTest, SetAudioSend) { 3411 TEST_F(WebRtcSessionTest, SetAudioSend) {
3412 Init(); 3412 Init();
3413 SendAudioVideoStream1(); 3413 SendAudioVideoStream1();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
3475 } 3475 }
3476 3476
3477 TEST_F(WebRtcSessionTest, SetVideoMaxSendBitrate) { 3477 TEST_F(WebRtcSessionTest, SetVideoMaxSendBitrate) {
3478 Init(); 3478 Init();
3479 SendAudioVideoStream1(); 3479 SendAudioVideoStream1();
3480 CreateAndSetRemoteOfferAndLocalAnswer(); 3480 CreateAndSetRemoteOfferAndLocalAnswer();
3481 cricket::FakeVideoMediaChannel* channel = media_engine_->GetVideoChannel(0); 3481 cricket::FakeVideoMediaChannel* channel = media_engine_->GetVideoChannel(0);
3482 ASSERT_TRUE(channel != NULL); 3482 ASSERT_TRUE(channel != NULL);
3483 uint32_t send_ssrc = channel->send_streams()[0].first_ssrc(); 3483 uint32_t send_ssrc = channel->send_streams()[0].first_ssrc();
3484 EXPECT_EQ(-1, channel->max_bps()); 3484 EXPECT_EQ(-1, channel->max_bps());
3485 webrtc::RtpParameters params = session_->GetVideoRtpParameters(send_ssrc); 3485 webrtc::RtpParameters params = session_->GetVideoRtpSendParameters(send_ssrc);
3486 EXPECT_EQ(1, params.encodings.size()); 3486 EXPECT_EQ(1, params.encodings.size());
3487 EXPECT_EQ(-1, params.encodings[0].max_bitrate_bps); 3487 EXPECT_EQ(-1, params.encodings[0].max_bitrate_bps);
3488 params.encodings[0].max_bitrate_bps = 1000; 3488 params.encodings[0].max_bitrate_bps = 1000;
3489 EXPECT_TRUE(session_->SetVideoRtpParameters(send_ssrc, params)); 3489 EXPECT_TRUE(session_->SetVideoRtpSendParameters(send_ssrc, params));
3490 3490
3491 // Read back the parameters and verify they have been changed. 3491 // Read back the parameters and verify they have been changed.
3492 params = session_->GetVideoRtpParameters(send_ssrc); 3492 params = session_->GetVideoRtpSendParameters(send_ssrc);
3493 EXPECT_EQ(1, params.encodings.size()); 3493 EXPECT_EQ(1, params.encodings.size());
3494 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); 3494 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
3495 3495
3496 // Verify that the video channel received the new parameters. 3496 // Verify that the video channel received the new parameters.
3497 params = channel->GetRtpParameters(send_ssrc); 3497 params = channel->GetRtpSendParameters(send_ssrc);
3498 EXPECT_EQ(1, params.encodings.size()); 3498 EXPECT_EQ(1, params.encodings.size());
3499 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); 3499 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
3500 3500
3501 // Verify that the global bitrate limit has not been changed. 3501 // Verify that the global bitrate limit has not been changed.
3502 EXPECT_EQ(-1, channel->max_bps()); 3502 EXPECT_EQ(-1, channel->max_bps());
3503 } 3503 }
3504 3504
3505 TEST_F(WebRtcSessionTest, SetVideoSend) { 3505 TEST_F(WebRtcSessionTest, SetVideoSend) {
3506 Init(); 3506 Init();
3507 SendAudioVideoStream1(); 3507 SendAudioVideoStream1();
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
4396 } 4396 }
4397 4397
4398 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test 4398 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test
4399 // currently fails because upon disconnection and reconnection OnIceComplete is 4399 // currently fails because upon disconnection and reconnection OnIceComplete is
4400 // called more than once without returning to IceGatheringGathering. 4400 // called more than once without returning to IceGatheringGathering.
4401 4401
4402 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, 4402 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests,
4403 WebRtcSessionTest, 4403 WebRtcSessionTest,
4404 testing::Values(ALREADY_GENERATED, 4404 testing::Values(ALREADY_GENERATED,
4405 DTLS_IDENTITY_STORE)); 4405 DTLS_IDENTITY_STORE));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698