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

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

Issue 2567333004: Add video send SSRC to RtpParameters, and don't allow changing SSRC. (Closed)
Patch Set: Back out Obj-C and Java changes (were landed separately) Created 3 years, 11 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
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvoiceengine_unittest.cc
diff --git a/webrtc/media/engine/webrtcvoiceengine_unittest.cc b/webrtc/media/engine/webrtcvoiceengine_unittest.cc
index 3ca7ec8b051cf20a8bca795efb4b1d7ff98b8dd0..0cfbeab42beeb0473a3b5fae3daf066a76749ca2 100644
--- a/webrtc/media/engine/webrtcvoiceengine_unittest.cc
+++ b/webrtc/media/engine/webrtcvoiceengine_unittest.cc
@@ -1039,15 +1039,21 @@ TEST_F(WebRtcVoiceEngineTestFake,
// for each encoding individually.
EXPECT_TRUE(SetupSendStream());
- // Setting RtpParameters with no encoding is expected to fail.
- webrtc::RtpParameters parameters;
- EXPECT_FALSE(channel_->SetRtpSendParameters(kSsrc1, parameters));
- // Setting RtpParameters with exactly one encoding should succeed.
- parameters.encodings.push_back(webrtc::RtpEncodingParameters());
- EXPECT_TRUE(channel_->SetRtpSendParameters(kSsrc1, parameters));
+ webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(kSsrc1);
// Two or more encodings should result in failure.
parameters.encodings.push_back(webrtc::RtpEncodingParameters());
EXPECT_FALSE(channel_->SetRtpSendParameters(kSsrc1, parameters));
+ // Zero encodings should also fail.
+ parameters.encodings.clear();
+ EXPECT_FALSE(channel_->SetRtpSendParameters(kSsrc1, parameters));
+}
+
+// Changing the SSRC through RtpParameters is not allowed.
+TEST_F(WebRtcVoiceEngineTestFake, CannotSetSsrcInRtpSendParameters) {
+ EXPECT_TRUE(SetupSendStream());
+ webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(kSsrc1);
+ parameters.encodings[0].ssrc = rtc::Optional<uint32_t>(0xdeadbeef);
+ EXPECT_FALSE(channel_->SetRtpSendParameters(kSsrc1, parameters));
}
// Test that a stream will not be sending if its encoding is made
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698