From c7848b7fd1cb858b61a525b1da8b84159b19d3d3 Mon Sep 17 00:00:00 2001 From: "lally@webrtc.org" Date: Tue, 24 Feb 2015 20:19:26 +0000 Subject: [PATCH] Added a separate DTLS/SCTP test. Cr-Commit-Position: refs/heads/master@{#8484} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8484 4adac7df-926f-26a2-2b94-8c16560cd09d --- talk/app/webrtc/webrtcsdp_unittest.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/talk/app/webrtc/webrtcsdp_unittest.cc b/talk/app/webrtc/webrtcsdp_unittest.cc index a64714881..31dcf6ece 100644 --- a/talk/app/webrtc/webrtcsdp_unittest.cc +++ b/talk/app/webrtc/webrtcsdp_unittest.cc @@ -294,6 +294,15 @@ static const char kSdpSctpDataChannelStringWithSctpPort[] = "a=ice-pwd:pwd_data\r\n" "a=mid:data_content_name\r\n"; +static const char kSdpSctpDataChannelStringWithOldProtocol[] = + "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" @@ -2147,6 +2156,19 @@ TEST_F(WebRtcSdpTest, DeserializeSdpWithSctpDataChannelsWithSctpPort) { EXPECT_TRUE(CompareSessionDescription(jdesc, jdesc_output)); } +TEST_F(WebRtcSdpTest, DeserializeSdpWithSctpDataChannelsWithOldProtocol) { + AddSctpDataChannel(); + JsepSessionDescription jdesc(kDummyString); + ASSERT_TRUE(jdesc.Initialize(desc_.Copy(), kSessionId, kSessionVersion)); + + std::string sdp_with_data = kSdpString; + sdp_with_data.append(kSdpSctpDataChannelStringWithOldProtocol); + JsepSessionDescription jdesc_output(kDummyString); + + 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) {