Update talk to 51664136.
R=mallinath@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/2148004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@4649 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/talk/app/webrtc/webrtcsdp_unittest.cc b/talk/app/webrtc/webrtcsdp_unittest.cc
index 5fa8b0c..7e36cd9 100644
--- a/talk/app/webrtc/webrtcsdp_unittest.cc
+++ b/talk/app/webrtc/webrtcsdp_unittest.cc
@@ -1427,6 +1427,25 @@
EXPECT_EQ(message, expected_sdp);
}
+TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithDataChannelAndBandwidth) {
+ AddRtpDataChannel();
+ data_desc_->set_bandwidth(100*1000);
+ JsepSessionDescription jsep_desc(kDummyString);
+
+ ASSERT_TRUE(jsep_desc.Initialize(desc_.Copy(), kSessionId, kSessionVersion));
+ std::string message = webrtc::SdpSerialize(jsep_desc);
+
+ std::string expected_sdp = kSdpString;
+ expected_sdp.append(kSdpRtpDataChannelString);
+ // We want to test that serializing data content ignores bandwidth
+ // settings (it should always be the default). Thus, we don't do
+ // the following:
+ // InjectAfter("a=mid:data_content_name\r\n",
+ // "b=AS:100\r\n",
+ // &expected_sdp);
+ EXPECT_EQ(message, expected_sdp);
+}
+
TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithExtmap) {
AddExtmap();
JsepSessionDescription desc_with_extmap("dummy");
@@ -1739,6 +1758,29 @@
EXPECT_TRUE(CompareSessionDescription(jdesc, jdesc_output));
}
+TEST_F(WebRtcSdpTest, DeserializeSdpWithRtpDataChannelsAndBandwidth) {
+ AddRtpDataChannel();
+ JsepSessionDescription jdesc(kDummyString);
+ // We want to test that deserializing data content ignores bandwidth
+ // settings (it should always be the default). Thus, we don't do
+ // the following:
+ // DataContentDescription* dcd = static_cast<DataContentDescription*>(
+ // GetFirstDataContent(&desc_)->description);
+ // dcd->set_bandwidth(100 * 1000);
+ ASSERT_TRUE(jdesc.Initialize(desc_.Copy(), kSessionId, kSessionVersion));
+
+ std::string sdp_with_bandwidth = kSdpString;
+ sdp_with_bandwidth.append(kSdpRtpDataChannelString);
+ InjectAfter("a=mid:data_content_name\r\n",
+ "b=AS:100\r\n",
+ &sdp_with_bandwidth);
+ JsepSessionDescription jdesc_with_bandwidth(kDummyString);
+
+ EXPECT_TRUE(
+ SdpDeserialize(sdp_with_bandwidth, &jdesc_with_bandwidth));
+ EXPECT_TRUE(CompareSessionDescription(jdesc, jdesc_with_bandwidth));
+}
+
TEST_F(WebRtcSdpTest, DeserializeSessionDescriptionWithSessionLevelExtmap) {
TestDeserializeExtmap(true, false);
}