| Index: webrtc/api/webrtcsession_unittest.cc
|
| diff --git a/webrtc/api/webrtcsession_unittest.cc b/webrtc/api/webrtcsession_unittest.cc
|
| index 4cb6cc441e381692e93777138ed4c11fa5dd431e..24e830eed9ee201a822fa39ea2224bc6a09579f7 100644
|
| --- a/webrtc/api/webrtcsession_unittest.cc
|
| +++ b/webrtc/api/webrtcsession_unittest.cc
|
| @@ -56,7 +56,6 @@
|
| using cricket::FakeVoiceMediaChannel;
|
| using cricket::TransportInfo;
|
| using rtc::SocketAddress;
|
| -using rtc::scoped_ptr;
|
| using rtc::Thread;
|
| using webrtc::CreateSessionDescription;
|
| using webrtc::CreateSessionDescriptionObserver;
|
| @@ -298,7 +297,7 @@ class WebRtcSessionCreateSDPObserverForTest
|
| ~WebRtcSessionCreateSDPObserverForTest() {}
|
|
|
| private:
|
| - rtc::scoped_ptr<SessionDescriptionInterface> description_;
|
| + std::unique_ptr<SessionDescriptionInterface> description_;
|
| State state_;
|
| };
|
|
|
| @@ -376,7 +375,7 @@ class WebRtcSessionTest
|
| // used if provided, otherwise one will be generated using the
|
| // |dtls_identity_store|.
|
| void Init(
|
| - rtc::scoped_ptr<webrtc::DtlsIdentityStoreInterface> dtls_identity_store) {
|
| + std::unique_ptr<webrtc::DtlsIdentityStoreInterface> dtls_identity_store) {
|
| ASSERT_TRUE(session_.get() == NULL);
|
| session_.reset(new WebRtcSessionForTest(
|
| media_controller_.get(), rtc::Thread::Current(), rtc::Thread::Current(),
|
| @@ -428,7 +427,7 @@ class WebRtcSessionTest
|
| // Successfully init with DTLS; with a certificate generated and supplied or
|
| // with a store that generates it for us.
|
| void InitWithDtls(RTCCertificateGenerationMethod cert_gen_method) {
|
| - rtc::scoped_ptr<FakeDtlsIdentityStore> dtls_identity_store;
|
| + std::unique_ptr<FakeDtlsIdentityStore> dtls_identity_store;
|
| if (cert_gen_method == ALREADY_GENERATED) {
|
| configuration_.certificates.push_back(
|
| FakeDtlsIdentityStore::GenerateCertificate());
|
| @@ -443,7 +442,7 @@ class WebRtcSessionTest
|
|
|
| // Init with DTLS with a store that will fail to generate a certificate.
|
| void InitWithDtlsIdentityGenFail() {
|
| - rtc::scoped_ptr<FakeDtlsIdentityStore> dtls_identity_store(
|
| + std::unique_ptr<FakeDtlsIdentityStore> dtls_identity_store(
|
| new FakeDtlsIdentityStore());
|
| dtls_identity_store->set_should_fail(true);
|
| Init(std::move(dtls_identity_store));
|
| @@ -727,12 +726,12 @@ class WebRtcSessionTest
|
| cricket::MediaSessionOptions options;
|
| options.recv_video = true;
|
| options.bundle_enabled = true;
|
| - scoped_ptr<JsepSessionDescription> offer(
|
| + std::unique_ptr<JsepSessionDescription> offer(
|
| CreateRemoteOffer(options, cricket::SEC_REQUIRED));
|
| ASSERT_TRUE(offer.get() != NULL);
|
| VerifyCryptoParams(offer->description());
|
| SetRemoteDescriptionWithoutError(offer.release());
|
| - scoped_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| ASSERT_TRUE(answer.get() != NULL);
|
| VerifyCryptoParams(answer->description());
|
| }
|
| @@ -931,7 +930,7 @@ class WebRtcSessionTest
|
| options.recv_video = true;
|
| options.bundle_enabled = true;
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> temp_offer(
|
| + std::unique_ptr<SessionDescriptionInterface> temp_offer(
|
| CreateRemoteOffer(options, cricket::SEC_ENABLED));
|
|
|
| *nodtls_answer =
|
| @@ -1070,7 +1069,7 @@ class WebRtcSessionTest
|
| // and answer.
|
| SetLocalDescriptionWithoutError(offer);
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(
|
| + std::unique_ptr<SessionDescriptionInterface> answer(
|
| CreateRemoteAnswer(session_->local_description()));
|
| std::string sdp;
|
| EXPECT_TRUE(answer->ToString(&sdp));
|
| @@ -1371,8 +1370,8 @@ class WebRtcSessionTest
|
| SetFactoryDtlsSrtp();
|
| if (type == CreateSessionDescriptionRequest::kAnswer) {
|
| cricket::MediaSessionOptions options;
|
| - scoped_ptr<JsepSessionDescription> offer(
|
| - CreateRemoteOffer(options, cricket::SEC_DISABLED));
|
| + std::unique_ptr<JsepSessionDescription> offer(
|
| + CreateRemoteOffer(options, cricket::SEC_DISABLED));
|
| ASSERT_TRUE(offer.get() != NULL);
|
| SetRemoteDescriptionWithoutError(offer.release());
|
| }
|
| @@ -1418,23 +1417,23 @@ class WebRtcSessionTest
|
|
|
| cricket::FakeMediaEngine* media_engine_;
|
| cricket::FakeDataEngine* data_engine_;
|
| - rtc::scoped_ptr<cricket::ChannelManager> channel_manager_;
|
| + std::unique_ptr<cricket::ChannelManager> channel_manager_;
|
| cricket::FakeCall fake_call_;
|
| - rtc::scoped_ptr<webrtc::MediaControllerInterface> media_controller_;
|
| - rtc::scoped_ptr<cricket::TransportDescriptionFactory> tdesc_factory_;
|
| - rtc::scoped_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_;
|
| - rtc::scoped_ptr<rtc::PhysicalSocketServer> pss_;
|
| - rtc::scoped_ptr<rtc::VirtualSocketServer> vss_;
|
| - rtc::scoped_ptr<rtc::FirewallSocketServer> fss_;
|
| + std::unique_ptr<webrtc::MediaControllerInterface> media_controller_;
|
| + std::unique_ptr<cricket::TransportDescriptionFactory> tdesc_factory_;
|
| + std::unique_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_;
|
| + std::unique_ptr<rtc::PhysicalSocketServer> pss_;
|
| + std::unique_ptr<rtc::VirtualSocketServer> vss_;
|
| + std::unique_ptr<rtc::FirewallSocketServer> fss_;
|
| rtc::SocketServerScope ss_scope_;
|
| rtc::SocketAddress stun_socket_addr_;
|
| - rtc::scoped_ptr<cricket::TestStunServer> stun_server_;
|
| + std::unique_ptr<cricket::TestStunServer> stun_server_;
|
| cricket::TestTurnServer turn_server_;
|
| rtc::FakeNetworkManager network_manager_;
|
| - rtc::scoped_ptr<cricket::BasicPortAllocator> allocator_;
|
| + std::unique_ptr<cricket::BasicPortAllocator> allocator_;
|
| PeerConnectionFactoryInterface::Options options_;
|
| PeerConnectionInterface::RTCConfiguration configuration_;
|
| - rtc::scoped_ptr<WebRtcSessionForTest> session_;
|
| + std::unique_ptr<WebRtcSessionForTest> session_;
|
| MockIceObserver observer_;
|
| cricket::FakeVideoMediaChannel* video_channel_;
|
| cricket::FakeVoiceMediaChannel* voice_channel_;
|
| @@ -1872,7 +1871,7 @@ TEST_P(WebRtcSessionTest, TestSetRemoteNonDtlsAnswerWhenDtlsOn) {
|
| SessionDescriptionInterface* offer = CreateOffer();
|
| cricket::MediaSessionOptions options;
|
| options.recv_video = true;
|
| - rtc::scoped_ptr<SessionDescriptionInterface> temp_offer(
|
| + std::unique_ptr<SessionDescriptionInterface> temp_offer(
|
| CreateRemoteOffer(options, cricket::SEC_ENABLED));
|
| JsepSessionDescription* answer =
|
| CreateRemoteAnswer(temp_offer.get(), options, cricket::SEC_ENABLED);
|
| @@ -2098,7 +2097,7 @@ TEST_F(WebRtcSessionTest, TestSetRemotePrAnswer) {
|
| TEST_F(WebRtcSessionTest, TestSetLocalAnswerWithoutOffer) {
|
| Init();
|
| SendNothing();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
|
|
| SessionDescriptionInterface* answer =
|
| CreateRemoteAnswer(offer.get());
|
| @@ -2109,7 +2108,7 @@ TEST_F(WebRtcSessionTest, TestSetLocalAnswerWithoutOffer) {
|
| TEST_F(WebRtcSessionTest, TestSetRemoteAnswerWithoutOffer) {
|
| Init();
|
| SendNothing();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
|
|
| SessionDescriptionInterface* answer =
|
| CreateRemoteAnswer(offer.get());
|
| @@ -2348,7 +2347,7 @@ TEST_F(WebRtcSessionTest, TestSetLocalAndRemoteDescriptionWithCandidates) {
|
| EXPECT_TRUE_WAIT(0u < observer_.mline_0_candidates_.size(),
|
| kIceCandidatesTimeout);
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> local_offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> local_offer(CreateOffer());
|
|
|
| ASSERT_TRUE(local_offer->candidates(kMediaContentIndex0) != NULL);
|
| EXPECT_LT(0u, local_offer->candidates(kMediaContentIndex0)->count());
|
| @@ -2366,7 +2365,7 @@ TEST_F(WebRtcSessionTest, TestSetLocalAndRemoteDescriptionWithCandidates) {
|
| TEST_F(WebRtcSessionTest, TestChannelCreationsWithContentNames) {
|
| Init();
|
| SendAudioVideoStream1();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
|
|
| // CreateOffer creates session description with the content names "audio" and
|
| // "video". Goal is to modify these content names and verify transport
|
| @@ -2415,7 +2414,7 @@ TEST_F(WebRtcSessionTest, TestChannelCreationsWithContentNames) {
|
| // the send streams when no constraints have been set.
|
| TEST_F(WebRtcSessionTest, CreateOfferWithoutConstraintsOrStreams) {
|
| Init();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
|
|
| ASSERT_TRUE(offer != NULL);
|
| const cricket::ContentInfo* content =
|
| @@ -2431,7 +2430,7 @@ TEST_F(WebRtcSessionTest, CreateOfferWithoutConstraints) {
|
| Init();
|
| // Test Audio only offer.
|
| SendAudioOnlyStream2();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
|
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(offer->description());
|
| @@ -2456,8 +2455,7 @@ TEST_F(WebRtcSessionTest, CreateOfferWithConstraintsWithoutStreams) {
|
| options.offer_to_receive_audio = 0;
|
| options.offer_to_receive_video = 0;
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(
|
| - CreateOffer(options));
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer(options));
|
|
|
| ASSERT_TRUE(offer != NULL);
|
| const cricket::ContentInfo* content =
|
| @@ -2475,8 +2473,7 @@ TEST_F(WebRtcSessionTest, CreateAudioOnlyOfferWithConstraints) {
|
| options.offer_to_receive_audio =
|
| RTCOfferAnswerOptions::kOfferToReceiveMediaTrue;
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(
|
| - CreateOffer(options));
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer(options));
|
|
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(offer->description());
|
| @@ -2496,8 +2493,7 @@ TEST_F(WebRtcSessionTest, CreateOfferWithConstraints) {
|
| options.offer_to_receive_video =
|
| RTCOfferAnswerOptions::kOfferToReceiveMediaTrue;
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(
|
| - CreateOffer(options));
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer(options));
|
|
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(offer->description());
|
| @@ -2534,9 +2530,9 @@ TEST_F(WebRtcSessionTest, CreateAnswerWithoutAnOffer) {
|
| TEST_F(WebRtcSessionTest, CreateAnswerWithoutConstraintsOrStreams) {
|
| Init();
|
| // Create a remote offer with audio and video content.
|
| - rtc::scoped_ptr<JsepSessionDescription> offer(CreateRemoteOffer());
|
| + std::unique_ptr<JsepSessionDescription> offer(CreateRemoteOffer());
|
| SetRemoteDescriptionWithoutError(offer.release());
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(answer->description());
|
| ASSERT_TRUE(content != NULL);
|
| @@ -2554,13 +2550,12 @@ TEST_F(WebRtcSessionTest, CreateAudioAnswerWithoutConstraintsOrStreams) {
|
| // Create a remote offer with audio only.
|
| cricket::MediaSessionOptions options;
|
|
|
| - rtc::scoped_ptr<JsepSessionDescription> offer(
|
| - CreateRemoteOffer(options));
|
| + std::unique_ptr<JsepSessionDescription> offer(CreateRemoteOffer(options));
|
| ASSERT_TRUE(cricket::GetFirstVideoContent(offer->description()) == NULL);
|
| ASSERT_TRUE(cricket::GetFirstAudioContent(offer->description()) != NULL);
|
|
|
| SetRemoteDescriptionWithoutError(offer.release());
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(answer->description());
|
| ASSERT_TRUE(content != NULL);
|
| @@ -2574,11 +2569,11 @@ TEST_F(WebRtcSessionTest, CreateAudioAnswerWithoutConstraintsOrStreams) {
|
| TEST_F(WebRtcSessionTest, CreateAnswerWithoutConstraints) {
|
| Init();
|
| // Create a remote offer with audio and video content.
|
| - rtc::scoped_ptr<JsepSessionDescription> offer(CreateRemoteOffer());
|
| + std::unique_ptr<JsepSessionDescription> offer(CreateRemoteOffer());
|
| SetRemoteDescriptionWithoutError(offer.release());
|
| // Test with a stream with tracks.
|
| SendAudioVideoStream1();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(answer->description());
|
| ASSERT_TRUE(content != NULL);
|
| @@ -2594,13 +2589,13 @@ TEST_F(WebRtcSessionTest, CreateAnswerWithoutConstraints) {
|
| TEST_F(WebRtcSessionTest, CreateAnswerWithConstraintsWithoutStreams) {
|
| Init();
|
| // Create a remote offer with audio and video content.
|
| - rtc::scoped_ptr<JsepSessionDescription> offer(CreateRemoteOffer());
|
| + std::unique_ptr<JsepSessionDescription> offer(CreateRemoteOffer());
|
| SetRemoteDescriptionWithoutError(offer.release());
|
|
|
| cricket::MediaSessionOptions session_options;
|
| session_options.recv_audio = false;
|
| session_options.recv_video = false;
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(
|
| + std::unique_ptr<SessionDescriptionInterface> answer(
|
| CreateAnswer(session_options));
|
|
|
| const cricket::ContentInfo* content =
|
| @@ -2618,7 +2613,7 @@ TEST_F(WebRtcSessionTest, CreateAnswerWithConstraintsWithoutStreams) {
|
| TEST_F(WebRtcSessionTest, CreateAnswerWithConstraints) {
|
| Init();
|
| // Create a remote offer with audio and video content.
|
| - rtc::scoped_ptr<JsepSessionDescription> offer(CreateRemoteOffer());
|
| + std::unique_ptr<JsepSessionDescription> offer(CreateRemoteOffer());
|
| SetRemoteDescriptionWithoutError(offer.release());
|
|
|
| cricket::MediaSessionOptions options;
|
| @@ -2627,7 +2622,7 @@ TEST_F(WebRtcSessionTest, CreateAnswerWithConstraints) {
|
|
|
| // Test with a stream with tracks.
|
| SendAudioVideoStream1();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(CreateAnswer(options));
|
| + std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer(options));
|
|
|
| // TODO(perkj): Should the direction be set to SEND_ONLY?
|
| const cricket::ContentInfo* content =
|
| @@ -2649,8 +2644,7 @@ TEST_F(WebRtcSessionTest, CreateOfferWithoutCNCodecs) {
|
| RTCOfferAnswerOptions::kOfferToReceiveMediaTrue;
|
| options.voice_activity_detection = false;
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(
|
| - CreateOffer(options));
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer(options));
|
|
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(offer->description());
|
| @@ -2662,12 +2656,12 @@ TEST_F(WebRtcSessionTest, CreateAnswerWithoutCNCodecs) {
|
| AddCNCodecs();
|
| Init();
|
| // Create a remote offer with audio and video content.
|
| - rtc::scoped_ptr<JsepSessionDescription> offer(CreateRemoteOffer());
|
| + std::unique_ptr<JsepSessionDescription> offer(CreateRemoteOffer());
|
| SetRemoteDescriptionWithoutError(offer.release());
|
|
|
| cricket::MediaSessionOptions options;
|
| options.vad_enabled = false;
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(CreateAnswer(options));
|
| + std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer(options));
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(answer->description());
|
| ASSERT_TRUE(content != NULL);
|
| @@ -2789,10 +2783,10 @@ TEST_F(WebRtcSessionTest, TestAVOfferWithVideoOnlyAnswer) {
|
| TEST_F(WebRtcSessionTest, VerifyCryptoParamsInSDP) {
|
| Init();
|
| SendAudioVideoStream1();
|
| - scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| VerifyCryptoParams(offer->description());
|
| SetRemoteDescriptionWithoutError(offer.release());
|
| - scoped_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| VerifyCryptoParams(answer->description());
|
| }
|
|
|
| @@ -2800,7 +2794,7 @@ TEST_F(WebRtcSessionTest, VerifyNoCryptoParamsInSDP) {
|
| options_.disable_encryption = true;
|
| Init();
|
| SendAudioVideoStream1();
|
| - scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| VerifyNoCryptoParams(offer->description(), false);
|
| }
|
|
|
| @@ -2819,7 +2813,7 @@ TEST_F(WebRtcSessionTest, VerifyAnswerFromCryptoOffer) {
|
| TEST_F(WebRtcSessionTest, TestSetLocalDescriptionWithoutIce) {
|
| Init();
|
| SendAudioVideoStream1();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
|
|
| std::string sdp;
|
| RemoveIceUfragPwdLines(offer.get(), &sdp);
|
| @@ -2832,7 +2826,7 @@ TEST_F(WebRtcSessionTest, TestSetLocalDescriptionWithoutIce) {
|
| // no a=ice-ufrag and a=ice-pwd lines are present in the SDP.
|
| TEST_F(WebRtcSessionTest, TestSetRemoteDescriptionWithoutIce) {
|
| Init();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateRemoteOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateRemoteOffer());
|
| std::string sdp;
|
| RemoveIceUfragPwdLines(offer.get(), &sdp);
|
| SessionDescriptionInterface* modified_offer =
|
| @@ -2845,7 +2839,7 @@ TEST_F(WebRtcSessionTest, TestSetRemoteDescriptionWithoutIce) {
|
| TEST_F(WebRtcSessionTest, TestSetLocalDescriptionInvalidIceCredentials) {
|
| Init();
|
| SendAudioVideoStream1();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| // Modifying ice ufrag and pwd in local offer with strings smaller than the
|
| // recommended values of 4 and 22 bytes respectively.
|
| SetIceUfragPwd(offer.get(), "ice", "icepwd");
|
| @@ -2862,7 +2856,7 @@ TEST_F(WebRtcSessionTest, TestSetLocalDescriptionInvalidIceCredentials) {
|
| // too short ice ufrag and pwd strings.
|
| TEST_F(WebRtcSessionTest, TestSetRemoteDescriptionInvalidIceCredentials) {
|
| Init();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateRemoteOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateRemoteOffer());
|
| // Modifying ice ufrag and pwd in remote offer with strings smaller than the
|
| // recommended values of 4 and 22 bytes respectively.
|
| SetIceUfragPwd(offer.get(), "ice", "icepwd");
|
| @@ -2880,7 +2874,7 @@ TEST_F(WebRtcSessionTest, TestSetRemoteOfferWithIceRestart) {
|
| Init();
|
|
|
| // Create the first offer.
|
| - scoped_ptr<SessionDescriptionInterface> offer(CreateRemoteOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateRemoteOffer());
|
| SetIceUfragPwd(offer.get(), "0123456789012345", "abcdefghijklmnopqrstuvwx");
|
| cricket::Candidate candidate1(1, "udp", rtc::SocketAddress("1.1.1.1", 5000),
|
| 0, "", "", "relay", 0, "");
|
| @@ -2925,7 +2919,7 @@ TEST_F(WebRtcSessionTest, TestSetRemoteAnswerWithIceRestart) {
|
| SetLocalDescriptionWithoutError(offer);
|
|
|
| // Create the first answer.
|
| - scoped_ptr<JsepSessionDescription> answer(CreateRemoteAnswer(offer));
|
| + std::unique_ptr<JsepSessionDescription> answer(CreateRemoteAnswer(offer));
|
| answer->set_type(JsepSessionDescription::kPrAnswer);
|
| SetIceUfragPwd(answer.get(), "0123456789012345", "abcdefghijklmnopqrstuvwx");
|
| cricket::Candidate candidate1(1, "udp", rtc::SocketAddress("1.1.1.1", 5000),
|
| @@ -3092,7 +3086,7 @@ TEST_F(WebRtcSessionTest, TestBalancedNoBundleInAnswer) {
|
| SendAudioVideoStream2();
|
|
|
| // Remove BUNDLE from the answer.
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(
|
| + std::unique_ptr<SessionDescriptionInterface> answer(
|
| CreateRemoteAnswer(session_->local_description()));
|
| cricket::SessionDescription* answer_copy = answer->description()->Copy();
|
| answer_copy->RemoveGroupByName(cricket::GROUP_TYPE_BUNDLE);
|
| @@ -3178,7 +3172,7 @@ TEST_F(WebRtcSessionTest, TestMaxBundleNoBundleInAnswer) {
|
| SendAudioVideoStream2();
|
|
|
| // Remove BUNDLE from the answer.
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(
|
| + std::unique_ptr<SessionDescriptionInterface> answer(
|
| CreateRemoteAnswer(session_->local_description()));
|
| cricket::SessionDescription* answer_copy = answer->description()->Copy();
|
| answer_copy->RemoveGroupByName(cricket::GROUP_TYPE_BUNDLE);
|
| @@ -3216,7 +3210,7 @@ TEST_F(WebRtcSessionTest, TestMaxBundleNoBundleInRemoteOffer) {
|
| SendAudioVideoStream1();
|
|
|
| // Remove BUNDLE from the offer.
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateRemoteOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateRemoteOffer());
|
| cricket::SessionDescription* offer_copy = offer->description()->Copy();
|
| offer_copy->RemoveGroupByName(cricket::GROUP_TYPE_BUNDLE);
|
| JsepSessionDescription* modified_offer =
|
| @@ -3269,7 +3263,7 @@ TEST_F(WebRtcSessionTest, TestMaxCompatNoBundleInAnswer) {
|
| SendAudioVideoStream2();
|
|
|
| // Remove BUNDLE from the answer.
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(
|
| + std::unique_ptr<SessionDescriptionInterface> answer(
|
| CreateRemoteAnswer(session_->local_description()));
|
| cricket::SessionDescription* answer_copy = answer->description()->Copy();
|
| answer_copy->RemoveGroupByName(cricket::GROUP_TYPE_BUNDLE);
|
| @@ -3427,7 +3421,7 @@ TEST_F(WebRtcSessionTest, SetAudioSend) {
|
| cricket::AudioOptions options;
|
| options.echo_cancellation = rtc::Optional<bool>(true);
|
|
|
| - rtc::scoped_ptr<FakeAudioSource> source(new FakeAudioSource());
|
| + std::unique_ptr<FakeAudioSource> source(new FakeAudioSource());
|
| session_->SetAudioSend(send_ssrc, false, options, source.get());
|
| EXPECT_TRUE(channel->IsStreamMuted(send_ssrc));
|
| EXPECT_EQ(rtc::Optional<bool>(), channel->options().echo_cancellation);
|
| @@ -3449,7 +3443,7 @@ TEST_F(WebRtcSessionTest, AudioSourceForLocalStream) {
|
| ASSERT_EQ(1u, channel->send_streams().size());
|
| uint32_t send_ssrc = channel->send_streams()[0].first_ssrc();
|
|
|
| - rtc::scoped_ptr<FakeAudioSource> source(new FakeAudioSource());
|
| + std::unique_ptr<FakeAudioSource> source(new FakeAudioSource());
|
| cricket::AudioOptions options;
|
| session_->SetAudioSend(send_ssrc, true, options, source.get());
|
| EXPECT_TRUE(source->sink() != nullptr);
|
| @@ -3589,7 +3583,7 @@ TEST_F(WebRtcSessionTest, TestIncorrectMLinesInRemoteAnswer) {
|
| SendAudioVideoStream1();
|
| SessionDescriptionInterface* offer = CreateOffer();
|
| SetLocalDescriptionWithoutError(offer);
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(
|
| + std::unique_ptr<SessionDescriptionInterface> answer(
|
| CreateRemoteAnswer(session_->local_description()));
|
|
|
| cricket::SessionDescription* answer_copy = answer->description()->Copy();
|
| @@ -3686,7 +3680,7 @@ TEST_F(WebRtcSessionTest, TestIceStartAfterSetLocalDescriptionOnly) {
|
| TEST_F(WebRtcSessionTest, TestCryptoAfterSetLocalDescription) {
|
| Init();
|
| SendAudioVideoStream1();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
|
|
| // Making sure SetLocalDescription correctly sets crypto value in
|
| // SessionDescription object after de-serialization of sdp string. The value
|
| @@ -3705,7 +3699,7 @@ TEST_F(WebRtcSessionTest, TestCryptoAfterSetLocalDescriptionWithDisabled) {
|
| options_.disable_encryption = true;
|
| Init();
|
| SendAudioVideoStream1();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
|
|
| // Making sure SetLocalDescription correctly sets crypto value in
|
| // SessionDescription object after de-serialization of sdp string. The value
|
| @@ -3725,12 +3719,11 @@ TEST_F(WebRtcSessionTest, TestCreateAnswerWithNewUfragAndPassword) {
|
| Init();
|
| cricket::MediaSessionOptions options;
|
| options.recv_video = true;
|
| - rtc::scoped_ptr<JsepSessionDescription> offer(
|
| - CreateRemoteOffer(options));
|
| + std::unique_ptr<JsepSessionDescription> offer(CreateRemoteOffer(options));
|
| SetRemoteDescriptionWithoutError(offer.release());
|
|
|
| SendAudioVideoStream1();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| SetLocalDescriptionWithoutError(answer.release());
|
|
|
| // Receive an offer with new ufrag and password.
|
| @@ -3738,18 +3731,18 @@ TEST_F(WebRtcSessionTest, TestCreateAnswerWithNewUfragAndPassword) {
|
| session_->local_description()->description()->contents()) {
|
| options.transport_options[content.name].ice_restart = true;
|
| }
|
| - rtc::scoped_ptr<JsepSessionDescription> updated_offer1(
|
| + std::unique_ptr<JsepSessionDescription> updated_offer1(
|
| CreateRemoteOffer(options, session_->remote_description()));
|
| SetRemoteDescriptionWithoutError(updated_offer1.release());
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> updated_answer1(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> updated_answer1(CreateAnswer());
|
|
|
| EXPECT_FALSE(IceUfragPwdEqual(updated_answer1->description(),
|
| session_->local_description()->description()));
|
|
|
| // Even a second answer (created before the description is set) should have
|
| // a new ufrag/password.
|
| - rtc::scoped_ptr<SessionDescriptionInterface> updated_answer2(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> updated_answer2(CreateAnswer());
|
|
|
| EXPECT_FALSE(IceUfragPwdEqual(updated_answer2->description(),
|
| session_->local_description()->description()));
|
| @@ -3768,34 +3761,34 @@ TEST_F(WebRtcSessionTest, TestOfferChangingOnlyUfragOrPassword) {
|
| options.recv_audio = true;
|
| options.recv_video = true;
|
| // Create an offer with audio and video.
|
| - rtc::scoped_ptr<JsepSessionDescription> offer(CreateRemoteOffer(options));
|
| + std::unique_ptr<JsepSessionDescription> offer(CreateRemoteOffer(options));
|
| SetIceUfragPwd(offer.get(), "original_ufrag", "original_password12345");
|
| SetRemoteDescriptionWithoutError(offer.release());
|
|
|
| SendAudioVideoStream1();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| SetLocalDescriptionWithoutError(answer.release());
|
|
|
| // Receive an offer with a new ufrag but stale password.
|
| - rtc::scoped_ptr<JsepSessionDescription> ufrag_changed_offer(
|
| + std::unique_ptr<JsepSessionDescription> ufrag_changed_offer(
|
| CreateRemoteOffer(options, session_->remote_description()));
|
| SetIceUfragPwd(ufrag_changed_offer.get(), "modified_ufrag",
|
| "original_password12345");
|
| SetRemoteDescriptionWithoutError(ufrag_changed_offer.release());
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> updated_answer1(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> updated_answer1(CreateAnswer());
|
| EXPECT_FALSE(IceUfragPwdEqual(updated_answer1->description(),
|
| session_->local_description()->description()));
|
| SetLocalDescriptionWithoutError(updated_answer1.release());
|
|
|
| // Receive an offer with a new password but stale ufrag.
|
| - rtc::scoped_ptr<JsepSessionDescription> password_changed_offer(
|
| + std::unique_ptr<JsepSessionDescription> password_changed_offer(
|
| CreateRemoteOffer(options, session_->remote_description()));
|
| SetIceUfragPwd(password_changed_offer.get(), "modified_ufrag",
|
| "modified_password12345");
|
| SetRemoteDescriptionWithoutError(password_changed_offer.release());
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> updated_answer2(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> updated_answer2(CreateAnswer());
|
| EXPECT_FALSE(IceUfragPwdEqual(updated_answer2->description(),
|
| session_->local_description()->description()));
|
| SetLocalDescriptionWithoutError(updated_answer2.release());
|
| @@ -3807,20 +3800,19 @@ TEST_F(WebRtcSessionTest, TestCreateAnswerWithOldUfragAndPassword) {
|
| Init();
|
| cricket::MediaSessionOptions options;
|
| options.recv_video = true;
|
| - rtc::scoped_ptr<JsepSessionDescription> offer(
|
| - CreateRemoteOffer(options));
|
| + std::unique_ptr<JsepSessionDescription> offer(CreateRemoteOffer(options));
|
| SetRemoteDescriptionWithoutError(offer.release());
|
|
|
| SendAudioVideoStream1();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| SetLocalDescriptionWithoutError(answer.release());
|
|
|
| // Receive an offer without changed ufrag or password.
|
| - rtc::scoped_ptr<JsepSessionDescription> updated_offer2(
|
| + std::unique_ptr<JsepSessionDescription> updated_offer2(
|
| CreateRemoteOffer(options, session_->remote_description()));
|
| SetRemoteDescriptionWithoutError(updated_offer2.release());
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> updated_answer2(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> updated_answer2(CreateAnswer());
|
|
|
| EXPECT_TRUE(IceUfragPwdEqual(updated_answer2->description(),
|
| session_->local_description()->description()));
|
| @@ -3837,7 +3829,7 @@ TEST_F(WebRtcSessionTest, TestCreateAnswerWithNewAndOldUfragAndPassword) {
|
| options.recv_video = true;
|
| options.recv_audio = true;
|
| options.bundle_enabled = false;
|
| - rtc::scoped_ptr<JsepSessionDescription> offer(CreateRemoteOffer(options));
|
| + std::unique_ptr<JsepSessionDescription> offer(CreateRemoteOffer(options));
|
|
|
| SetIceUfragPwd(offer.get(), cricket::MEDIA_TYPE_AUDIO, "aaaa",
|
| "aaaaaaaaaaaaaaaaaaaaaa");
|
| @@ -3846,18 +3838,18 @@ TEST_F(WebRtcSessionTest, TestCreateAnswerWithNewAndOldUfragAndPassword) {
|
| SetRemoteDescriptionWithoutError(offer.release());
|
|
|
| SendAudioVideoStream1();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| SetLocalDescriptionWithoutError(answer.release());
|
|
|
| // Receive an offer with new ufrag and password, but only for the video media
|
| // section.
|
| - rtc::scoped_ptr<JsepSessionDescription> updated_offer(
|
| + std::unique_ptr<JsepSessionDescription> updated_offer(
|
| CreateRemoteOffer(options, session_->remote_description()));
|
| SetIceUfragPwd(updated_offer.get(), cricket::MEDIA_TYPE_VIDEO, "cccc",
|
| "cccccccccccccccccccccc");
|
| SetRemoteDescriptionWithoutError(updated_offer.release());
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> updated_answer(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> updated_answer(CreateAnswer());
|
|
|
| EXPECT_TRUE(IceUfragPwdEqual(updated_answer->description(),
|
| session_->local_description()->description(),
|
| @@ -3950,7 +3942,7 @@ TEST_P(WebRtcSessionTest, TestCreateOfferWithSctpEnabledWithoutStreams) {
|
|
|
| InitWithDtls(GetParam());
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| EXPECT_TRUE(offer->description()->GetContentByName("data") == NULL);
|
| EXPECT_TRUE(offer->description()->GetTransportInfoByName("data") == NULL);
|
| }
|
| @@ -3968,7 +3960,7 @@ TEST_P(WebRtcSessionTest, TestCreateAnswerWithSctpInOfferAndNoStreams) {
|
| SetRemoteDescriptionWithoutError(offer);
|
|
|
| // Verifies the answer contains SCTP.
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| EXPECT_TRUE(answer != NULL);
|
| EXPECT_TRUE(answer->description()->GetContentByName("data") != NULL);
|
| EXPECT_TRUE(answer->description()->GetTransportInfoByName("data") != NULL);
|
| @@ -4100,7 +4092,7 @@ TEST_P(WebRtcSessionTest, TestCreateOfferBeforeIdentityRequestReturnSuccess) {
|
|
|
| EXPECT_TRUE(session_->waiting_for_certificate_for_testing());
|
| SendAudioVideoStream1();
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
|
|
| EXPECT_TRUE(offer != NULL);
|
| VerifyNoCryptoParams(offer->description(), true);
|
| @@ -4117,12 +4109,12 @@ TEST_P(WebRtcSessionTest, TestCreateAnswerBeforeIdentityRequestReturnSuccess) {
|
|
|
| cricket::MediaSessionOptions options;
|
| options.recv_video = true;
|
| - scoped_ptr<JsepSessionDescription> offer(
|
| - CreateRemoteOffer(options, cricket::SEC_DISABLED));
|
| + std::unique_ptr<JsepSessionDescription> offer(
|
| + CreateRemoteOffer(options, cricket::SEC_DISABLED));
|
| ASSERT_TRUE(offer.get() != NULL);
|
| SetRemoteDescriptionWithoutError(offer.release());
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| + std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| EXPECT_TRUE(answer != NULL);
|
| VerifyNoCryptoParams(answer->description(), true);
|
| VerifyFingerprintStatus(answer->description(), true);
|
| @@ -4137,7 +4129,7 @@ TEST_P(WebRtcSessionTest, TestCreateOfferAfterIdentityRequestReturnSuccess) {
|
|
|
| EXPECT_TRUE_WAIT(!session_->waiting_for_certificate_for_testing(), 1000);
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| EXPECT_TRUE(offer != NULL);
|
| }
|
|
|
| @@ -4149,7 +4141,7 @@ TEST_F(WebRtcSessionTest, TestCreateOfferAfterIdentityRequestReturnFailure) {
|
|
|
| EXPECT_TRUE_WAIT(!session_->waiting_for_certificate_for_testing(), 1000);
|
|
|
| - rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| + std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| EXPECT_TRUE(offer == NULL);
|
| }
|
|
|
|
|