Chromium Code Reviews| 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 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1209 } else { | 1209 } else { |
| 1210 EXPECT_EQ(transport1.description.identity_fingerprint.get(), | 1210 EXPECT_EQ(transport1.description.identity_fingerprint.get(), |
| 1211 transport2.description.identity_fingerprint.get()); | 1211 transport2.description.identity_fingerprint.get()); |
| 1212 } | 1212 } |
| 1213 EXPECT_EQ(transport1.description.transport_options, | 1213 EXPECT_EQ(transport1.description.transport_options, |
| 1214 transport2.description.transport_options); | 1214 transport2.description.transport_options); |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 // global attributes | 1217 // global attributes |
| 1218 EXPECT_EQ(desc1.msid_supported(), desc2.msid_supported()); | 1218 EXPECT_EQ(desc1.msid_supported(), desc2.msid_supported()); |
| 1219 EXPECT_EQ(desc1.quic(), desc2.quic()); | |
| 1219 } | 1220 } |
| 1220 | 1221 |
| 1221 bool CompareSessionDescription( | 1222 bool CompareSessionDescription( |
| 1222 const JsepSessionDescription& desc1, | 1223 const JsepSessionDescription& desc1, |
| 1223 const JsepSessionDescription& desc2) { | 1224 const JsepSessionDescription& desc2) { |
| 1224 EXPECT_EQ(desc1.session_id(), desc2.session_id()); | 1225 EXPECT_EQ(desc1.session_id(), desc2.session_id()); |
| 1225 EXPECT_EQ(desc1.session_version(), desc2.session_version()); | 1226 EXPECT_EQ(desc1.session_version(), desc2.session_version()); |
| 1226 CompareSessionDescription(*desc1.description(), *desc2.description()); | 1227 CompareSessionDescription(*desc1.description(), *desc2.description()); |
| 1227 if (desc1.number_of_mediasections() != desc2.number_of_mediasections()) | 1228 if (desc1.number_of_mediasections() != desc2.number_of_mediasections()) |
| 1228 return false; | 1229 return false; |
| (...skipping 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3112 EXPECT_TRUE( | 3113 EXPECT_TRUE( |
| 3113 SdpDeserialize(kUnifiedPlanSdpFullString, &deserialized_description)); | 3114 SdpDeserialize(kUnifiedPlanSdpFullString, &deserialized_description)); |
| 3114 | 3115 |
| 3115 EXPECT_TRUE(CompareSessionDescription(jdesc_, deserialized_description)); | 3116 EXPECT_TRUE(CompareSessionDescription(jdesc_, deserialized_description)); |
| 3116 } | 3117 } |
| 3117 | 3118 |
| 3118 TEST_F(WebRtcSdpTest, SerializeUnifiedPlanSessionDescription) { | 3119 TEST_F(WebRtcSdpTest, SerializeUnifiedPlanSessionDescription) { |
| 3119 MakeUnifiedPlanDescription(); | 3120 MakeUnifiedPlanDescription(); |
| 3120 TestSerialize(jdesc_, true); | 3121 TestSerialize(jdesc_, true); |
| 3121 } | 3122 } |
| 3123 | |
| 3124 TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithQuic) { | |
| 3125 JsepSessionDescription jsep_desc(kDummyString); | |
| 3126 ASSERT_TRUE(jsep_desc.Initialize(desc_.Copy(), kSessionId, kSessionVersion)); | |
| 3127 jsep_desc.description()->set_quic(true); | |
| 3128 std::string message = webrtc::SdpSerialize(jsep_desc, false); | |
| 3129 EXPECT_NE(message.find("a=quic\r\n"), std::string::npos); | |
| 3130 } | |
| 3131 | |
| 3132 TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithoutQuic) { | |
| 3133 JsepSessionDescription jsep_desc(kDummyString); | |
| 3134 ASSERT_TRUE(jsep_desc.Initialize(desc_.Copy(), kSessionId, kSessionVersion)); | |
| 3135 std::string message = webrtc::SdpSerialize(jsep_desc, false); | |
| 3136 EXPECT_EQ(message.find("a=quic\r\n"), std::string::npos); | |
| 3137 } | |
| 3138 | |
| 3139 TEST_F(WebRtcSdpTest, DeserializeSessionDescriptionWithQuic) { | |
| 3140 std::string sdp_with_quic = kSdpSessionString; | |
| 3141 InjectAfter(kSessionTime, "a=quic\r\n", &sdp_with_quic); | |
| 3142 JsepSessionDescription jsep_desc_output(kDummyString); | |
| 3143 EXPECT_TRUE(SdpDeserialize(sdp_with_quic, &jsep_desc_output)); | |
| 3144 EXPECT_TRUE(jsep_desc_output.description()->quic()); | |
| 3145 } | |
| 3146 | |
| 3147 TEST_F(WebRtcSdpTest, DeserializeSessionDescriptionWithoutQuic) { | |
|
Taylor Brandstetter
2016/04/01 23:23:42
Aren't the "WithoutQuic" tests already covered by
mikescarlett
2016/04/05 19:58:51
They are. You're correct.
| |
| 3148 std::string sdp_with_quic = kSdpSessionString; | |
|
Taylor Brandstetter
2016/04/01 23:23:42
Should be sdp_without_quic?
| |
| 3149 JsepSessionDescription jsep_desc_output(kDummyString); | |
| 3150 EXPECT_TRUE(SdpDeserialize(sdp_with_quic, &jsep_desc_output)); | |
| 3151 EXPECT_FALSE(jsep_desc_output.description()->quic()); | |
| 3152 } | |
| OLD | NEW |