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

Unified Diff: webrtc/media/engine/webrtcvideoengine2_unittest.cc

Issue 1822923002: Adding support for RTCRtpEncodingParameters.active flag. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Responding to comments by pbos@ 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/media/engine/webrtcvideoengine2_unittest.cc
diff --git a/webrtc/media/engine/webrtcvideoengine2_unittest.cc b/webrtc/media/engine/webrtcvideoengine2_unittest.cc
index 477b62323eb5b1ddbd5f9aa5cd6be16732f4f436..122ea5a730f536c6df1fdd92149268295ea85c2f 100644
--- a/webrtc/media/engine/webrtcvideoengine2_unittest.cc
+++ b/webrtc/media/engine/webrtcvideoengine2_unittest.cc
@@ -3267,7 +3267,7 @@ TEST_F(WebRtcVideoChannel2Test,
CannotSetRtpParametersWithIncorrectNumberOfEncodings) {
// This test verifies that setting RtpParameters succeeds only if
// the structure contains exactly one encoding.
- // TODO(skvlad): Update this test when we strat supporting setting parameters
+ // TODO(skvlad): Update this test when we start supporting setting parameters
// for each encoding individually.
AddSendStream();
@@ -3282,6 +3282,29 @@ TEST_F(WebRtcVideoChannel2Test,
EXPECT_FALSE(channel_->SetRtpParameters(last_ssrc_, parameters));
}
+// Test that a stream will not be sending if its encoding is made
+// inactive through SetRtpParameters.
+// TODO(deadbeef): Update this test when we start supporting setting parameters
+// for each encoding individually.
+TEST_F(WebRtcVideoChannel2Test, SetRtpParametersEncodingsActive) {
+ FakeVideoSendStream* stream = AddSendStream();
+ EXPECT_TRUE(channel_->SetSend(true));
+ EXPECT_TRUE(stream->IsSending());
+
+ // Get current parameters and change "active" to false.
+ webrtc::RtpParameters parameters = channel_->GetRtpParameters(last_ssrc_);
+ ASSERT_EQ(1u, parameters.encodings.size());
+ ASSERT_TRUE(parameters.encodings[0].active);
+ parameters.encodings[0].active = false;
+ EXPECT_TRUE(channel_->SetRtpParameters(last_ssrc_, parameters));
+ EXPECT_FALSE(stream->IsSending());
+
+ // Now change it back to active and verify we resume sending.
+ parameters.encodings[0].active = true;
+ EXPECT_TRUE(channel_->SetRtpParameters(last_ssrc_, parameters));
+ EXPECT_TRUE(stream->IsSending());
+}
+
void WebRtcVideoChannel2Test::TestReceiverLocalSsrcConfiguration(
bool receiver_first) {
EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
« webrtc/media/engine/webrtcvideoengine2.cc ('K') | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698