| 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 3626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3637 std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer()); | 3637 std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer()); |
| 3638 | 3638 |
| 3639 // Making sure SetLocalDescription correctly sets crypto value in | 3639 // Making sure SetLocalDescription correctly sets crypto value in |
| 3640 // SessionDescription object after de-serialization of sdp string. The value | 3640 // SessionDescription object after de-serialization of sdp string. The value |
| 3641 // will be set as per MediaSessionDescriptionFactory. | 3641 // will be set as per MediaSessionDescriptionFactory. |
| 3642 std::string offer_str; | 3642 std::string offer_str; |
| 3643 offer->ToString(&offer_str); | 3643 offer->ToString(&offer_str); |
| 3644 SessionDescriptionInterface* jsep_offer_str = | 3644 SessionDescriptionInterface* jsep_offer_str = |
| 3645 CreateSessionDescription(JsepSessionDescription::kOffer, offer_str, NULL); | 3645 CreateSessionDescription(JsepSessionDescription::kOffer, offer_str, NULL); |
| 3646 SetLocalDescriptionWithoutError(jsep_offer_str); | 3646 SetLocalDescriptionWithoutError(jsep_offer_str); |
| 3647 EXPECT_TRUE(session_->voice_channel()->secure_required()); | 3647 EXPECT_TRUE(session_->voice_channel()->srtp_required()); |
| 3648 EXPECT_TRUE(session_->video_channel()->secure_required()); | 3648 EXPECT_TRUE(session_->video_channel()->srtp_required()); |
| 3649 } | 3649 } |
| 3650 | 3650 |
| 3651 // This test verifies the crypto parameter when security is disabled. | 3651 // This test verifies the crypto parameter when security is disabled. |
| 3652 TEST_F(WebRtcSessionTest, TestCryptoAfterSetLocalDescriptionWithDisabled) { | 3652 TEST_F(WebRtcSessionTest, TestCryptoAfterSetLocalDescriptionWithDisabled) { |
| 3653 options_.disable_encryption = true; | 3653 options_.disable_encryption = true; |
| 3654 Init(); | 3654 Init(); |
| 3655 SendAudioVideoStream1(); | 3655 SendAudioVideoStream1(); |
| 3656 std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer()); | 3656 std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer()); |
| 3657 | 3657 |
| 3658 // Making sure SetLocalDescription correctly sets crypto value in | 3658 // Making sure SetLocalDescription correctly sets crypto value in |
| 3659 // SessionDescription object after de-serialization of sdp string. The value | 3659 // SessionDescription object after de-serialization of sdp string. The value |
| 3660 // will be set as per MediaSessionDescriptionFactory. | 3660 // will be set as per MediaSessionDescriptionFactory. |
| 3661 std::string offer_str; | 3661 std::string offer_str; |
| 3662 offer->ToString(&offer_str); | 3662 offer->ToString(&offer_str); |
| 3663 SessionDescriptionInterface* jsep_offer_str = | 3663 SessionDescriptionInterface* jsep_offer_str = |
| 3664 CreateSessionDescription(JsepSessionDescription::kOffer, offer_str, NULL); | 3664 CreateSessionDescription(JsepSessionDescription::kOffer, offer_str, NULL); |
| 3665 SetLocalDescriptionWithoutError(jsep_offer_str); | 3665 SetLocalDescriptionWithoutError(jsep_offer_str); |
| 3666 EXPECT_FALSE(session_->voice_channel()->secure_required()); | 3666 EXPECT_FALSE(session_->voice_channel()->srtp_required()); |
| 3667 EXPECT_FALSE(session_->video_channel()->secure_required()); | 3667 EXPECT_FALSE(session_->video_channel()->srtp_required()); |
| 3668 } | 3668 } |
| 3669 | 3669 |
| 3670 // This test verifies that an answer contains new ufrag and password if an offer | 3670 // This test verifies that an answer contains new ufrag and password if an offer |
| 3671 // with new ufrag and password is received. | 3671 // with new ufrag and password is received. |
| 3672 TEST_F(WebRtcSessionTest, TestCreateAnswerWithNewUfragAndPassword) { | 3672 TEST_F(WebRtcSessionTest, TestCreateAnswerWithNewUfragAndPassword) { |
| 3673 Init(); | 3673 Init(); |
| 3674 cricket::MediaSessionOptions options; | 3674 cricket::MediaSessionOptions options; |
| 3675 options.recv_video = true; | 3675 options.recv_video = true; |
| 3676 std::unique_ptr<JsepSessionDescription> offer(CreateRemoteOffer(options)); | 3676 std::unique_ptr<JsepSessionDescription> offer(CreateRemoteOffer(options)); |
| 3677 SetRemoteDescriptionWithoutError(offer.release()); | 3677 SetRemoteDescriptionWithoutError(offer.release()); |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4362 } | 4362 } |
| 4363 | 4363 |
| 4364 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 4364 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
| 4365 // currently fails because upon disconnection and reconnection OnIceComplete is | 4365 // currently fails because upon disconnection and reconnection OnIceComplete is |
| 4366 // called more than once without returning to IceGatheringGathering. | 4366 // called more than once without returning to IceGatheringGathering. |
| 4367 | 4367 |
| 4368 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, | 4368 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, |
| 4369 WebRtcSessionTest, | 4369 WebRtcSessionTest, |
| 4370 testing::Values(ALREADY_GENERATED, | 4370 testing::Values(ALREADY_GENERATED, |
| 4371 DTLS_IDENTITY_STORE)); | 4371 DTLS_IDENTITY_STORE)); |
| OLD | NEW |