diff options
author | deadbeef <deadbeef@webrtc.org> | 2017-09-16 01:24:29 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2017-09-16 08:24:29 +0000 |
commit | d45aea8f42308060860f8c51dd56415a62d560c1 (patch) | |
tree | 1876b454af6d371e9867e494c36c54e784d909e2 /pc/webrtcsdp_unittest.cc | |
parent | 5ada7acf603e90e71990e9d4ff8f49389f24958c (diff) | |
download | webrtc-d45aea8f42308060860f8c51dd56415a62d560c1.tar.gz |
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}
Diffstat (limited to 'pc/webrtcsdp_unittest.cc')
-rw-r--r-- | pc/webrtcsdp_unittest.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pc/webrtcsdp_unittest.cc b/pc/webrtcsdp_unittest.cc index eea8e01aac..75dac2505b 100644 --- a/pc/webrtcsdp_unittest.cc +++ b/pc/webrtcsdp_unittest.cc @@ -2777,6 +2777,27 @@ TEST_F(WebRtcSdpTest, DeserializeSdpWithConferenceFlag) { 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"; |