| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 | 538 |
| 539 content = cricket::GetFirstVideoContent(sdp); | 539 content = cricket::GetFirstVideoContent(sdp); |
| 540 ASSERT_TRUE(content != NULL); | 540 ASSERT_TRUE(content != NULL); |
| 541 const cricket::VideoContentDescription* video_content = | 541 const cricket::VideoContentDescription* video_content = |
| 542 static_cast<const cricket::VideoContentDescription*>( | 542 static_cast<const cricket::VideoContentDescription*>( |
| 543 content->description); | 543 content->description); |
| 544 ASSERT_TRUE(video_content != NULL); | 544 ASSERT_TRUE(video_content != NULL); |
| 545 ASSERT_EQ(0U, video_content->cryptos().size()); | 545 ASSERT_EQ(0U, video_content->cryptos().size()); |
| 546 | 546 |
| 547 if (dtls) { | 547 if (dtls) { |
| 548 EXPECT_EQ(std::string(cricket::kMediaProtocolSavpf), | 548 EXPECT_EQ(std::string(cricket::kMediaProtocolDtlsSavpf), |
| 549 audio_content->protocol()); | 549 audio_content->protocol()); |
| 550 EXPECT_EQ(std::string(cricket::kMediaProtocolSavpf), | 550 EXPECT_EQ(std::string(cricket::kMediaProtocolDtlsSavpf), |
| 551 video_content->protocol()); | 551 video_content->protocol()); |
| 552 } else { | 552 } else { |
| 553 EXPECT_EQ(std::string(cricket::kMediaProtocolAvpf), | 553 EXPECT_EQ(std::string(cricket::kMediaProtocolAvpf), |
| 554 audio_content->protocol()); | 554 audio_content->protocol()); |
| 555 EXPECT_EQ(std::string(cricket::kMediaProtocolAvpf), | 555 EXPECT_EQ(std::string(cricket::kMediaProtocolAvpf), |
| 556 video_content->protocol()); | 556 video_content->protocol()); |
| 557 } | 557 } |
| 558 } | 558 } |
| 559 | 559 |
| 560 // Set the internal fake description factories to do DTLS-SRTP. | 560 // Set the internal fake description factories to do DTLS-SRTP. |
| (...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1685 // the offer and answer. | 1685 // the offer and answer. |
| 1686 SetRemoteDescriptionWithoutError(offer); | 1686 SetRemoteDescriptionWithoutError(offer); |
| 1687 SetLocalDescriptionAnswerExpectError( | 1687 SetLocalDescriptionAnswerExpectError( |
| 1688 kSdpWithoutDtlsFingerprint, answer); | 1688 kSdpWithoutDtlsFingerprint, answer); |
| 1689 } | 1689 } |
| 1690 | 1690 |
| 1691 // Test that we return a failure when applying a remote answer that doesn't have | 1691 // Test that we return a failure when applying a remote answer that doesn't have |
| 1692 // a DTLS fingerprint when DTLS is required. | 1692 // a DTLS fingerprint when DTLS is required. |
| 1693 TEST_F(WebRtcSessionTest, TestSetRemoteNonDtlsAnswerWhenDtlsOn) { | 1693 TEST_F(WebRtcSessionTest, TestSetRemoteNonDtlsAnswerWhenDtlsOn) { |
| 1694 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); | 1694 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); |
| 1695 // Enable both SDES and DTLS, so that offer won't be outright rejected as a |
| 1696 // result of using the "UDP/TLS/RTP/SAVPF" profile. |
| 1695 InitWithDtls(); | 1697 InitWithDtls(); |
| 1698 session_->SetSdesPolicy(cricket::SEC_ENABLED); |
| 1696 SessionDescriptionInterface* offer = CreateOffer(); | 1699 SessionDescriptionInterface* offer = CreateOffer(); |
| 1697 cricket::MediaSessionOptions options; | 1700 cricket::MediaSessionOptions options; |
| 1698 options.recv_video = true; | 1701 options.recv_video = true; |
| 1699 JsepSessionDescription* answer = | 1702 JsepSessionDescription* answer = |
| 1700 CreateRemoteAnswer(offer, options, cricket::SEC_ENABLED); | 1703 CreateRemoteAnswer(offer, options, cricket::SEC_ENABLED); |
| 1701 | 1704 |
| 1702 // SetRemoteDescription and SetLocalDescription will take the ownership of | 1705 // SetRemoteDescription and SetLocalDescription will take the ownership of |
| 1703 // the offer and answer. | 1706 // the offer and answer. |
| 1704 SetLocalDescriptionWithoutError(offer); | 1707 SetLocalDescriptionWithoutError(offer); |
| 1705 SetRemoteDescriptionAnswerExpectError( | 1708 SetRemoteDescriptionAnswerExpectError( |
| (...skipping 2168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3874 EXPECT_EQ(4000, option_val); | 3877 EXPECT_EQ(4000, option_val); |
| 3875 | 3878 |
| 3876 EXPECT_TRUE(session_->voice_channel()->transport_channel()->GetOption( | 3879 EXPECT_TRUE(session_->voice_channel()->transport_channel()->GetOption( |
| 3877 rtc::Socket::Option::OPT_RCVBUF, &option_val)); | 3880 rtc::Socket::Option::OPT_RCVBUF, &option_val)); |
| 3878 EXPECT_EQ(8000, option_val); | 3881 EXPECT_EQ(8000, option_val); |
| 3879 } | 3882 } |
| 3880 | 3883 |
| 3881 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 3884 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
| 3882 // currently fails because upon disconnection and reconnection OnIceComplete is | 3885 // currently fails because upon disconnection and reconnection OnIceComplete is |
| 3883 // called more than once without returning to IceGatheringGathering. | 3886 // called more than once without returning to IceGatheringGathering. |
| OLD | NEW |