Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1106 InitWithDtmfCodec(); | 1106 InitWithDtmfCodec(); |
| 1107 } else { | 1107 } else { |
| 1108 Init(); | 1108 Init(); |
| 1109 } | 1109 } |
| 1110 SendAudioVideoStream1(); | 1110 SendAudioVideoStream1(); |
| 1111 CreateAndSetRemoteOfferAndLocalAnswer(); | 1111 CreateAndSetRemoteOfferAndLocalAnswer(); |
| 1112 EXPECT_FALSE(session_->CanInsertDtmf("")); | 1112 EXPECT_FALSE(session_->CanInsertDtmf("")); |
| 1113 EXPECT_EQ(can, session_->CanInsertDtmf(kAudioTrack1)); | 1113 EXPECT_EQ(can, session_->CanInsertDtmf(kAudioTrack1)); |
| 1114 } | 1114 } |
| 1115 | 1115 |
| 1116 bool DescriptionContainsRtxCodec(const SessionDescriptionInterface* desc) { | |
|
pthatcher1
2016/05/05 20:28:34
This should have "video" in the name since it only
| |
| 1117 for (const auto& content : desc->description()->contents()) { | |
| 1118 if (static_cast<cricket::MediaContentDescription*>(content.description) | |
| 1119 ->type() == cricket::MEDIA_TYPE_VIDEO) { | |
| 1120 const auto* mdesc = | |
| 1121 static_cast<cricket::VideoContentDescription*>(content.description); | |
| 1122 for (const auto& codec : mdesc->codecs()) { | |
| 1123 if (codec.name == "rtx") { | |
| 1124 return true; | |
| 1125 } | |
| 1126 } | |
| 1127 } | |
| 1128 } | |
| 1129 return false; | |
| 1130 } | |
| 1116 // Helper class to configure loopback network and verify Best | 1131 // Helper class to configure loopback network and verify Best |
| 1117 // Connection using right IP protocol for TestLoopbackCall | 1132 // Connection using right IP protocol for TestLoopbackCall |
| 1118 // method. LoopbackNetworkManager applies firewall rules to block | 1133 // method. LoopbackNetworkManager applies firewall rules to block |
| 1119 // all ping traffic once ICE completed, and remove them to observe | 1134 // all ping traffic once ICE completed, and remove them to observe |
| 1120 // ICE reconnected again. This LoopbackNetworkConfiguration struct | 1135 // ICE reconnected again. This LoopbackNetworkConfiguration struct |
| 1121 // verifies the best connection is using the right IP protocol after | 1136 // verifies the best connection is using the right IP protocol after |
| 1122 // initial ICE convergences. | 1137 // initial ICE convergences. |
| 1123 | 1138 |
| 1124 class LoopbackNetworkConfiguration { | 1139 class LoopbackNetworkConfiguration { |
| 1125 public: | 1140 public: |
| (...skipping 3144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4270 candidate1.set_address(rtc::SocketAddress("1.1.1.1", 5000)); | 4285 candidate1.set_address(rtc::SocketAddress("1.1.1.1", 5000)); |
| 4271 candidate1.set_component(1); | 4286 candidate1.set_component(1); |
| 4272 JsepIceCandidate ice_candidate(kMediaContentName1, kMediaContentIndex1, | 4287 JsepIceCandidate ice_candidate(kMediaContentName1, kMediaContentIndex1, |
| 4273 candidate1); | 4288 candidate1); |
| 4274 EXPECT_TRUE(session_->ProcessIceMessage(&ice_candidate)); | 4289 EXPECT_TRUE(session_->ProcessIceMessage(&ice_candidate)); |
| 4275 | 4290 |
| 4276 answer = CreateAnswer(); | 4291 answer = CreateAnswer(); |
| 4277 SetLocalDescriptionWithoutError(answer); | 4292 SetLocalDescriptionWithoutError(answer); |
| 4278 } | 4293 } |
| 4279 | 4294 |
| 4280 // Flaky on Win and Mac only. See webrtc:4943 | |
| 4281 #if defined(WEBRTC_WIN) || defined(WEBRTC_MAC) | |
| 4282 #define MAYBE_TestRtxRemovedByCreateAnswer DISABLED_TestRtxRemovedByCreateAnswer | |
| 4283 #else | |
| 4284 #define MAYBE_TestRtxRemovedByCreateAnswer TestRtxRemovedByCreateAnswer | |
| 4285 #endif | |
| 4286 // Tests that RTX codec is removed from the answer when it isn't supported | 4295 // Tests that RTX codec is removed from the answer when it isn't supported |
| 4287 // by local side. | 4296 // by local side. |
| 4288 TEST_F(WebRtcSessionTest, MAYBE_TestRtxRemovedByCreateAnswer) { | 4297 TEST_F(WebRtcSessionTest, TestRtxRemovedByCreateAnswer) { |
| 4289 Init(); | 4298 Init(); |
| 4290 SendAudioVideoStream1(); | 4299 SendAudioVideoStream1(); |
| 4291 std::string offer_sdp(kSdpWithRtx); | 4300 std::string offer_sdp(kSdpWithRtx); |
| 4292 | 4301 |
| 4293 SessionDescriptionInterface* offer = | 4302 SessionDescriptionInterface* offer = |
| 4294 CreateSessionDescription(JsepSessionDescription::kOffer, offer_sdp, NULL); | 4303 CreateSessionDescription(JsepSessionDescription::kOffer, offer_sdp, NULL); |
| 4295 EXPECT_TRUE(offer->ToString(&offer_sdp)); | 4304 EXPECT_TRUE(offer->ToString(&offer_sdp)); |
| 4296 | 4305 |
| 4297 // Offer SDP contains the RTX codec. | 4306 // Offer SDP contains the RTX codec. |
| 4298 EXPECT_TRUE(offer_sdp.find("rtx") != std::string::npos); | 4307 EXPECT_TRUE(DescriptionContainsRtxCodec(offer)); |
| 4299 SetRemoteDescriptionWithoutError(offer); | 4308 SetRemoteDescriptionWithoutError(offer); |
| 4300 | 4309 |
| 4301 SessionDescriptionInterface* answer = CreateAnswer(); | 4310 SessionDescriptionInterface* answer = CreateAnswer(); |
| 4302 std::string answer_sdp; | 4311 // Answer SDP does not contain the RTX codec. |
| 4303 answer->ToString(&answer_sdp); | 4312 EXPECT_FALSE(DescriptionContainsRtxCodec(answer)); |
| 4304 // Answer SDP removes the unsupported RTX codec. | |
| 4305 EXPECT_TRUE(answer_sdp.find("rtx") == std::string::npos); | |
| 4306 SetLocalDescriptionWithoutError(answer); | 4313 SetLocalDescriptionWithoutError(answer); |
| 4307 } | 4314 } |
| 4308 | 4315 |
| 4309 // This verifies that the voice channel after bundle has both options from video | 4316 // This verifies that the voice channel after bundle has both options from video |
| 4310 // and voice channels. | 4317 // and voice channels. |
| 4311 TEST_F(WebRtcSessionTest, TestSetSocketOptionBeforeBundle) { | 4318 TEST_F(WebRtcSessionTest, TestSetSocketOptionBeforeBundle) { |
| 4312 InitWithBundlePolicy(PeerConnectionInterface::kBundlePolicyBalanced); | 4319 InitWithBundlePolicy(PeerConnectionInterface::kBundlePolicyBalanced); |
| 4313 SendAudioVideoStream1(); | 4320 SendAudioVideoStream1(); |
| 4314 | 4321 |
| 4315 PeerConnectionInterface::RTCOfferAnswerOptions options; | 4322 PeerConnectionInterface::RTCOfferAnswerOptions options; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4396 } | 4403 } |
| 4397 | 4404 |
| 4398 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 4405 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
| 4399 // currently fails because upon disconnection and reconnection OnIceComplete is | 4406 // currently fails because upon disconnection and reconnection OnIceComplete is |
| 4400 // called more than once without returning to IceGatheringGathering. | 4407 // called more than once without returning to IceGatheringGathering. |
| 4401 | 4408 |
| 4402 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, | 4409 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, |
| 4403 WebRtcSessionTest, | 4410 WebRtcSessionTest, |
| 4404 testing::Values(ALREADY_GENERATED, | 4411 testing::Values(ALREADY_GENERATED, |
| 4405 DTLS_IDENTITY_STORE)); | 4412 DTLS_IDENTITY_STORE)); |
| OLD | NEW |