| 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 3459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3470 EXPECT_TRUE(channel->sinks().begin()->second == NULL); | 3470 EXPECT_TRUE(channel->sinks().begin()->second == NULL); |
| 3471 } | 3471 } |
| 3472 | 3472 |
| 3473 TEST_F(WebRtcSessionTest, SetVideoMaxSendBitrate) { | 3473 TEST_F(WebRtcSessionTest, SetVideoMaxSendBitrate) { |
| 3474 Init(); | 3474 Init(); |
| 3475 SendAudioVideoStream1(); | 3475 SendAudioVideoStream1(); |
| 3476 CreateAndSetRemoteOfferAndLocalAnswer(); | 3476 CreateAndSetRemoteOfferAndLocalAnswer(); |
| 3477 cricket::FakeVideoMediaChannel* channel = media_engine_->GetVideoChannel(0); | 3477 cricket::FakeVideoMediaChannel* channel = media_engine_->GetVideoChannel(0); |
| 3478 ASSERT_TRUE(channel != NULL); | 3478 ASSERT_TRUE(channel != NULL); |
| 3479 uint32_t send_ssrc = channel->send_streams()[0].first_ssrc(); | 3479 uint32_t send_ssrc = channel->send_streams()[0].first_ssrc(); |
| 3480 EXPECT_EQ(-1, channel->max_bps()); | 3480 EXPECT_EQ(rtc::Optional<int>(), channel->max_bps()); |
| 3481 webrtc::RtpParameters params = session_->GetVideoRtpParameters(send_ssrc); | 3481 webrtc::RtpParameters params = session_->GetVideoRtpParameters(send_ssrc); |
| 3482 EXPECT_EQ(1, params.encodings.size()); | 3482 EXPECT_EQ(1, params.encodings.size()); |
| 3483 EXPECT_EQ(-1, params.encodings[0].max_bitrate_bps); | 3483 EXPECT_EQ(rtc::Optional<int>(), params.encodings[0].max_bitrate_bps); |
| 3484 params.encodings[0].max_bitrate_bps = 1000; | 3484 params.encodings[0].max_bitrate_bps = rtc::Optional<int>(1000); |
| 3485 EXPECT_TRUE(session_->SetVideoRtpParameters(send_ssrc, params)); | 3485 EXPECT_TRUE(session_->SetVideoRtpParameters(send_ssrc, params)); |
| 3486 | 3486 |
| 3487 // Read back the parameters and verify they have been changed. | 3487 // Read back the parameters and verify they have been changed. |
| 3488 params = session_->GetVideoRtpParameters(send_ssrc); | 3488 params = session_->GetVideoRtpParameters(send_ssrc); |
| 3489 EXPECT_EQ(1, params.encodings.size()); | 3489 EXPECT_EQ(1, params.encodings.size()); |
| 3490 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); | 3490 EXPECT_EQ(rtc::Optional<int>(1000), params.encodings[0].max_bitrate_bps); |
| 3491 | 3491 |
| 3492 // Verify that the video channel received the new parameters. | 3492 // Verify that the video channel received the new parameters. |
| 3493 params = channel->GetRtpParameters(send_ssrc); | 3493 params = channel->GetRtpParameters(send_ssrc); |
| 3494 EXPECT_EQ(1, params.encodings.size()); | 3494 EXPECT_EQ(1, params.encodings.size()); |
| 3495 EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps); | 3495 EXPECT_EQ(rtc::Optional<int>(1000), params.encodings[0].max_bitrate_bps); |
| 3496 | 3496 |
| 3497 // Verify that the global bitrate limit has not been changed. | 3497 // Verify that the global bitrate limit has not been changed. |
| 3498 EXPECT_EQ(-1, channel->max_bps()); | 3498 EXPECT_EQ(rtc::Optional<int>(), channel->max_bps()); |
| 3499 } | 3499 } |
| 3500 | 3500 |
| 3501 TEST_F(WebRtcSessionTest, SetVideoSend) { | 3501 TEST_F(WebRtcSessionTest, SetVideoSend) { |
| 3502 Init(); | 3502 Init(); |
| 3503 SendAudioVideoStream1(); | 3503 SendAudioVideoStream1(); |
| 3504 CreateAndSetRemoteOfferAndLocalAnswer(); | 3504 CreateAndSetRemoteOfferAndLocalAnswer(); |
| 3505 cricket::FakeVideoMediaChannel* channel = media_engine_->GetVideoChannel(0); | 3505 cricket::FakeVideoMediaChannel* channel = media_engine_->GetVideoChannel(0); |
| 3506 ASSERT_TRUE(channel != NULL); | 3506 ASSERT_TRUE(channel != NULL); |
| 3507 ASSERT_EQ(1u, channel->send_streams().size()); | 3507 ASSERT_EQ(1u, channel->send_streams().size()); |
| 3508 uint32_t send_ssrc = channel->send_streams()[0].first_ssrc(); | 3508 uint32_t send_ssrc = channel->send_streams()[0].first_ssrc(); |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4394 } | 4394 } |
| 4395 | 4395 |
| 4396 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 4396 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
| 4397 // currently fails because upon disconnection and reconnection OnIceComplete is | 4397 // currently fails because upon disconnection and reconnection OnIceComplete is |
| 4398 // called more than once without returning to IceGatheringGathering. | 4398 // called more than once without returning to IceGatheringGathering. |
| 4399 | 4399 |
| 4400 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, | 4400 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, |
| 4401 WebRtcSessionTest, | 4401 WebRtcSessionTest, |
| 4402 testing::Values(ALREADY_GENERATED, | 4402 testing::Values(ALREADY_GENERATED, |
| 4403 DTLS_IDENTITY_STORE)); | 4403 DTLS_IDENTITY_STORE)); |
| OLD | NEW |