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 4266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4277 candidate1.set_address(rtc::SocketAddress("1.1.1.1", 5000)); | 4277 candidate1.set_address(rtc::SocketAddress("1.1.1.1", 5000)); |
4278 candidate1.set_component(1); | 4278 candidate1.set_component(1); |
4279 JsepIceCandidate ice_candidate(kMediaContentName1, kMediaContentIndex1, | 4279 JsepIceCandidate ice_candidate(kMediaContentName1, kMediaContentIndex1, |
4280 candidate1); | 4280 candidate1); |
4281 EXPECT_TRUE(session_->ProcessIceMessage(&ice_candidate)); | 4281 EXPECT_TRUE(session_->ProcessIceMessage(&ice_candidate)); |
4282 | 4282 |
4283 answer = CreateAnswer(); | 4283 answer = CreateAnswer(); |
4284 SetLocalDescriptionWithoutError(answer); | 4284 SetLocalDescriptionWithoutError(answer); |
4285 } | 4285 } |
4286 | 4286 |
4287 // Flaky on Win and Mac only. See webrtc:4943 | |
4288 #if defined(WEBRTC_WIN) || defined(WEBRTC_MAC) | |
4289 #define MAYBE_TestRtxRemovedByCreateAnswer DISABLED_TestRtxRemovedByCreateAnswer | |
4290 #else | |
4291 #define MAYBE_TestRtxRemovedByCreateAnswer TestRtxRemovedByCreateAnswer | |
4292 #endif | |
4293 // Tests that RTX codec is removed from the answer when it isn't supported | 4287 // Tests that RTX codec is removed from the answer when it isn't supported |
4294 // by local side. | 4288 // by local side. |
4295 TEST_F(WebRtcSessionTest, MAYBE_TestRtxRemovedByCreateAnswer) { | 4289 TEST_F(WebRtcSessionTest, TestRtxRemovedByCreateAnswer) { |
4296 Init(); | 4290 Init(); |
4297 SendAudioVideoStream1(); | 4291 SendAudioVideoStream1(); |
4298 std::string offer_sdp(kSdpWithRtx); | 4292 std::string offer_sdp(kSdpWithRtx); |
4299 | 4293 |
4300 SessionDescriptionInterface* offer = | 4294 SessionDescriptionInterface* offer = |
4301 CreateSessionDescription(JsepSessionDescription::kOffer, offer_sdp, NULL); | 4295 CreateSessionDescription(JsepSessionDescription::kOffer, offer_sdp, NULL); |
4302 EXPECT_TRUE(offer->ToString(&offer_sdp)); | 4296 EXPECT_TRUE(offer->ToString(&offer_sdp)); |
4303 | 4297 |
4304 // Offer SDP contains the RTX codec. | 4298 // Offer SDP contains the RTX codec. |
4305 EXPECT_TRUE(offer_sdp.find("rtx") != std::string::npos); | 4299 EXPECT_TRUE(offer_sdp.find("rtx") != std::string::npos); |
Taylor Brandstetter
2016/04/23 00:05:14
We might as well use the same technique here to ch
Zhi Huang
2016/04/23 00:51:57
Done.
Zhi Huang
2016/04/23 00:51:57
Acknowledged.
| |
4306 SetRemoteDescriptionWithoutError(offer); | 4300 SetRemoteDescriptionWithoutError(offer); |
4307 | 4301 |
4308 SessionDescriptionInterface* answer = CreateAnswer(); | 4302 SessionDescriptionInterface* answer = CreateAnswer(); |
4309 std::string answer_sdp; | |
4310 answer->ToString(&answer_sdp); | |
4311 // Answer SDP removes the unsupported RTX codec. | |
4312 EXPECT_TRUE(answer_sdp.find("rtx") == std::string::npos); | |
4313 SetLocalDescriptionWithoutError(answer); | 4303 SetLocalDescriptionWithoutError(answer); |
4304 | |
4305 for (const auto& content : answer->description()->contents()) { | |
4306 if (static_cast<cricket::MediaContentDescription*>(content.description) | |
4307 ->type() == cricket::MEDIA_TYPE_VIDEO) { | |
4308 const auto* mdesc = | |
4309 static_cast<cricket::VideoContentDescription*>(content.description); | |
4310 for (auto iter = mdesc->codecs().begin(); iter != mdesc->codecs().end(); | |
Taylor Brandstetter
2016/04/23 00:05:14
nit: We can use C++11 range-based for loops in new
Zhi Huang
2016/04/23 00:51:57
Done.
| |
4311 iter++) { | |
4312 EXPECT_TRUE(iter->ToString().find("rtx") == std::string::npos); | |
Taylor Brandstetter
2016/04/23 00:05:14
I think you can just check that the codec's name i
Zhi Huang
2016/04/23 00:51:57
Acknowledged.
| |
4313 } | |
4314 } | |
4315 } | |
4314 } | 4316 } |
4315 | 4317 |
4316 // This verifies that the voice channel after bundle has both options from video | 4318 // This verifies that the voice channel after bundle has both options from video |
4317 // and voice channels. | 4319 // and voice channels. |
4318 TEST_F(WebRtcSessionTest, TestSetSocketOptionBeforeBundle) { | 4320 TEST_F(WebRtcSessionTest, TestSetSocketOptionBeforeBundle) { |
4319 InitWithBundlePolicy(PeerConnectionInterface::kBundlePolicyBalanced); | 4321 InitWithBundlePolicy(PeerConnectionInterface::kBundlePolicyBalanced); |
4320 SendAudioVideoStream1(); | 4322 SendAudioVideoStream1(); |
4321 | 4323 |
4322 PeerConnectionInterface::RTCOfferAnswerOptions options; | 4324 PeerConnectionInterface::RTCOfferAnswerOptions options; |
4323 options.use_rtp_mux = true; | 4325 options.use_rtp_mux = true; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4403 } | 4405 } |
4404 | 4406 |
4405 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 4407 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
4406 // currently fails because upon disconnection and reconnection OnIceComplete is | 4408 // currently fails because upon disconnection and reconnection OnIceComplete is |
4407 // called more than once without returning to IceGatheringGathering. | 4409 // called more than once without returning to IceGatheringGathering. |
4408 | 4410 |
4409 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, | 4411 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, |
4410 WebRtcSessionTest, | 4412 WebRtcSessionTest, |
4411 testing::Values(ALREADY_GENERATED, | 4413 testing::Values(ALREADY_GENERATED, |
4412 DTLS_IDENTITY_STORE)); | 4414 DTLS_IDENTITY_STORE)); |
OLD | NEW |