OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2412 // Verify previous value is not modified if dscp option is not set. | 2412 // Verify previous value is not modified if dscp option is not set. |
2413 cricket::VideoSendParameters parameters1 = send_parameters_; | 2413 cricket::VideoSendParameters parameters1 = send_parameters_; |
2414 EXPECT_TRUE(channel_->SetSendParameters(parameters1)); | 2414 EXPECT_TRUE(channel_->SetSendParameters(parameters1)); |
2415 EXPECT_EQ(rtc::DSCP_AF41, network_interface->dscp()); | 2415 EXPECT_EQ(rtc::DSCP_AF41, network_interface->dscp()); |
2416 parameters1.options.dscp = rtc::Optional<bool>(false); | 2416 parameters1.options.dscp = rtc::Optional<bool>(false); |
2417 EXPECT_TRUE(channel_->SetSendParameters(parameters1)); | 2417 EXPECT_TRUE(channel_->SetSendParameters(parameters1)); |
2418 EXPECT_EQ(rtc::DSCP_DEFAULT, network_interface->dscp()); | 2418 EXPECT_EQ(rtc::DSCP_DEFAULT, network_interface->dscp()); |
2419 channel_->SetInterface(NULL); | 2419 channel_->SetInterface(NULL); |
2420 } | 2420 } |
2421 | 2421 |
| 2422 // This test verifies that the RTCP reduced size mode is properly applied to |
| 2423 // send video streams. |
| 2424 TEST_F(WebRtcVideoChannel2Test, TestSetSendRtcpReducedSize) { |
| 2425 // Create stream, expecting that default mode is "compound". |
| 2426 FakeVideoSendStream* stream1 = AddSendStream(); |
| 2427 EXPECT_EQ(webrtc::RtcpMode::kCompound, stream1->GetConfig().rtp.rtcp_mode); |
| 2428 |
| 2429 // Now enable reduced size mode. |
| 2430 send_parameters_.rtcp.reduced_size = true; |
| 2431 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); |
| 2432 stream1 = fake_call_->GetVideoSendStreams()[0]; |
| 2433 EXPECT_EQ(webrtc::RtcpMode::kReducedSize, stream1->GetConfig().rtp.rtcp_mode); |
| 2434 |
| 2435 // Create a new stream and ensure it picks up the reduced size mode. |
| 2436 FakeVideoSendStream* stream2 = AddSendStream(); |
| 2437 EXPECT_EQ(webrtc::RtcpMode::kReducedSize, stream2->GetConfig().rtp.rtcp_mode); |
| 2438 } |
| 2439 |
| 2440 // This test verifies that the RTCP reduced size mode is properly applied to |
| 2441 // receive video streams. |
| 2442 TEST_F(WebRtcVideoChannel2Test, TestSetRecvRtcpReducedSize) { |
| 2443 // Create stream, expecting that default mode is "compound". |
| 2444 FakeVideoReceiveStream* stream1 = AddRecvStream(); |
| 2445 EXPECT_EQ(webrtc::RtcpMode::kCompound, stream1->GetConfig().rtp.rtcp_mode); |
| 2446 |
| 2447 // Now enable reduced size mode. |
| 2448 recv_parameters_.rtcp.reduced_size = true; |
| 2449 EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_)); |
| 2450 stream1 = fake_call_->GetVideoReceiveStreams()[0]; |
| 2451 EXPECT_EQ(webrtc::RtcpMode::kReducedSize, stream1->GetConfig().rtp.rtcp_mode); |
| 2452 |
| 2453 // Create a new stream and ensure it picks up the reduced size mode. |
| 2454 FakeVideoReceiveStream* stream2 = AddRecvStream(); |
| 2455 EXPECT_EQ(webrtc::RtcpMode::kReducedSize, stream2->GetConfig().rtp.rtcp_mode); |
| 2456 } |
| 2457 |
2422 TEST_F(WebRtcVideoChannel2Test, OnReadyToSendSignalsNetworkState) { | 2458 TEST_F(WebRtcVideoChannel2Test, OnReadyToSendSignalsNetworkState) { |
2423 EXPECT_EQ(webrtc::kNetworkUp, fake_call_->GetNetworkState()); | 2459 EXPECT_EQ(webrtc::kNetworkUp, fake_call_->GetNetworkState()); |
2424 | 2460 |
2425 channel_->OnReadyToSend(false); | 2461 channel_->OnReadyToSend(false); |
2426 EXPECT_EQ(webrtc::kNetworkDown, fake_call_->GetNetworkState()); | 2462 EXPECT_EQ(webrtc::kNetworkDown, fake_call_->GetNetworkState()); |
2427 | 2463 |
2428 channel_->OnReadyToSend(true); | 2464 channel_->OnReadyToSend(true); |
2429 EXPECT_EQ(webrtc::kNetworkUp, fake_call_->GetNetworkState()); | 2465 EXPECT_EQ(webrtc::kNetworkUp, fake_call_->GetNetworkState()); |
2430 } | 2466 } |
2431 | 2467 |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3302 // Ensures that the correct settings are applied to the codec when two temporal | 3338 // Ensures that the correct settings are applied to the codec when two temporal |
3303 // layer screencasting is enabled, and that the correct simulcast settings are | 3339 // layer screencasting is enabled, and that the correct simulcast settings are |
3304 // reapplied when disabling screencasting. | 3340 // reapplied when disabling screencasting. |
3305 TEST_F(WebRtcVideoChannel2SimulcastTest, | 3341 TEST_F(WebRtcVideoChannel2SimulcastTest, |
3306 DISABLED_TwoTemporalLayerScreencastSettings) { | 3342 DISABLED_TwoTemporalLayerScreencastSettings) { |
3307 // TODO(pbos): Implement. | 3343 // TODO(pbos): Implement. |
3308 FAIL() << "Not implemented."; | 3344 FAIL() << "Not implemented."; |
3309 } | 3345 } |
3310 | 3346 |
3311 } // namespace cricket | 3347 } // namespace cricket |
OLD | NEW |