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

Unified Diff: talk/app/webrtc/webrtcsdp_unittest.cc

Issue 1395523002: Added parsing of either space or colon for sctp-port. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added requested TODO. Created 5 years, 2 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 | « talk/app/webrtc/webrtcsdp.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/webrtcsdp_unittest.cc
diff --git a/talk/app/webrtc/webrtcsdp_unittest.cc b/talk/app/webrtc/webrtcsdp_unittest.cc
index a534c23920748138cb98d5eb03c3da47c0b3fb99..eb787e030c61fb3e202adb946c952c6b41a73a46 100644
--- a/talk/app/webrtc/webrtcsdp_unittest.cc
+++ b/talk/app/webrtc/webrtcsdp_unittest.cc
@@ -297,6 +297,15 @@ static const char kSdpSctpDataChannelStringWithSctpPort[] =
"a=ice-pwd:pwd_data\r\n"
"a=mid:data_content_name\r\n";
+static const char kSdpSctpDataChannelStringWithSctpColonPort[] =
+ "m=application 9 DTLS/SCTP webrtc-datachannel\r\n"
+ "a=max-message-size=100000\r\n"
+ "a=sctp-port:5000\r\n"
+ "c=IN IP4 0.0.0.0\r\n"
+ "a=ice-ufrag:ufrag_data\r\n"
+ "a=ice-pwd:pwd_data\r\n"
+ "a=mid:data_content_name\r\n";
+
static const char kSdpSctpDataChannelWithCandidatesString[] =
"m=application 2345 DTLS/SCTP 5000\r\n"
"c=IN IP4 74.125.127.126\r\n"
@@ -2126,6 +2135,32 @@ TEST_F(WebRtcSdpTest, DeserializeSdpWithSctpDataChannelsWithSctpPort) {
EXPECT_TRUE(CompareSessionDescription(jdesc, jdesc_output));
}
+TEST_F(WebRtcSdpTest, DeserializeSdpWithSctpDataChannelsWithSctpColonPort) {
+ AddSctpDataChannel();
+ JsepSessionDescription jdesc(kDummyString);
+ ASSERT_TRUE(jdesc.Initialize(desc_.Copy(), kSessionId, kSessionVersion));
+
+ std::string sdp_with_data = kSdpString;
+ sdp_with_data.append(kSdpSctpDataChannelStringWithSctpColonPort);
+ JsepSessionDescription jdesc_output(kDummyString);
+
+ // Verify with DTLS/SCTP.
+ EXPECT_TRUE(SdpDeserialize(sdp_with_data, &jdesc_output));
+ EXPECT_TRUE(CompareSessionDescription(jdesc, jdesc_output));
+
+ // Verify with UDP/DTLS/SCTP.
+ sdp_with_data.replace(sdp_with_data.find(kDtlsSctp),
+ strlen(kDtlsSctp), kUdpDtlsSctp);
+ EXPECT_TRUE(SdpDeserialize(sdp_with_data, &jdesc_output));
+ EXPECT_TRUE(CompareSessionDescription(jdesc, jdesc_output));
+
+ // Verify with TCP/DTLS/SCTP.
+ sdp_with_data.replace(sdp_with_data.find(kUdpDtlsSctp),
+ strlen(kUdpDtlsSctp), kTcpDtlsSctp);
+ EXPECT_TRUE(SdpDeserialize(sdp_with_data, &jdesc_output));
+ EXPECT_TRUE(CompareSessionDescription(jdesc, jdesc_output));
+}
+
// Test to check the behaviour if sctp-port is specified
// on the m= line and in a=sctp-port.
TEST_F(WebRtcSdpTest, DeserializeSdpWithMultiSctpPort) {
« no previous file with comments | « talk/app/webrtc/webrtcsdp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698