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

Unified Diff: webrtc/api/webrtcsdp_unittest.cc

Issue 2609863003: Relax parsing of a=bundle-only with a nonzero port. (Closed)
Patch Set: Created 3 years, 12 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/api/webrtcsdp.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/webrtcsdp_unittest.cc
diff --git a/webrtc/api/webrtcsdp_unittest.cc b/webrtc/api/webrtcsdp_unittest.cc
index 32f8bba6033957bc6310ff2d30df8aa5e8a80c7f..d69b1356118d85a1cf4657804706ad1ec09b204f 100644
--- a/webrtc/api/webrtcsdp_unittest.cc
+++ b/webrtc/api/webrtcsdp_unittest.cc
@@ -3239,17 +3239,24 @@ TEST_F(WebRtcSdpTest, MediaContentOrderMaintainedRoundTrip) {
TEST_F(WebRtcSdpTest, DeserializeBundleOnlyAttribute) {
MakeBundleOnlyDescription();
JsepSessionDescription deserialized_description(kDummyString);
- EXPECT_TRUE(
+ ASSERT_TRUE(
SdpDeserialize(kBundleOnlySdpFullString, &deserialized_description));
EXPECT_TRUE(CompareSessionDescription(jdesc_, deserialized_description));
}
-// "a=bundle-only" should only be used in combination with a 0 port on the m=
-// line. We should fail to parse anything else.
-TEST_F(WebRtcSdpTest, FailToDeserializeBundleOnlyWithNonzeroPort) {
- std::string bad_sdp = kBundleOnlySdpFullString;
- Replace("m=video 0", "m=video 9", &bad_sdp);
- ExpectParseFailure(bad_sdp, "a=bundle-only");
+// The semantics of "a=bundle-only" are only defined when it's used in
+// combination with a 0 port on the m= line. We should ignore it if used with a
+// nonzero port.
+TEST_F(WebRtcSdpTest, IgnoreBundleOnlyWithNonzeroPort) {
+ // Make the base bundle-only description but unset the bundle-only flag.
+ MakeBundleOnlyDescription();
+ jdesc_.description()->contents()[1].bundle_only = false;
+
+ std::string modified_sdp = kBundleOnlySdpFullString;
+ Replace("m=video 0", "m=video 9", &modified_sdp);
+ JsepSessionDescription deserialized_description(kDummyString);
+ ASSERT_TRUE(SdpDeserialize(modified_sdp, &deserialized_description));
+ EXPECT_TRUE(CompareSessionDescription(jdesc_, deserialized_description));
}
TEST_F(WebRtcSdpTest, SerializeBundleOnlyAttribute) {
« no previous file with comments | « webrtc/api/webrtcsdp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698