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

Side by Side Diff: webrtc/api/webrtcsdp_unittest.cc

Issue 2609863003: Relax parsing of a=bundle-only with a nonzero port. (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « webrtc/api/webrtcsdp.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2011 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 3221 matching lines...) Expand 10 before | Expand all | Expand 10 after
3232 } 3232 }
3233 3233
3234 std::string serialized_sdp = webrtc::SdpSerialize(jdesc, false); 3234 std::string serialized_sdp = webrtc::SdpSerialize(jdesc, false);
3235 EXPECT_EQ(sdp_string, serialized_sdp); 3235 EXPECT_EQ(sdp_string, serialized_sdp);
3236 } 3236 }
3237 } 3237 }
3238 3238
3239 TEST_F(WebRtcSdpTest, DeserializeBundleOnlyAttribute) { 3239 TEST_F(WebRtcSdpTest, DeserializeBundleOnlyAttribute) {
3240 MakeBundleOnlyDescription(); 3240 MakeBundleOnlyDescription();
3241 JsepSessionDescription deserialized_description(kDummyString); 3241 JsepSessionDescription deserialized_description(kDummyString);
3242 EXPECT_TRUE( 3242 ASSERT_TRUE(
3243 SdpDeserialize(kBundleOnlySdpFullString, &deserialized_description)); 3243 SdpDeserialize(kBundleOnlySdpFullString, &deserialized_description));
3244 EXPECT_TRUE(CompareSessionDescription(jdesc_, deserialized_description)); 3244 EXPECT_TRUE(CompareSessionDescription(jdesc_, deserialized_description));
3245 } 3245 }
3246 3246
3247 // "a=bundle-only" should only be used in combination with a 0 port on the m= 3247 // The semantics of "a=bundle-only" are only defined when it's used in
3248 // line. We should fail to parse anything else. 3248 // combination with a 0 port on the m= line. We should ignore it if used with a
3249 TEST_F(WebRtcSdpTest, FailToDeserializeBundleOnlyWithNonzeroPort) { 3249 // nonzero port.
3250 std::string bad_sdp = kBundleOnlySdpFullString; 3250 TEST_F(WebRtcSdpTest, IgnoreBundleOnlyWithNonzeroPort) {
3251 Replace("m=video 0", "m=video 9", &bad_sdp); 3251 // Make the base bundle-only description but unset the bundle-only flag.
3252 ExpectParseFailure(bad_sdp, "a=bundle-only"); 3252 MakeBundleOnlyDescription();
3253 jdesc_.description()->contents()[1].bundle_only = false;
3254
3255 std::string modified_sdp = kBundleOnlySdpFullString;
3256 Replace("m=video 0", "m=video 9", &modified_sdp);
3257 JsepSessionDescription deserialized_description(kDummyString);
3258 ASSERT_TRUE(SdpDeserialize(modified_sdp, &deserialized_description));
3259 EXPECT_TRUE(CompareSessionDescription(jdesc_, deserialized_description));
3253 } 3260 }
3254 3261
3255 TEST_F(WebRtcSdpTest, SerializeBundleOnlyAttribute) { 3262 TEST_F(WebRtcSdpTest, SerializeBundleOnlyAttribute) {
3256 MakeBundleOnlyDescription(); 3263 MakeBundleOnlyDescription();
3257 TestSerialize(jdesc_, false); 3264 TestSerialize(jdesc_, false);
3258 } 3265 }
3259 3266
3260 TEST_F(WebRtcSdpTest, DeserializePlanBSessionDescription) { 3267 TEST_F(WebRtcSdpTest, DeserializePlanBSessionDescription) {
3261 MakePlanBDescription(); 3268 MakePlanBDescription();
3262 3269
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
3331 "v=0\r\n" 3338 "v=0\r\n"
3332 "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n" 3339 "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n"
3333 "s=-\r\n" 3340 "s=-\r\n"
3334 "t=0 0\r\n" 3341 "t=0 0\r\n"
3335 "m=video 3457 RTP/SAVPF 120\r\n" 3342 "m=video 3457 RTP/SAVPF 120\r\n"
3336 "b=AS:2147483647\r\n" 3343 "b=AS:2147483647\r\n"
3337 "foo=fail\r\n"; 3344 "foo=fail\r\n";
3338 3345
3339 ExpectParseFailure(std::string(kSdpWithLargeBandwidth), "foo=fail"); 3346 ExpectParseFailure(std::string(kSdpWithLargeBandwidth), "foo=fail");
3340 } 3347 }
OLDNEW
« 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