Serialize "a=x-google-flag:conference".
There was a test for deserialization but not serialization. This was
probably always broken and no one noticed. I only noticed while
debugging something else.
BUG=None
TBR=pthatcher@webrtc.org
Review-Url: https://codereview.webrtc.org/3012383002
Cr-Commit-Position: refs/heads/master@{#19875}
diff --git a/pc/webrtcsdp_unittest.cc b/pc/webrtcsdp_unittest.cc
index eea8e01..75dac25 100644
--- a/pc/webrtcsdp_unittest.cc
+++ b/pc/webrtcsdp_unittest.cc
@@ -2777,6 +2777,27 @@
EXPECT_TRUE(video->conference_mode());
}
+TEST_F(WebRtcSdpTest, SerializeSdpWithConferenceFlag) {
+ JsepSessionDescription jdesc(kDummyString);
+
+ // We tested deserialization already above, so just test that if we serialize
+ // and deserialize the flag doesn't disappear.
+ EXPECT_TRUE(SdpDeserialize(kSdpConferenceString, &jdesc));
+ std::string reserialized = webrtc::SdpSerialize(jdesc, false);
+ EXPECT_TRUE(SdpDeserialize(reserialized, &jdesc));
+
+ // Verify.
+ cricket::AudioContentDescription* audio =
+ static_cast<AudioContentDescription*>(
+ jdesc.description()->GetContentDescriptionByName(cricket::CN_AUDIO));
+ EXPECT_TRUE(audio->conference_mode());
+
+ cricket::VideoContentDescription* video =
+ static_cast<VideoContentDescription*>(
+ jdesc.description()->GetContentDescriptionByName(cricket::CN_VIDEO));
+ EXPECT_TRUE(video->conference_mode());
+}
+
TEST_F(WebRtcSdpTest, DeserializeBrokenSdp) {
const char kSdpDestroyer[] = "!@#$%^&";
const char kSdpEmptyType[] = " =candidate";