| OLD | NEW |
| 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 3340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3351 } | 3351 } |
| 3352 | 3352 |
| 3353 TEST_F(WebRtcSessionTest, SetAudioMaxSendBitrate) { | 3353 TEST_F(WebRtcSessionTest, SetAudioMaxSendBitrate) { |
| 3354 Init(); | 3354 Init(); |
| 3355 SendAudioVideoStream1(); | 3355 SendAudioVideoStream1(); |
| 3356 CreateAndSetRemoteOfferAndLocalAnswer(); | 3356 CreateAndSetRemoteOfferAndLocalAnswer(); |
| 3357 cricket::FakeVoiceMediaChannel* channel = media_engine_->GetVoiceChannel(0); | 3357 cricket::FakeVoiceMediaChannel* channel = media_engine_->GetVoiceChannel(0); |
| 3358 ASSERT_TRUE(channel != NULL); | 3358 ASSERT_TRUE(channel != NULL); |
| 3359 uint32_t send_ssrc = channel->send_streams()[0].first_ssrc(); | 3359 uint32_t send_ssrc = channel->send_streams()[0].first_ssrc(); |
| 3360 EXPECT_EQ(-1, channel->max_bps()); | 3360 EXPECT_EQ(-1, channel->max_bps()); |
| 3361 webrtc::RtpParameters params = session_->GetAudioRtpParameters(send_ssrc); | 3361 webrtc::RtpParameters params = session_->GetAudioRtpSendParameters(send_ssrc); |
| 3362 EXPECT_EQ(1, params.encodings.size()); | 3362 EXPECT_EQ(1, params.encodings.size()); |
| 3363 EXPECT_EQ(-1, params.encodings[0].max_bitrate_bps); | 3363 EXPECT_EQ(-1, params.encodings[0].max_bitrate_bps); |
| 3364 params.encodings[0].max_bitrate_bps = 1000; | 3364 params.encodings[0].max_bitrate_bps = 1000; |
| 3365 EXPECT_TRUE(session_->SetAudioRtpParameters(send_ssrc, params)); | 3365 EXPECT_TRUE(session_->SetAudioRtpSendParameters(send_ssrc, params)); |
| 3366 | 3366 |
| 3367 // Read back the parameters and verify they have been changed. | 3367 // Read back the parameters and verify they have been changed. |
| 3368 params = session_->GetAudioRtpParameters(send_ssrc); | 3368 params = session_->GetAudioRtpSendParameters(send_ssrc); |
| 3369 EXPECT_EQ(1, params.encodings.size()); | 3369 EXPECT_EQ(1, params.encodings.size()); |
| 3370 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); | 3370 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); |
| 3371 | 3371 |
| 3372 // Verify that the audio channel received the new parameters. | 3372 // Verify that the audio channel received the new parameters. |
| 3373 params = channel->GetRtpParameters(send_ssrc); | 3373 params = channel->GetRtpSendParameters(send_ssrc); |
| 3374 EXPECT_EQ(1, params.encodings.size()); | 3374 EXPECT_EQ(1, params.encodings.size()); |
| 3375 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); | 3375 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); |
| 3376 | 3376 |
| 3377 // Verify that the global bitrate limit has not been changed. | 3377 // Verify that the global bitrate limit has not been changed. |
| 3378 EXPECT_EQ(-1, channel->max_bps()); | 3378 EXPECT_EQ(-1, channel->max_bps()); |
| 3379 } | 3379 } |
| 3380 | 3380 |
| 3381 TEST_F(WebRtcSessionTest, SetAudioSend) { | 3381 TEST_F(WebRtcSessionTest, SetAudioSend) { |
| 3382 Init(); | 3382 Init(); |
| 3383 SendAudioVideoStream1(); | 3383 SendAudioVideoStream1(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3445 } | 3445 } |
| 3446 | 3446 |
| 3447 TEST_F(WebRtcSessionTest, SetVideoMaxSendBitrate) { | 3447 TEST_F(WebRtcSessionTest, SetVideoMaxSendBitrate) { |
| 3448 Init(); | 3448 Init(); |
| 3449 SendAudioVideoStream1(); | 3449 SendAudioVideoStream1(); |
| 3450 CreateAndSetRemoteOfferAndLocalAnswer(); | 3450 CreateAndSetRemoteOfferAndLocalAnswer(); |
| 3451 cricket::FakeVideoMediaChannel* channel = media_engine_->GetVideoChannel(0); | 3451 cricket::FakeVideoMediaChannel* channel = media_engine_->GetVideoChannel(0); |
| 3452 ASSERT_TRUE(channel != NULL); | 3452 ASSERT_TRUE(channel != NULL); |
| 3453 uint32_t send_ssrc = channel->send_streams()[0].first_ssrc(); | 3453 uint32_t send_ssrc = channel->send_streams()[0].first_ssrc(); |
| 3454 EXPECT_EQ(-1, channel->max_bps()); | 3454 EXPECT_EQ(-1, channel->max_bps()); |
| 3455 webrtc::RtpParameters params = session_->GetVideoRtpParameters(send_ssrc); | 3455 webrtc::RtpParameters params = session_->GetVideoRtpSendParameters(send_ssrc); |
| 3456 EXPECT_EQ(1, params.encodings.size()); | 3456 EXPECT_EQ(1, params.encodings.size()); |
| 3457 EXPECT_EQ(-1, params.encodings[0].max_bitrate_bps); | 3457 EXPECT_EQ(-1, params.encodings[0].max_bitrate_bps); |
| 3458 params.encodings[0].max_bitrate_bps = 1000; | 3458 params.encodings[0].max_bitrate_bps = 1000; |
| 3459 EXPECT_TRUE(session_->SetVideoRtpParameters(send_ssrc, params)); | 3459 EXPECT_TRUE(session_->SetVideoRtpSendParameters(send_ssrc, params)); |
| 3460 | 3460 |
| 3461 // Read back the parameters and verify they have been changed. | 3461 // Read back the parameters and verify they have been changed. |
| 3462 params = session_->GetVideoRtpParameters(send_ssrc); | 3462 params = session_->GetVideoRtpSendParameters(send_ssrc); |
| 3463 EXPECT_EQ(1, params.encodings.size()); | 3463 EXPECT_EQ(1, params.encodings.size()); |
| 3464 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); | 3464 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); |
| 3465 | 3465 |
| 3466 // Verify that the video channel received the new parameters. | 3466 // Verify that the video channel received the new parameters. |
| 3467 params = channel->GetRtpParameters(send_ssrc); | 3467 params = channel->GetRtpSendParameters(send_ssrc); |
| 3468 EXPECT_EQ(1, params.encodings.size()); | 3468 EXPECT_EQ(1, params.encodings.size()); |
| 3469 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); | 3469 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); |
| 3470 | 3470 |
| 3471 // Verify that the global bitrate limit has not been changed. | 3471 // Verify that the global bitrate limit has not been changed. |
| 3472 EXPECT_EQ(-1, channel->max_bps()); | 3472 EXPECT_EQ(-1, channel->max_bps()); |
| 3473 } | 3473 } |
| 3474 | 3474 |
| 3475 TEST_F(WebRtcSessionTest, SetVideoSend) { | 3475 TEST_F(WebRtcSessionTest, SetVideoSend) { |
| 3476 Init(); | 3476 Init(); |
| 3477 SendAudioVideoStream1(); | 3477 SendAudioVideoStream1(); |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4358 } | 4358 } |
| 4359 | 4359 |
| 4360 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 4360 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
| 4361 // currently fails because upon disconnection and reconnection OnIceComplete is | 4361 // currently fails because upon disconnection and reconnection OnIceComplete is |
| 4362 // called more than once without returning to IceGatheringGathering. | 4362 // called more than once without returning to IceGatheringGathering. |
| 4363 | 4363 |
| 4364 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, | 4364 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, |
| 4365 WebRtcSessionTest, | 4365 WebRtcSessionTest, |
| 4366 testing::Values(ALREADY_GENERATED, | 4366 testing::Values(ALREADY_GENERATED, |
| 4367 DTLS_IDENTITY_STORE)); | 4367 DTLS_IDENTITY_STORE)); |
| OLD | NEW |