OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2011 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 2759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2770 static_cast<AudioContentDescription*>( | 2770 static_cast<AudioContentDescription*>( |
2771 jdesc.description()->GetContentDescriptionByName(cricket::CN_AUDIO)); | 2771 jdesc.description()->GetContentDescriptionByName(cricket::CN_AUDIO)); |
2772 EXPECT_TRUE(audio->conference_mode()); | 2772 EXPECT_TRUE(audio->conference_mode()); |
2773 | 2773 |
2774 cricket::VideoContentDescription* video = | 2774 cricket::VideoContentDescription* video = |
2775 static_cast<VideoContentDescription*>( | 2775 static_cast<VideoContentDescription*>( |
2776 jdesc.description()->GetContentDescriptionByName(cricket::CN_VIDEO)); | 2776 jdesc.description()->GetContentDescriptionByName(cricket::CN_VIDEO)); |
2777 EXPECT_TRUE(video->conference_mode()); | 2777 EXPECT_TRUE(video->conference_mode()); |
2778 } | 2778 } |
2779 | 2779 |
| 2780 TEST_F(WebRtcSdpTest, SerializeSdpWithConferenceFlag) { |
| 2781 JsepSessionDescription jdesc(kDummyString); |
| 2782 |
| 2783 // We tested deserialization already above, so just test that if we serialize |
| 2784 // and deserialize the flag doesn't disappear. |
| 2785 EXPECT_TRUE(SdpDeserialize(kSdpConferenceString, &jdesc)); |
| 2786 std::string reserialized = webrtc::SdpSerialize(jdesc, false); |
| 2787 EXPECT_TRUE(SdpDeserialize(reserialized, &jdesc)); |
| 2788 |
| 2789 // Verify. |
| 2790 cricket::AudioContentDescription* audio = |
| 2791 static_cast<AudioContentDescription*>( |
| 2792 jdesc.description()->GetContentDescriptionByName(cricket::CN_AUDIO)); |
| 2793 EXPECT_TRUE(audio->conference_mode()); |
| 2794 |
| 2795 cricket::VideoContentDescription* video = |
| 2796 static_cast<VideoContentDescription*>( |
| 2797 jdesc.description()->GetContentDescriptionByName(cricket::CN_VIDEO)); |
| 2798 EXPECT_TRUE(video->conference_mode()); |
| 2799 } |
| 2800 |
2780 TEST_F(WebRtcSdpTest, DeserializeBrokenSdp) { | 2801 TEST_F(WebRtcSdpTest, DeserializeBrokenSdp) { |
2781 const char kSdpDestroyer[] = "!@#$%^&"; | 2802 const char kSdpDestroyer[] = "!@#$%^&"; |
2782 const char kSdpEmptyType[] = " =candidate"; | 2803 const char kSdpEmptyType[] = " =candidate"; |
2783 const char kSdpEqualAsPlus[] = "a+candidate"; | 2804 const char kSdpEqualAsPlus[] = "a+candidate"; |
2784 const char kSdpSpaceAfterEqual[] = "a= candidate"; | 2805 const char kSdpSpaceAfterEqual[] = "a= candidate"; |
2785 const char kSdpUpperType[] = "A=candidate"; | 2806 const char kSdpUpperType[] = "A=candidate"; |
2786 const char kSdpEmptyLine[] = ""; | 2807 const char kSdpEmptyLine[] = ""; |
2787 const char kSdpMissingValue[] = "a="; | 2808 const char kSdpMissingValue[] = "a="; |
2788 | 2809 |
2789 const char kSdpBrokenFingerprint[] = "a=fingerprint:sha-1 " | 2810 const char kSdpBrokenFingerprint[] = "a=fingerprint:sha-1 " |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3574 EXPECT_TRUE(SdpDeserialize(message, &jdesc)); | 3595 EXPECT_TRUE(SdpDeserialize(message, &jdesc)); |
3575 auto audio_desc = static_cast<cricket::MediaContentDescription*>( | 3596 auto audio_desc = static_cast<cricket::MediaContentDescription*>( |
3576 jdesc.description()->GetContentByName(kAudioContentName)->description); | 3597 jdesc.description()->GetContentByName(kAudioContentName)->description); |
3577 auto video_desc = static_cast<cricket::MediaContentDescription*>( | 3598 auto video_desc = static_cast<cricket::MediaContentDescription*>( |
3578 jdesc.description()->GetContentByName(kVideoContentName)->description); | 3599 jdesc.description()->GetContentByName(kVideoContentName)->description); |
3579 EXPECT_EQ(audio_desc_->connection_address().ToString(), | 3600 EXPECT_EQ(audio_desc_->connection_address().ToString(), |
3580 audio_desc->connection_address().ToString()); | 3601 audio_desc->connection_address().ToString()); |
3581 EXPECT_EQ(video_desc_->connection_address().ToString(), | 3602 EXPECT_EQ(video_desc_->connection_address().ToString(), |
3582 video_desc->connection_address().ToString()); | 3603 video_desc->connection_address().ToString()); |
3583 } | 3604 } |
OLD | NEW |