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

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

Issue 1757683002: Make the audio channel communicate network state changes to the call. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Use the presence of send/receive streams to infer which media types are active Created 4 years, 9 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 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after
2415 EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_)); 2415 EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_));
2416 stream1 = fake_call_->GetVideoReceiveStreams()[0]; 2416 stream1 = fake_call_->GetVideoReceiveStreams()[0];
2417 EXPECT_EQ(webrtc::RtcpMode::kReducedSize, stream1->GetConfig().rtp.rtcp_mode); 2417 EXPECT_EQ(webrtc::RtcpMode::kReducedSize, stream1->GetConfig().rtp.rtcp_mode);
2418 2418
2419 // Create a new stream and ensure it picks up the reduced size mode. 2419 // Create a new stream and ensure it picks up the reduced size mode.
2420 FakeVideoReceiveStream* stream2 = AddRecvStream(); 2420 FakeVideoReceiveStream* stream2 = AddRecvStream();
2421 EXPECT_EQ(webrtc::RtcpMode::kReducedSize, stream2->GetConfig().rtp.rtcp_mode); 2421 EXPECT_EQ(webrtc::RtcpMode::kReducedSize, stream2->GetConfig().rtp.rtcp_mode);
2422 } 2422 }
2423 2423
2424 TEST_F(WebRtcVideoChannel2Test, OnReadyToSendSignalsNetworkState) { 2424 TEST_F(WebRtcVideoChannel2Test, OnReadyToSendSignalsNetworkState) {
2425 EXPECT_EQ(webrtc::kNetworkUp, fake_call_->GetNetworkState()); 2425 EXPECT_EQ(webrtc::kNetworkUp,
2426 fake_call_->GetNetworkState(webrtc::MediaType::VIDEO));
2427 EXPECT_EQ(webrtc::kNetworkUp,
2428 fake_call_->GetNetworkState(webrtc::MediaType::AUDIO));
2426 2429
2427 channel_->OnReadyToSend(false); 2430 channel_->OnReadyToSend(false);
2428 EXPECT_EQ(webrtc::kNetworkDown, fake_call_->GetNetworkState()); 2431 EXPECT_EQ(webrtc::kNetworkDown,
2432 fake_call_->GetNetworkState(webrtc::MediaType::VIDEO));
2433 EXPECT_EQ(webrtc::kNetworkUp,
2434 fake_call_->GetNetworkState(webrtc::MediaType::AUDIO));
2429 2435
2430 channel_->OnReadyToSend(true); 2436 channel_->OnReadyToSend(true);
2431 EXPECT_EQ(webrtc::kNetworkUp, fake_call_->GetNetworkState()); 2437 EXPECT_EQ(webrtc::kNetworkUp,
2438 fake_call_->GetNetworkState(webrtc::MediaType::VIDEO));
2439 EXPECT_EQ(webrtc::kNetworkUp,
2440 fake_call_->GetNetworkState(webrtc::MediaType::AUDIO));
2432 } 2441 }
2433 2442
2434 TEST_F(WebRtcVideoChannel2Test, GetStatsReportsSentCodecName) { 2443 TEST_F(WebRtcVideoChannel2Test, GetStatsReportsSentCodecName) {
2435 cricket::VideoSendParameters parameters; 2444 cricket::VideoSendParameters parameters;
2436 parameters.codecs.push_back(kVp8Codec); 2445 parameters.codecs.push_back(kVp8Codec);
2437 EXPECT_TRUE(channel_->SetSendParameters(parameters)); 2446 EXPECT_TRUE(channel_->SetSendParameters(parameters));
2438 2447
2439 AddSendStream(); 2448 AddSendStream();
2440 2449
2441 cricket::VideoMediaInfo info; 2450 cricket::VideoMediaInfo info;
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
3170 // Test that we normalize send codec format size in simulcast. 3179 // Test that we normalize send codec format size in simulcast.
3171 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 3180 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
3172 cricket::VideoCodec codec(kVp8Codec270p); 3181 cricket::VideoCodec codec(kVp8Codec270p);
3173 codec.width += 1; 3182 codec.width += 1;
3174 codec.height += 1; 3183 codec.height += 1;
3175 VerifySimulcastSettings(codec, 2, 2); 3184 VerifySimulcastSettings(codec, 2, 2);
3176 } 3185 }
3177 } // namespace cricket 3186 } // namespace cricket
3178 3187
3179 #endif // HAVE_WEBRTC_VIDEO 3188 #endif // HAVE_WEBRTC_VIDEO
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698