| Index: webrtc/pc/webrtcsession_unittest.cc
|
| diff --git a/webrtc/pc/webrtcsession_unittest.cc b/webrtc/pc/webrtcsession_unittest.cc
|
| index e9017d429c94b51524c5292cd7176d5bbaebf149..357735f87a9a3ce39faa54d1cff14461be964dd9 100644
|
| --- a/webrtc/pc/webrtcsession_unittest.cc
|
| +++ b/webrtc/pc/webrtcsession_unittest.cc
|
| @@ -346,7 +346,7 @@ class WebRtcSessionCreateSDPObserverForTest
|
|
|
| class FakeAudioSource : public cricket::AudioSource {
|
| public:
|
| - FakeAudioSource() : sink_(NULL) {}
|
| + FakeAudioSource() : sink_(nullptr) {}
|
| virtual ~FakeAudioSource() {
|
| if (sink_)
|
| sink_->OnClose();
|
| @@ -419,7 +419,7 @@ class WebRtcSessionTest
|
| void Init(
|
| std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
|
| PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy) {
|
| - ASSERT_TRUE(session_.get() == NULL);
|
| + ASSERT_TRUE(session_.get() == nullptr);
|
| fake_sctp_transport_factory_ = new FakeSctpTransportFactory();
|
| session_.reset(new WebRtcSessionForTest(
|
| media_controller_.get(), rtc::Thread::Current(), rtc::Thread::Current(),
|
| @@ -677,19 +677,19 @@ class WebRtcSessionTest
|
| }
|
|
|
| bool ChannelsExist() const {
|
| - return (session_->voice_channel() != NULL &&
|
| - session_->video_channel() != NULL);
|
| + return (session_->voice_channel() != nullptr &&
|
| + session_->video_channel() != nullptr);
|
| }
|
|
|
| void VerifyCryptoParams(const cricket::SessionDescription* sdp,
|
| bool gcm_enabled = false) {
|
| - ASSERT_TRUE(session_.get() != NULL);
|
| + ASSERT_TRUE(session_.get() != nullptr);
|
| const cricket::ContentInfo* content = cricket::GetFirstAudioContent(sdp);
|
| - ASSERT_TRUE(content != NULL);
|
| + ASSERT_TRUE(content != nullptr);
|
| const cricket::AudioContentDescription* audio_content =
|
| static_cast<const cricket::AudioContentDescription*>(
|
| content->description);
|
| - ASSERT_TRUE(audio_content != NULL);
|
| + ASSERT_TRUE(audio_content != nullptr);
|
| if (!gcm_enabled) {
|
| ASSERT_EQ(1U, audio_content->cryptos().size());
|
| ASSERT_EQ(47U, audio_content->cryptos()[0].key_params.size());
|
| @@ -710,11 +710,11 @@ class WebRtcSessionTest
|
| }
|
|
|
| content = cricket::GetFirstVideoContent(sdp);
|
| - ASSERT_TRUE(content != NULL);
|
| + ASSERT_TRUE(content != nullptr);
|
| const cricket::VideoContentDescription* video_content =
|
| static_cast<const cricket::VideoContentDescription*>(
|
| content->description);
|
| - ASSERT_TRUE(video_content != NULL);
|
| + ASSERT_TRUE(video_content != nullptr);
|
| if (!gcm_enabled) {
|
| ASSERT_EQ(1U, video_content->cryptos().size());
|
| ASSERT_EQ("AES_CM_128_HMAC_SHA1_80",
|
| @@ -737,19 +737,19 @@ class WebRtcSessionTest
|
|
|
| void VerifyNoCryptoParams(const cricket::SessionDescription* sdp, bool dtls) {
|
| const cricket::ContentInfo* content = cricket::GetFirstAudioContent(sdp);
|
| - ASSERT_TRUE(content != NULL);
|
| + ASSERT_TRUE(content != nullptr);
|
| const cricket::AudioContentDescription* audio_content =
|
| static_cast<const cricket::AudioContentDescription*>(
|
| content->description);
|
| - ASSERT_TRUE(audio_content != NULL);
|
| + ASSERT_TRUE(audio_content != nullptr);
|
| ASSERT_EQ(0U, audio_content->cryptos().size());
|
|
|
| content = cricket::GetFirstVideoContent(sdp);
|
| - ASSERT_TRUE(content != NULL);
|
| + ASSERT_TRUE(content != nullptr);
|
| const cricket::VideoContentDescription* video_content =
|
| static_cast<const cricket::VideoContentDescription*>(
|
| content->description);
|
| - ASSERT_TRUE(video_content != NULL);
|
| + ASSERT_TRUE(video_content != nullptr);
|
| ASSERT_EQ(0U, video_content->cryptos().size());
|
|
|
| if (dtls) {
|
| @@ -780,11 +780,13 @@ class WebRtcSessionTest
|
| void VerifyFingerprintStatus(const cricket::SessionDescription* sdp,
|
| bool expected) {
|
| const TransportInfo* audio = sdp->GetTransportInfoByName("audio");
|
| - ASSERT_TRUE(audio != NULL);
|
| - ASSERT_EQ(expected, audio->description.identity_fingerprint.get() != NULL);
|
| + ASSERT_TRUE(audio != nullptr);
|
| + ASSERT_EQ(expected,
|
| + audio->description.identity_fingerprint.get() != nullptr);
|
| const TransportInfo* video = sdp->GetTransportInfoByName("video");
|
| - ASSERT_TRUE(video != NULL);
|
| - ASSERT_EQ(expected, video->description.identity_fingerprint.get() != NULL);
|
| + ASSERT_TRUE(video != nullptr);
|
| + ASSERT_EQ(expected,
|
| + video->description.identity_fingerprint.get() != nullptr);
|
| }
|
|
|
| void VerifyAnswerFromNonCryptoOffer() {
|
| @@ -793,13 +795,13 @@ class WebRtcSessionTest
|
| options.recv_video = true;
|
| JsepSessionDescription* offer(
|
| CreateRemoteOffer(options, cricket::SEC_DISABLED));
|
| - ASSERT_TRUE(offer != NULL);
|
| + ASSERT_TRUE(offer != nullptr);
|
| VerifyNoCryptoParams(offer->description(), false);
|
| SetRemoteDescriptionOfferExpectError(kSdpWithoutSdesCrypto,
|
| offer);
|
| const webrtc::SessionDescriptionInterface* answer = CreateAnswer();
|
| - // Answer should be NULL as no crypto params in offer.
|
| - ASSERT_TRUE(answer == NULL);
|
| + // Answer should be null as no crypto params in offer.
|
| + ASSERT_TRUE(answer == nullptr);
|
| }
|
|
|
| void VerifyAnswerFromCryptoOffer() {
|
| @@ -808,11 +810,11 @@ class WebRtcSessionTest
|
| options.bundle_enabled = true;
|
| std::unique_ptr<JsepSessionDescription> offer(
|
| CreateRemoteOffer(options, cricket::SEC_REQUIRED));
|
| - ASSERT_TRUE(offer.get() != NULL);
|
| + ASSERT_TRUE(offer.get() != nullptr);
|
| VerifyCryptoParams(offer->description());
|
| SetRemoteDescriptionWithoutError(offer.release());
|
| std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| - ASSERT_TRUE(answer.get() != NULL);
|
| + ASSERT_TRUE(answer.get() != nullptr);
|
| VerifyCryptoParams(answer->description());
|
| }
|
|
|
| @@ -927,7 +929,7 @@ class WebRtcSessionTest
|
| SetLocalDescriptionWithoutError(answer);
|
| }
|
| void SetLocalDescriptionWithoutError(SessionDescriptionInterface* desc) {
|
| - EXPECT_TRUE(session_->SetLocalDescription(desc, NULL));
|
| + EXPECT_TRUE(session_->SetLocalDescription(desc, nullptr));
|
| session_->MaybeStartGathering();
|
| }
|
| void SetLocalDescriptionExpectState(SessionDescriptionInterface* desc,
|
| @@ -956,7 +958,7 @@ class WebRtcSessionTest
|
| expected_error, desc);
|
| }
|
| void SetRemoteDescriptionWithoutError(SessionDescriptionInterface* desc) {
|
| - EXPECT_TRUE(session_->SetRemoteDescription(desc, NULL));
|
| + EXPECT_TRUE(session_->SetRemoteDescription(desc, nullptr));
|
| }
|
| void SetRemoteDescriptionExpectState(SessionDescriptionInterface* desc,
|
| WebRtcSession::State expected_state) {
|
| @@ -996,12 +998,12 @@ class WebRtcSessionTest
|
| options.recv_video = true;
|
| options.bundle_enabled = true;
|
| *offer = CreateRemoteOffer(options, cricket::SEC_ENABLED);
|
| - ASSERT_TRUE(*offer != NULL);
|
| + ASSERT_TRUE(*offer != nullptr);
|
| VerifyCryptoParams((*offer)->description());
|
|
|
| *nocrypto_answer = CreateRemoteAnswer(*offer, options,
|
| cricket::SEC_DISABLED);
|
| - EXPECT_TRUE(*nocrypto_answer != NULL);
|
| + EXPECT_TRUE(*nocrypto_answer != nullptr);
|
| }
|
|
|
| void CreateDtlsOfferAndNonDtlsAnswer(SessionDescriptionInterface** offer,
|
| @@ -1015,13 +1017,13 @@ class WebRtcSessionTest
|
|
|
| *nodtls_answer =
|
| CreateRemoteAnswer(temp_offer.get(), options, cricket::SEC_ENABLED);
|
| - EXPECT_TRUE(*nodtls_answer != NULL);
|
| + EXPECT_TRUE(*nodtls_answer != nullptr);
|
| VerifyFingerprintStatus((*nodtls_answer)->description(), false);
|
| VerifyCryptoParams((*nodtls_answer)->description());
|
|
|
| SetFactoryDtlsSrtp();
|
| *offer = CreateRemoteOffer(options, cricket::SEC_ENABLED);
|
| - ASSERT_TRUE(*offer != NULL);
|
| + ASSERT_TRUE(*offer != nullptr);
|
| VerifyFingerprintStatus((*offer)->description(), true);
|
| VerifyCryptoParams((*offer)->description());
|
| }
|
| @@ -1032,7 +1034,7 @@ class WebRtcSessionTest
|
| const std::string& session_version,
|
| const SessionDescriptionInterface* current_desc) {
|
| std::string session_id = rtc::ToString(rtc::CreateRandomId64());
|
| - const cricket::SessionDescription* cricket_desc = NULL;
|
| + const cricket::SessionDescription* cricket_desc = nullptr;
|
| if (current_desc) {
|
| cricket_desc = current_desc->description();
|
| session_id = current_desc->session_id();
|
| @@ -1044,19 +1046,19 @@ class WebRtcSessionTest
|
| if (!offer->Initialize(desc_factory_->CreateOffer(options, cricket_desc),
|
| session_id, session_version)) {
|
| delete offer;
|
| - offer = NULL;
|
| + offer = nullptr;
|
| }
|
| return offer;
|
| }
|
| JsepSessionDescription* CreateRemoteOffer(
|
| cricket::MediaSessionOptions options) {
|
| return CreateRemoteOfferWithVersion(options, cricket::SEC_ENABLED,
|
| - kSessionVersion, NULL);
|
| + kSessionVersion, nullptr);
|
| }
|
| JsepSessionDescription* CreateRemoteOffer(
|
| cricket::MediaSessionOptions options, cricket::SecurePolicy sdes_policy) {
|
| - return CreateRemoteOfferWithVersion(
|
| - options, sdes_policy, kSessionVersion, NULL);
|
| + return CreateRemoteOfferWithVersion(options, sdes_policy, kSessionVersion,
|
| + nullptr);
|
| }
|
| JsepSessionDescription* CreateRemoteOffer(
|
| cricket::MediaSessionOptions options,
|
| @@ -1090,7 +1092,7 @@ class WebRtcSessionTest
|
| JsepSessionDescription* offer = new JsepSessionDescription(
|
| offer_basis->type());
|
| delete offer_basis;
|
| - offer->Initialize(offer_str, NULL);
|
| + offer->Initialize(offer_str, nullptr);
|
| return offer;
|
| }
|
|
|
| @@ -1111,11 +1113,11 @@ class WebRtcSessionTest
|
| rtc::ToString(rtc::CreateRandomId64());
|
| JsepSessionDescription* answer(
|
| new JsepSessionDescription(JsepSessionDescription::kAnswer));
|
| - if (!answer->Initialize(desc_factory_->CreateAnswer(offer->description(),
|
| - options, NULL),
|
| - session_id, kSessionVersion)) {
|
| + if (!answer->Initialize(
|
| + desc_factory_->CreateAnswer(offer->description(), options, nullptr),
|
| + session_id, kSessionVersion)) {
|
| delete answer;
|
| - answer = NULL;
|
| + answer = nullptr;
|
| }
|
| return answer;
|
| }
|
| @@ -1167,8 +1169,8 @@ class WebRtcSessionTest
|
| &sdp);
|
| }
|
|
|
| - SessionDescriptionInterface* new_answer = CreateSessionDescription(
|
| - JsepSessionDescription::kAnswer, sdp, NULL);
|
| + SessionDescriptionInterface* new_answer =
|
| + CreateSessionDescription(JsepSessionDescription::kAnswer, sdp, nullptr);
|
|
|
| // SetRemoteDescription to enable rtcp mux.
|
| SetRemoteDescriptionWithoutError(new_answer);
|
| @@ -1324,7 +1326,7 @@ class WebRtcSessionTest
|
| offer->ToString(&sdp);
|
| SessionDescriptionInterface* desc = webrtc::CreateSessionDescription(
|
| JsepSessionDescription::kAnswer, sdp, nullptr);
|
| - ASSERT_TRUE(desc != NULL);
|
| + ASSERT_TRUE(desc != nullptr);
|
| SetRemoteDescriptionWithoutError(desc);
|
|
|
| EXPECT_EQ_WAIT(PeerConnectionInterface::kIceConnectionChecking,
|
| @@ -1414,10 +1416,10 @@ class WebRtcSessionTest
|
|
|
| bool VerifyNoCNCodecs(const cricket::ContentInfo* content) {
|
| const cricket::ContentDescription* description = content->description;
|
| - RTC_CHECK(description != NULL);
|
| + RTC_CHECK(description != nullptr);
|
| const cricket::AudioContentDescription* audio_content_desc =
|
| static_cast<const cricket::AudioContentDescription*>(description);
|
| - RTC_CHECK(audio_content_desc != NULL);
|
| + RTC_CHECK(audio_content_desc != nullptr);
|
| for (size_t i = 0; i < audio_content_desc->codecs().size(); ++i) {
|
| if (audio_content_desc->codecs()[i].name == "CN")
|
| return false;
|
| @@ -1460,7 +1462,7 @@ class WebRtcSessionTest
|
| cricket::MediaSessionOptions options;
|
| std::unique_ptr<JsepSessionDescription> offer(
|
| CreateRemoteOffer(options, cricket::SEC_DISABLED));
|
| - ASSERT_TRUE(offer.get() != NULL);
|
| + ASSERT_TRUE(offer.get() != nullptr);
|
| SetRemoteDescriptionWithoutError(offer.release());
|
| }
|
|
|
| @@ -1485,9 +1487,9 @@ class WebRtcSessionTest
|
| for (int i = 0; i < kNumber; ++i) {
|
| EXPECT_EQ_WAIT(expected_state, observers[i]->state(), 1000);
|
| if (success) {
|
| - EXPECT_TRUE(observers[i]->description() != NULL);
|
| + EXPECT_TRUE(observers[i]->description() != nullptr);
|
| } else {
|
| - EXPECT_TRUE(observers[i]->description() == NULL);
|
| + EXPECT_TRUE(observers[i]->description() == nullptr);
|
| }
|
| }
|
| }
|
| @@ -1603,8 +1605,8 @@ TEST_F(WebRtcSessionTest, TestStunError) {
|
|
|
| TEST_F(WebRtcSessionTest, SetSdpFailedOnInvalidSdp) {
|
| Init();
|
| - SessionDescriptionInterface* offer = NULL;
|
| - // Since |offer| is NULL, there's no way to tell if it's an offer or answer.
|
| + SessionDescriptionInterface* offer = nullptr;
|
| + // Since |offer| is null, there's no way to tell if it's an offer or answer.
|
| std::string unknown_action;
|
| SetLocalDescriptionExpectError(unknown_action, kInvalidSdp, offer);
|
| SetRemoteDescriptionExpectError(unknown_action, kInvalidSdp, offer);
|
| @@ -1729,12 +1731,12 @@ TEST_F(WebRtcSessionTest, SetLocalSdpFailedOnCreateChannel) {
|
| media_engine_->set_fail_create_channel(true);
|
|
|
| SessionDescriptionInterface* offer = CreateOffer();
|
| - ASSERT_TRUE(offer != NULL);
|
| + ASSERT_TRUE(offer != nullptr);
|
| // SetRemoteDescription and SetLocalDescription will take the ownership of
|
| // the offer.
|
| SetRemoteDescriptionOfferExpectError(kCreateChannelFailed, offer);
|
| offer = CreateOffer();
|
| - ASSERT_TRUE(offer != NULL);
|
| + ASSERT_TRUE(offer != nullptr);
|
| SetLocalDescriptionOfferExpectError(kCreateChannelFailed, offer);
|
| }
|
|
|
| @@ -1776,13 +1778,13 @@ TEST_F(WebRtcSessionTest, TestSetNonSdesOfferWhenSdesOn) {
|
| options.recv_video = true;
|
| JsepSessionDescription* offer = CreateRemoteOffer(
|
| options, cricket::SEC_DISABLED);
|
| - ASSERT_TRUE(offer != NULL);
|
| + ASSERT_TRUE(offer != nullptr);
|
| VerifyNoCryptoParams(offer->description(), false);
|
| // SetRemoteDescription and SetLocalDescription will take the ownership of
|
| // the offer.
|
| SetRemoteDescriptionOfferExpectError(kSdpWithoutSdesCrypto, offer);
|
| offer = CreateRemoteOffer(options, cricket::SEC_DISABLED);
|
| - ASSERT_TRUE(offer != NULL);
|
| + ASSERT_TRUE(offer != nullptr);
|
| SetLocalDescriptionOfferExpectError(kSdpWithoutSdesCrypto, offer);
|
| }
|
|
|
| @@ -1790,8 +1792,8 @@ TEST_F(WebRtcSessionTest, TestSetNonSdesOfferWhenSdesOn) {
|
| // cryptos enabled when DTLS is off.
|
| TEST_F(WebRtcSessionTest, TestSetLocalNonSdesAnswerWhenSdesOn) {
|
| Init();
|
| - SessionDescriptionInterface* offer = NULL;
|
| - SessionDescriptionInterface* answer = NULL;
|
| + SessionDescriptionInterface* offer = nullptr;
|
| + SessionDescriptionInterface* answer = nullptr;
|
| CreateCryptoOfferAndNonCryptoAnswer(&offer, &answer);
|
| // SetRemoteDescription and SetLocalDescription will take the ownership of
|
| // the offer.
|
| @@ -1803,8 +1805,8 @@ TEST_F(WebRtcSessionTest, TestSetLocalNonSdesAnswerWhenSdesOn) {
|
| // crypto enabled when DTLS is off.
|
| TEST_F(WebRtcSessionTest, TestSetRemoteNonSdesAnswerWhenSdesOn) {
|
| Init();
|
| - SessionDescriptionInterface* offer = NULL;
|
| - SessionDescriptionInterface* answer = NULL;
|
| + SessionDescriptionInterface* offer = nullptr;
|
| + SessionDescriptionInterface* answer = nullptr;
|
| CreateCryptoOfferAndNonCryptoAnswer(&offer, &answer);
|
| // SetRemoteDescription and SetLocalDescription will take the ownership of
|
| // the offer.
|
| @@ -1822,7 +1824,7 @@ TEST_P(WebRtcSessionTest, TestReceiveDtlsOfferCreateDtlsAnswer) {
|
| options.recv_video = true;
|
| JsepSessionDescription* offer =
|
| CreateRemoteOffer(options, cricket::SEC_DISABLED);
|
| - ASSERT_TRUE(offer != NULL);
|
| + ASSERT_TRUE(offer != nullptr);
|
| VerifyFingerprintStatus(offer->description(), true);
|
| VerifyNoCryptoParams(offer->description(), true);
|
|
|
| @@ -1831,7 +1833,7 @@ TEST_P(WebRtcSessionTest, TestReceiveDtlsOfferCreateDtlsAnswer) {
|
|
|
| // Verify that we get a crypto fingerprint in the answer.
|
| SessionDescriptionInterface* answer = CreateAnswer();
|
| - ASSERT_TRUE(answer != NULL);
|
| + ASSERT_TRUE(answer != nullptr);
|
| VerifyFingerprintStatus(answer->description(), true);
|
| // Check that we don't have an a=crypto line in the answer.
|
| VerifyNoCryptoParams(answer->description(), true);
|
| @@ -1849,7 +1851,7 @@ TEST_P(WebRtcSessionTest, TestCreateDtlsOfferReceiveDtlsAnswer) {
|
|
|
| // Verify that we get a crypto fingerprint in the answer.
|
| SessionDescriptionInterface* offer = CreateOffer();
|
| - ASSERT_TRUE(offer != NULL);
|
| + ASSERT_TRUE(offer != nullptr);
|
| VerifyFingerprintStatus(offer->description(), true);
|
| // Check that we don't have an a=crypto line in the offer.
|
| VerifyNoCryptoParams(offer->description(), true);
|
| @@ -1861,7 +1863,7 @@ TEST_P(WebRtcSessionTest, TestCreateDtlsOfferReceiveDtlsAnswer) {
|
| options.recv_video = true;
|
| JsepSessionDescription* answer =
|
| CreateRemoteAnswer(offer, options, cricket::SEC_DISABLED);
|
| - ASSERT_TRUE(answer != NULL);
|
| + ASSERT_TRUE(answer != nullptr);
|
| VerifyFingerprintStatus(answer->description(), true);
|
| VerifyNoCryptoParams(answer->description(), true);
|
|
|
| @@ -1878,7 +1880,7 @@ TEST_P(WebRtcSessionTest, TestReceiveNonDtlsOfferWhenDtlsOn) {
|
| options.bundle_enabled = true;
|
| JsepSessionDescription* offer = CreateRemoteOffer(
|
| options, cricket::SEC_REQUIRED);
|
| - ASSERT_TRUE(offer != NULL);
|
| + ASSERT_TRUE(offer != nullptr);
|
| VerifyFingerprintStatus(offer->description(), false);
|
| VerifyCryptoParams(offer->description());
|
|
|
| @@ -1896,8 +1898,8 @@ TEST_P(WebRtcSessionTest, TestReceiveNonDtlsOfferWhenDtlsOn) {
|
| // a DTLS fingerprint when DTLS is required.
|
| TEST_P(WebRtcSessionTest, TestSetLocalNonDtlsAnswerWhenDtlsOn) {
|
| InitWithDtls(GetParam());
|
| - SessionDescriptionInterface* offer = NULL;
|
| - SessionDescriptionInterface* answer = NULL;
|
| + SessionDescriptionInterface* offer = nullptr;
|
| + SessionDescriptionInterface* answer = nullptr;
|
| CreateDtlsOfferAndNonDtlsAnswer(&offer, &answer);
|
|
|
| // SetRemoteDescription and SetLocalDescription will take the ownership of
|
| @@ -1935,7 +1937,7 @@ TEST_P(WebRtcSessionTest, TestCreateOfferReceiveAnswerWithoutEncryption) {
|
|
|
| // Verify that we get a crypto fingerprint in the answer.
|
| SessionDescriptionInterface* offer = CreateOffer();
|
| - ASSERT_TRUE(offer != NULL);
|
| + ASSERT_TRUE(offer != nullptr);
|
| VerifyFingerprintStatus(offer->description(), false);
|
| // Check that we don't have an a=crypto line in the offer.
|
| VerifyNoCryptoParams(offer->description(), false);
|
| @@ -1947,7 +1949,7 @@ TEST_P(WebRtcSessionTest, TestCreateOfferReceiveAnswerWithoutEncryption) {
|
| options.recv_video = true;
|
| JsepSessionDescription* answer =
|
| CreateRemoteAnswer(offer, options, cricket::SEC_DISABLED);
|
| - ASSERT_TRUE(answer != NULL);
|
| + ASSERT_TRUE(answer != nullptr);
|
| VerifyFingerprintStatus(answer->description(), false);
|
| VerifyNoCryptoParams(answer->description(), false);
|
|
|
| @@ -1965,7 +1967,7 @@ TEST_P(WebRtcSessionTest, TestCreateAnswerReceiveOfferWithoutEncryption) {
|
| options.recv_video = true;
|
| JsepSessionDescription* offer =
|
| CreateRemoteOffer(options, cricket::SEC_DISABLED);
|
| - ASSERT_TRUE(offer != NULL);
|
| + ASSERT_TRUE(offer != nullptr);
|
| VerifyFingerprintStatus(offer->description(), false);
|
| VerifyNoCryptoParams(offer->description(), false);
|
|
|
| @@ -1974,7 +1976,7 @@ TEST_P(WebRtcSessionTest, TestCreateAnswerReceiveOfferWithoutEncryption) {
|
|
|
| // Verify that we get a crypto fingerprint in the answer.
|
| SessionDescriptionInterface* answer = CreateAnswer();
|
| - ASSERT_TRUE(answer != NULL);
|
| + ASSERT_TRUE(answer != nullptr);
|
| VerifyFingerprintStatus(answer->description(), false);
|
| // Check that we don't have an a=crypto line in the answer.
|
| VerifyNoCryptoParams(answer->description(), false);
|
| @@ -2191,7 +2193,7 @@ TEST_F(WebRtcSessionTest, TestAddAndRemoveRemoteCandidates) {
|
| // Verifying the candidates are copied properly from internal vector.
|
| const SessionDescriptionInterface* remote_desc =
|
| session_->remote_description();
|
| - ASSERT_TRUE(remote_desc != NULL);
|
| + ASSERT_TRUE(remote_desc != nullptr);
|
| ASSERT_EQ(2u, remote_desc->number_of_mediasections());
|
| const IceCandidateCollection* candidates =
|
| remote_desc->candidates(kMediaContentIndex0);
|
| @@ -2233,7 +2235,7 @@ TEST_F(WebRtcSessionTest, TestRemoteCandidatesAddedToSessionDescription) {
|
| EXPECT_TRUE(session_->ProcessIceMessage(&ice_candidate1));
|
| const SessionDescriptionInterface* remote_desc =
|
| session_->remote_description();
|
| - ASSERT_TRUE(remote_desc != NULL);
|
| + ASSERT_TRUE(remote_desc != nullptr);
|
| ASSERT_EQ(2u, remote_desc->number_of_mediasections());
|
| const IceCandidateCollection* candidates =
|
| remote_desc->candidates(kMediaContentIndex0);
|
| @@ -2251,7 +2253,7 @@ TEST_F(WebRtcSessionTest, TestRemoteCandidatesAddedToSessionDescription) {
|
| SetRemoteDescriptionWithoutError(offer);
|
|
|
| remote_desc = session_->remote_description();
|
| - ASSERT_TRUE(remote_desc != NULL);
|
| + ASSERT_TRUE(remote_desc != nullptr);
|
| ASSERT_EQ(2u, remote_desc->number_of_mediasections());
|
| candidates = remote_desc->candidates(kMediaContentIndex0);
|
| ASSERT_EQ(2u, candidates->count());
|
| @@ -2289,7 +2291,7 @@ TEST_F(WebRtcSessionTest,
|
| const SessionDescriptionInterface* local_desc = session_->local_description();
|
| const IceCandidateCollection* candidates =
|
| local_desc->candidates(kMediaContentIndex0);
|
| - ASSERT_TRUE(candidates != NULL);
|
| + ASSERT_TRUE(candidates != nullptr);
|
| EXPECT_EQ(0u, candidates->count());
|
|
|
| // Since we're using continual gathering, we won't get "gathering done".
|
| @@ -2297,10 +2299,10 @@ TEST_F(WebRtcSessionTest,
|
|
|
| local_desc = session_->local_description();
|
| candidates = local_desc->candidates(kMediaContentIndex0);
|
| - ASSERT_TRUE(candidates != NULL);
|
| + ASSERT_TRUE(candidates != nullptr);
|
| EXPECT_LT(0u, candidates->count());
|
| candidates = local_desc->candidates(1);
|
| - ASSERT_TRUE(candidates != NULL);
|
| + ASSERT_TRUE(candidates != nullptr);
|
| EXPECT_EQ(0u, candidates->count());
|
|
|
| // Update the session descriptions.
|
| @@ -2309,10 +2311,10 @@ TEST_F(WebRtcSessionTest,
|
|
|
| local_desc = session_->local_description();
|
| candidates = local_desc->candidates(kMediaContentIndex0);
|
| - ASSERT_TRUE(candidates != NULL);
|
| + ASSERT_TRUE(candidates != nullptr);
|
| EXPECT_LT(0u, candidates->count());
|
| candidates = local_desc->candidates(1);
|
| - ASSERT_TRUE(candidates != NULL);
|
| + ASSERT_TRUE(candidates != nullptr);
|
| EXPECT_EQ(0u, candidates->count());
|
|
|
| candidates = local_desc->candidates(kMediaContentIndex0);
|
| @@ -2337,7 +2339,7 @@ TEST_F(WebRtcSessionTest, TestLocalCandidatesNotRemovedIfNotGatherContinually) {
|
| const SessionDescriptionInterface* local_desc = session_->local_description();
|
| const IceCandidateCollection* candidates =
|
| local_desc->candidates(kMediaContentIndex0);
|
| - ASSERT_TRUE(candidates != NULL);
|
| + ASSERT_TRUE(candidates != nullptr);
|
| EXPECT_TRUE_WAIT(observer_.oncandidatesready_, kIceCandidatesTimeout);
|
|
|
| size_t num_local_candidates = candidates->count();
|
| @@ -2367,7 +2369,7 @@ TEST_F(WebRtcSessionTest, TestSetRemoteSessionDescriptionWithCandidates) {
|
|
|
| const SessionDescriptionInterface* remote_desc =
|
| session_->remote_description();
|
| - ASSERT_TRUE(remote_desc != NULL);
|
| + ASSERT_TRUE(remote_desc != nullptr);
|
| ASSERT_EQ(2u, remote_desc->number_of_mediasections());
|
| const IceCandidateCollection* candidates =
|
| remote_desc->candidates(kMediaContentIndex0);
|
| @@ -2395,13 +2397,13 @@ TEST_F(WebRtcSessionTest, TestSetLocalAndRemoteDescriptionWithCandidates) {
|
|
|
| std::unique_ptr<SessionDescriptionInterface> local_offer(CreateOffer());
|
|
|
| - ASSERT_TRUE(local_offer->candidates(kMediaContentIndex0) != NULL);
|
| + ASSERT_TRUE(local_offer->candidates(kMediaContentIndex0) != nullptr);
|
| EXPECT_LT(0u, local_offer->candidates(kMediaContentIndex0)->count());
|
|
|
| SessionDescriptionInterface* remote_offer(CreateRemoteOffer());
|
| SetRemoteDescriptionWithoutError(remote_offer);
|
| SessionDescriptionInterface* answer = CreateAnswer();
|
| - ASSERT_TRUE(answer->candidates(kMediaContentIndex0) != NULL);
|
| + ASSERT_TRUE(answer->candidates(kMediaContentIndex0) != nullptr);
|
| EXPECT_LT(0u, answer->candidates(kMediaContentIndex0)->count());
|
| SetLocalDescriptionWithoutError(answer);
|
| }
|
| @@ -2437,7 +2439,7 @@ TEST_F(WebRtcSessionTest, TestChannelCreationsWithContentNames) {
|
| &sdp);
|
|
|
| SessionDescriptionInterface* modified_offer =
|
| - CreateSessionDescription(JsepSessionDescription::kOffer, sdp, NULL);
|
| + CreateSessionDescription(JsepSessionDescription::kOffer, sdp, nullptr);
|
|
|
| SetRemoteDescriptionWithoutError(modified_offer);
|
|
|
| @@ -2446,18 +2448,18 @@ TEST_F(WebRtcSessionTest, TestChannelCreationsWithContentNames) {
|
|
|
| rtc::PacketTransportInternal* voice_transport_channel =
|
| session_->voice_rtp_transport_channel();
|
| - EXPECT_TRUE(voice_transport_channel != NULL);
|
| + EXPECT_TRUE(voice_transport_channel != nullptr);
|
| EXPECT_EQ(voice_transport_channel->debug_name(),
|
| "audio_content_name " +
|
| std::to_string(cricket::ICE_CANDIDATE_COMPONENT_RTP));
|
| rtc::PacketTransportInternal* video_transport_channel =
|
| session_->video_rtp_transport_channel();
|
| - ASSERT_TRUE(video_transport_channel != NULL);
|
| + ASSERT_TRUE(video_transport_channel != nullptr);
|
| EXPECT_EQ(video_transport_channel->debug_name(),
|
| "video_content_name " +
|
| std::to_string(cricket::ICE_CANDIDATE_COMPONENT_RTP));
|
| - EXPECT_TRUE((video_channel_ = media_engine_->GetVideoChannel(0)) != NULL);
|
| - EXPECT_TRUE((voice_channel_ = media_engine_->GetVoiceChannel(0)) != NULL);
|
| + EXPECT_TRUE((video_channel_ = media_engine_->GetVideoChannel(0)) != nullptr);
|
| + EXPECT_TRUE((voice_channel_ = media_engine_->GetVoiceChannel(0)) != nullptr);
|
| }
|
|
|
| // Test that an offer contains the correct media content descriptions based on
|
| @@ -2466,12 +2468,12 @@ TEST_F(WebRtcSessionTest, CreateOfferWithoutConstraintsOrStreams) {
|
| Init();
|
| std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
|
|
| - ASSERT_TRUE(offer != NULL);
|
| + ASSERT_TRUE(offer != nullptr);
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(offer->description());
|
| - EXPECT_TRUE(content != NULL);
|
| + EXPECT_TRUE(content != nullptr);
|
| content = cricket::GetFirstVideoContent(offer->description());
|
| - EXPECT_TRUE(content == NULL);
|
| + EXPECT_TRUE(content == nullptr);
|
| }
|
|
|
| // Test that an offer contains the correct media content descriptions based on
|
| @@ -2484,17 +2486,17 @@ TEST_F(WebRtcSessionTest, CreateOfferWithoutConstraints) {
|
|
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(offer->description());
|
| - EXPECT_TRUE(content != NULL);
|
| + EXPECT_TRUE(content != nullptr);
|
| content = cricket::GetFirstVideoContent(offer->description());
|
| - EXPECT_TRUE(content == NULL);
|
| + EXPECT_TRUE(content == nullptr);
|
|
|
| // Test Audio / Video offer.
|
| SendAudioVideoStream1();
|
| offer.reset(CreateOffer());
|
| content = cricket::GetFirstAudioContent(offer->description());
|
| - EXPECT_TRUE(content != NULL);
|
| + EXPECT_TRUE(content != nullptr);
|
| content = cricket::GetFirstVideoContent(offer->description());
|
| - EXPECT_TRUE(content != NULL);
|
| + EXPECT_TRUE(content != nullptr);
|
| }
|
|
|
| // Test that an offer contains no media content descriptions if
|
| @@ -2507,12 +2509,12 @@ TEST_F(WebRtcSessionTest, CreateOfferWithConstraintsWithoutStreams) {
|
|
|
| std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer(options));
|
|
|
| - ASSERT_TRUE(offer != NULL);
|
| + ASSERT_TRUE(offer != nullptr);
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(offer->description());
|
| - EXPECT_TRUE(content == NULL);
|
| + EXPECT_TRUE(content == nullptr);
|
| content = cricket::GetFirstVideoContent(offer->description());
|
| - EXPECT_TRUE(content == NULL);
|
| + EXPECT_TRUE(content == nullptr);
|
| }
|
|
|
| // Test that an offer contains only audio media content descriptions if
|
| @@ -2527,9 +2529,9 @@ TEST_F(WebRtcSessionTest, CreateAudioOnlyOfferWithConstraints) {
|
|
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(offer->description());
|
| - EXPECT_TRUE(content != NULL);
|
| + EXPECT_TRUE(content != nullptr);
|
| content = cricket::GetFirstVideoContent(offer->description());
|
| - EXPECT_TRUE(content == NULL);
|
| + EXPECT_TRUE(content == nullptr);
|
| }
|
|
|
| // Test that an offer contains audio and video media content descriptions if
|
| @@ -2547,10 +2549,10 @@ TEST_F(WebRtcSessionTest, CreateOfferWithConstraints) {
|
|
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(offer->description());
|
| - EXPECT_TRUE(content != NULL);
|
| + EXPECT_TRUE(content != nullptr);
|
|
|
| content = cricket::GetFirstVideoContent(offer->description());
|
| - EXPECT_TRUE(content != NULL);
|
| + EXPECT_TRUE(content != nullptr);
|
|
|
| // Sets constraints to false and verifies that audio/video contents are
|
| // removed.
|
| @@ -2559,9 +2561,9 @@ TEST_F(WebRtcSessionTest, CreateOfferWithConstraints) {
|
| offer.reset(CreateOffer(options));
|
|
|
| content = cricket::GetFirstAudioContent(offer->description());
|
| - EXPECT_TRUE(content == NULL);
|
| + EXPECT_TRUE(content == nullptr);
|
| content = cricket::GetFirstVideoContent(offer->description());
|
| - EXPECT_TRUE(content == NULL);
|
| + EXPECT_TRUE(content == nullptr);
|
| }
|
|
|
| // Test that an answer can not be created if the last remote description is not
|
| @@ -2572,7 +2574,7 @@ TEST_F(WebRtcSessionTest, CreateAnswerWithoutAnOffer) {
|
| SetLocalDescriptionWithoutError(offer);
|
| SessionDescriptionInterface* answer = CreateRemoteAnswer(offer);
|
| SetRemoteDescriptionWithoutError(answer);
|
| - EXPECT_TRUE(CreateAnswer() == NULL);
|
| + EXPECT_TRUE(CreateAnswer() == nullptr);
|
| }
|
|
|
| // Test that an answer contains the correct media content descriptions when no
|
| @@ -2585,11 +2587,11 @@ TEST_F(WebRtcSessionTest, CreateAnswerWithoutConstraintsOrStreams) {
|
| std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(answer->description());
|
| - ASSERT_TRUE(content != NULL);
|
| + ASSERT_TRUE(content != nullptr);
|
| EXPECT_FALSE(content->rejected);
|
|
|
| content = cricket::GetFirstVideoContent(answer->description());
|
| - ASSERT_TRUE(content != NULL);
|
| + ASSERT_TRUE(content != nullptr);
|
| EXPECT_FALSE(content->rejected);
|
| }
|
|
|
| @@ -2601,17 +2603,17 @@ TEST_F(WebRtcSessionTest, CreateAudioAnswerWithoutConstraintsOrStreams) {
|
| cricket::MediaSessionOptions options;
|
|
|
| std::unique_ptr<JsepSessionDescription> offer(CreateRemoteOffer(options));
|
| - ASSERT_TRUE(cricket::GetFirstVideoContent(offer->description()) == NULL);
|
| - ASSERT_TRUE(cricket::GetFirstAudioContent(offer->description()) != NULL);
|
| + ASSERT_TRUE(cricket::GetFirstVideoContent(offer->description()) == nullptr);
|
| + ASSERT_TRUE(cricket::GetFirstAudioContent(offer->description()) != nullptr);
|
|
|
| SetRemoteDescriptionWithoutError(offer.release());
|
| std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(answer->description());
|
| - ASSERT_TRUE(content != NULL);
|
| + ASSERT_TRUE(content != nullptr);
|
| EXPECT_FALSE(content->rejected);
|
|
|
| - EXPECT_TRUE(cricket::GetFirstVideoContent(answer->description()) == NULL);
|
| + EXPECT_TRUE(cricket::GetFirstVideoContent(answer->description()) == nullptr);
|
| }
|
|
|
| // Test that an answer contains the correct media content descriptions when no
|
| @@ -2626,11 +2628,11 @@ TEST_F(WebRtcSessionTest, CreateAnswerWithoutConstraints) {
|
| std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(answer->description());
|
| - ASSERT_TRUE(content != NULL);
|
| + ASSERT_TRUE(content != nullptr);
|
| EXPECT_FALSE(content->rejected);
|
|
|
| content = cricket::GetFirstVideoContent(answer->description());
|
| - ASSERT_TRUE(content != NULL);
|
| + ASSERT_TRUE(content != nullptr);
|
| EXPECT_FALSE(content->rejected);
|
| }
|
|
|
| @@ -2650,11 +2652,11 @@ TEST_F(WebRtcSessionTest, CreateAnswerWithConstraintsWithoutStreams) {
|
|
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(answer->description());
|
| - ASSERT_TRUE(content != NULL);
|
| + ASSERT_TRUE(content != nullptr);
|
| EXPECT_TRUE(content->rejected);
|
|
|
| content = cricket::GetFirstVideoContent(answer->description());
|
| - ASSERT_TRUE(content != NULL);
|
| + ASSERT_TRUE(content != nullptr);
|
| EXPECT_TRUE(content->rejected);
|
| }
|
|
|
| @@ -2677,12 +2679,12 @@ TEST_F(WebRtcSessionTest, CreateAnswerWithConstraints) {
|
| // TODO(perkj): Should the direction be set to SEND_ONLY?
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(answer->description());
|
| - ASSERT_TRUE(content != NULL);
|
| + ASSERT_TRUE(content != nullptr);
|
| EXPECT_FALSE(content->rejected);
|
|
|
| // TODO(perkj): Should the direction be set to SEND_ONLY?
|
| content = cricket::GetFirstVideoContent(answer->description());
|
| - ASSERT_TRUE(content != NULL);
|
| + ASSERT_TRUE(content != nullptr);
|
| EXPECT_FALSE(content->rejected);
|
| }
|
|
|
| @@ -2698,7 +2700,7 @@ TEST_F(WebRtcSessionTest, CreateOfferWithoutCNCodecs) {
|
|
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(offer->description());
|
| - EXPECT_TRUE(content != NULL);
|
| + EXPECT_TRUE(content != nullptr);
|
| EXPECT_TRUE(VerifyNoCNCodecs(content));
|
| }
|
|
|
| @@ -2714,7 +2716,7 @@ TEST_F(WebRtcSessionTest, CreateAnswerWithoutCNCodecs) {
|
| std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer(options));
|
| const cricket::ContentInfo* content =
|
| cricket::GetFirstAudioContent(answer->description());
|
| - ASSERT_TRUE(content != NULL);
|
| + ASSERT_TRUE(content != nullptr);
|
| EXPECT_TRUE(VerifyNoCNCodecs(content));
|
| }
|
|
|
| @@ -2722,8 +2724,8 @@ TEST_F(WebRtcSessionTest, CreateAnswerWithoutCNCodecs) {
|
| // later updates with video.
|
| TEST_F(WebRtcSessionTest, TestAVOfferWithAudioOnlyAnswer) {
|
| Init();
|
| - EXPECT_TRUE(media_engine_->GetVideoChannel(0) == NULL);
|
| - EXPECT_TRUE(media_engine_->GetVoiceChannel(0) == NULL);
|
| + EXPECT_TRUE(media_engine_->GetVideoChannel(0) == nullptr);
|
| + EXPECT_TRUE(media_engine_->GetVoiceChannel(0) == nullptr);
|
|
|
| SendAudioVideoStream1();
|
| SessionDescriptionInterface* offer = CreateOffer();
|
| @@ -2739,7 +2741,7 @@ TEST_F(WebRtcSessionTest, TestAVOfferWithAudioOnlyAnswer) {
|
| video_channel_ = media_engine_->GetVideoChannel(0);
|
| voice_channel_ = media_engine_->GetVoiceChannel(0);
|
|
|
| - ASSERT_TRUE(video_channel_ == NULL);
|
| + ASSERT_TRUE(video_channel_ == nullptr);
|
|
|
| ASSERT_EQ(0u, voice_channel_->recv_streams().size());
|
| ASSERT_EQ(1u, voice_channel_->send_streams().size());
|
| @@ -2752,8 +2754,8 @@ TEST_F(WebRtcSessionTest, TestAVOfferWithAudioOnlyAnswer) {
|
| video_channel_ = media_engine_->GetVideoChannel(0);
|
| voice_channel_ = media_engine_->GetVoiceChannel(0);
|
|
|
| - ASSERT_TRUE(video_channel_ != NULL);
|
| - ASSERT_TRUE(voice_channel_ != NULL);
|
| + ASSERT_TRUE(video_channel_ != nullptr);
|
| + ASSERT_TRUE(voice_channel_ != nullptr);
|
|
|
| ASSERT_EQ(1u, video_channel_->recv_streams().size());
|
| ASSERT_EQ(1u, video_channel_->send_streams().size());
|
| @@ -2779,8 +2781,8 @@ TEST_F(WebRtcSessionTest, TestAVOfferWithAudioOnlyAnswer) {
|
| // later updates with audio.
|
| TEST_F(WebRtcSessionTest, TestAVOfferWithVideoOnlyAnswer) {
|
| Init();
|
| - EXPECT_TRUE(media_engine_->GetVideoChannel(0) == NULL);
|
| - EXPECT_TRUE(media_engine_->GetVoiceChannel(0) == NULL);
|
| + EXPECT_TRUE(media_engine_->GetVideoChannel(0) == nullptr);
|
| + EXPECT_TRUE(media_engine_->GetVoiceChannel(0) == nullptr);
|
| SendAudioVideoStream1();
|
| SessionDescriptionInterface* offer = CreateOffer();
|
|
|
| @@ -2798,8 +2800,8 @@ TEST_F(WebRtcSessionTest, TestAVOfferWithVideoOnlyAnswer) {
|
| video_channel_ = media_engine_->GetVideoChannel(0);
|
| voice_channel_ = media_engine_->GetVoiceChannel(0);
|
|
|
| - ASSERT_TRUE(voice_channel_ == NULL);
|
| - ASSERT_TRUE(video_channel_ != NULL);
|
| + ASSERT_TRUE(voice_channel_ == nullptr);
|
| + ASSERT_TRUE(video_channel_ != nullptr);
|
|
|
| EXPECT_EQ(0u, video_channel_->recv_streams().size());
|
| ASSERT_EQ(1u, video_channel_->send_streams().size());
|
| @@ -2810,7 +2812,7 @@ TEST_F(WebRtcSessionTest, TestAVOfferWithVideoOnlyAnswer) {
|
| CreateAndSetRemoteOfferAndLocalAnswer();
|
|
|
| voice_channel_ = media_engine_->GetVoiceChannel(0);
|
| - ASSERT_TRUE(voice_channel_ != NULL);
|
| + ASSERT_TRUE(voice_channel_ != nullptr);
|
|
|
| ASSERT_EQ(1u, voice_channel_->recv_streams().size());
|
| ASSERT_EQ(1u, voice_channel_->send_streams().size());
|
| @@ -2878,7 +2880,7 @@ TEST_F(WebRtcSessionTest, TestSetLocalDescriptionWithoutIce) {
|
| std::string sdp;
|
| RemoveIceUfragPwdLines(offer.get(), &sdp);
|
| SessionDescriptionInterface* modified_offer =
|
| - CreateSessionDescription(JsepSessionDescription::kOffer, sdp, NULL);
|
| + CreateSessionDescription(JsepSessionDescription::kOffer, sdp, nullptr);
|
| SetLocalDescriptionOfferExpectError(kSdpWithoutIceUfragPwd, modified_offer);
|
| }
|
|
|
| @@ -2890,7 +2892,7 @@ TEST_F(WebRtcSessionTest, TestSetRemoteDescriptionWithoutIce) {
|
| std::string sdp;
|
| RemoveIceUfragPwdLines(offer.get(), &sdp);
|
| SessionDescriptionInterface* modified_offer =
|
| - CreateSessionDescription(JsepSessionDescription::kOffer, sdp, NULL);
|
| + CreateSessionDescription(JsepSessionDescription::kOffer, sdp, nullptr);
|
| SetRemoteDescriptionOfferExpectError(kSdpWithoutIceUfragPwd, modified_offer);
|
| }
|
|
|
| @@ -3041,7 +3043,7 @@ TEST_F(WebRtcSessionTest, TestIgnoreCandidatesForUnusedTransportWhenBundling) {
|
| session_->video_rtp_transport_channel());
|
|
|
| cricket::BaseChannel* voice_channel = session_->voice_channel();
|
| - ASSERT_TRUE(voice_channel != NULL);
|
| + ASSERT_TRUE(voice_channel != nullptr);
|
|
|
| // Checks if one of the transport channels contains a connection using a given
|
| // port.
|
| @@ -3375,7 +3377,7 @@ TEST_F(WebRtcSessionTest, TestAddChannelToConnectedBundle) {
|
| offer->ToString(&sdp);
|
| SessionDescriptionInterface* answer = webrtc::CreateSessionDescription(
|
| JsepSessionDescription::kAnswer, sdp, nullptr);
|
| - ASSERT_TRUE(answer != NULL);
|
| + ASSERT_TRUE(answer != nullptr);
|
| SetRemoteDescriptionWithoutError(answer);
|
|
|
| // Wait for the ICE state to stabilize.
|
| @@ -3390,7 +3392,7 @@ TEST_F(WebRtcSessionTest, TestAddChannelToConnectedBundle) {
|
| SetLocalDescriptionWithoutError(offer);
|
| answer = webrtc::CreateSessionDescription(JsepSessionDescription::kAnswer,
|
| sdp, nullptr);
|
| - ASSERT_TRUE(answer != NULL);
|
| + ASSERT_TRUE(answer != nullptr);
|
| SetRemoteDescriptionWithoutError(answer);
|
|
|
| // Wait for ICE state to stabilize
|
| @@ -3410,16 +3412,16 @@ TEST_F(WebRtcSessionTest, TestRequireRtcpMux) {
|
| SessionDescriptionInterface* offer = CreateOffer(options);
|
| SetLocalDescriptionWithoutError(offer);
|
|
|
| - EXPECT_TRUE(session_->voice_rtcp_transport_channel() == NULL);
|
| - EXPECT_TRUE(session_->video_rtcp_transport_channel() == NULL);
|
| + EXPECT_TRUE(session_->voice_rtcp_transport_channel() == nullptr);
|
| + EXPECT_TRUE(session_->video_rtcp_transport_channel() == nullptr);
|
|
|
| SendAudioVideoStream2();
|
| SessionDescriptionInterface* answer =
|
| CreateRemoteAnswer(session_->local_description());
|
| SetRemoteDescriptionWithoutError(answer);
|
|
|
| - EXPECT_TRUE(session_->voice_rtcp_transport_channel() == NULL);
|
| - EXPECT_TRUE(session_->video_rtcp_transport_channel() == NULL);
|
| + EXPECT_TRUE(session_->voice_rtcp_transport_channel() == nullptr);
|
| + EXPECT_TRUE(session_->video_rtcp_transport_channel() == nullptr);
|
| }
|
|
|
| TEST_F(WebRtcSessionTest, TestNegotiateRtcpMux) {
|
| @@ -3430,16 +3432,16 @@ TEST_F(WebRtcSessionTest, TestNegotiateRtcpMux) {
|
| SessionDescriptionInterface* offer = CreateOffer(options);
|
| SetLocalDescriptionWithoutError(offer);
|
|
|
| - EXPECT_TRUE(session_->voice_rtcp_transport_channel() != NULL);
|
| - EXPECT_TRUE(session_->video_rtcp_transport_channel() != NULL);
|
| + EXPECT_TRUE(session_->voice_rtcp_transport_channel() != nullptr);
|
| + EXPECT_TRUE(session_->video_rtcp_transport_channel() != nullptr);
|
|
|
| SendAudioVideoStream2();
|
| SessionDescriptionInterface* answer =
|
| CreateRemoteAnswer(session_->local_description());
|
| SetRemoteDescriptionWithoutError(answer);
|
|
|
| - EXPECT_TRUE(session_->voice_rtcp_transport_channel() == NULL);
|
| - EXPECT_TRUE(session_->video_rtcp_transport_channel() == NULL);
|
| + EXPECT_TRUE(session_->voice_rtcp_transport_channel() == nullptr);
|
| + EXPECT_TRUE(session_->video_rtcp_transport_channel() == nullptr);
|
| }
|
|
|
| // This test verifies that SetLocalDescription and SetRemoteDescription fails
|
| @@ -3462,11 +3464,11 @@ TEST_F(WebRtcSessionTest, TestDisabledRtcpMuxWithBundleEnabled) {
|
| &offer_str);
|
| JsepSessionDescription* local_offer =
|
| new JsepSessionDescription(JsepSessionDescription::kOffer);
|
| - EXPECT_TRUE((local_offer)->Initialize(offer_str, NULL));
|
| + EXPECT_TRUE((local_offer)->Initialize(offer_str, nullptr));
|
| SetLocalDescriptionOfferExpectError(kBundleWithoutRtcpMux, local_offer);
|
| JsepSessionDescription* remote_offer =
|
| new JsepSessionDescription(JsepSessionDescription::kOffer);
|
| - EXPECT_TRUE((remote_offer)->Initialize(offer_str, NULL));
|
| + EXPECT_TRUE((remote_offer)->Initialize(offer_str, nullptr));
|
| SetRemoteDescriptionOfferExpectError(kBundleWithoutRtcpMux, remote_offer);
|
| // Trying unmodified SDP.
|
| SetLocalDescriptionWithoutError(offer);
|
| @@ -3533,7 +3535,7 @@ TEST_F(WebRtcSessionTest, TestIncorrectMLinesInRemoteAnswer) {
|
| kAudioMidReplaceStr.length(),
|
| &sdp);
|
| SessionDescriptionInterface* modified_answer1 =
|
| - CreateSessionDescription(JsepSessionDescription::kAnswer, sdp, NULL);
|
| + CreateSessionDescription(JsepSessionDescription::kAnswer, sdp, nullptr);
|
| SetRemoteDescriptionAnswerExpectError(kMlineMismatch, modified_answer1);
|
|
|
| // Different media types.
|
| @@ -3545,7 +3547,7 @@ TEST_F(WebRtcSessionTest, TestIncorrectMLinesInRemoteAnswer) {
|
| kAudioMlineReplaceStr.length(),
|
| &sdp);
|
| SessionDescriptionInterface* modified_answer2 =
|
| - CreateSessionDescription(JsepSessionDescription::kAnswer, sdp, NULL);
|
| + CreateSessionDescription(JsepSessionDescription::kAnswer, sdp, nullptr);
|
| SetRemoteDescriptionAnswerExpectError(kMlineMismatch, modified_answer2);
|
|
|
| SetRemoteDescriptionWithoutError(answer.release());
|
| @@ -3589,8 +3591,8 @@ TEST_F(WebRtcSessionTest, TestIceStartAfterSetLocalDescriptionOnly) {
|
| candidate1);
|
| EXPECT_TRUE(offer->AddCandidate(&ice_candidate1));
|
| SetRemoteDescriptionWithoutError(offer);
|
| - ASSERT_TRUE(session_->voice_rtp_transport_channel() != NULL);
|
| - ASSERT_TRUE(session_->video_rtp_transport_channel() != NULL);
|
| + ASSERT_TRUE(session_->voice_rtp_transport_channel() != nullptr);
|
| + ASSERT_TRUE(session_->video_rtp_transport_channel() != nullptr);
|
|
|
| // Pump for 1 second and verify that no candidates are generated.
|
| rtc::Thread::Current()->ProcessMessages(1000);
|
| @@ -3614,8 +3616,8 @@ TEST_F(WebRtcSessionTest, TestCryptoAfterSetLocalDescription) {
|
| // will be set as per MediaSessionDescriptionFactory.
|
| std::string offer_str;
|
| offer->ToString(&offer_str);
|
| - SessionDescriptionInterface* jsep_offer_str =
|
| - CreateSessionDescription(JsepSessionDescription::kOffer, offer_str, NULL);
|
| + SessionDescriptionInterface* jsep_offer_str = CreateSessionDescription(
|
| + JsepSessionDescription::kOffer, offer_str, nullptr);
|
| SetLocalDescriptionWithoutError(jsep_offer_str);
|
| EXPECT_TRUE(session_->voice_channel()->srtp_required_for_testing());
|
| EXPECT_TRUE(session_->video_channel()->srtp_required_for_testing());
|
| @@ -3633,8 +3635,8 @@ TEST_F(WebRtcSessionTest, TestCryptoAfterSetLocalDescriptionWithDisabled) {
|
| // will be set as per MediaSessionDescriptionFactory.
|
| std::string offer_str;
|
| offer->ToString(&offer_str);
|
| - SessionDescriptionInterface* jsep_offer_str =
|
| - CreateSessionDescription(JsepSessionDescription::kOffer, offer_str, NULL);
|
| + SessionDescriptionInterface* jsep_offer_str = CreateSessionDescription(
|
| + JsepSessionDescription::kOffer, offer_str, nullptr);
|
| SetLocalDescriptionWithoutError(jsep_offer_str);
|
| EXPECT_FALSE(session_->voice_channel()->srtp_required_for_testing());
|
| EXPECT_FALSE(session_->video_channel()->srtp_required_for_testing());
|
| @@ -3901,8 +3903,8 @@ TEST_P(WebRtcSessionTest, TestCreateOfferWithSctpEnabledWithoutStreams) {
|
| InitWithDtls(GetParam());
|
|
|
| std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| - EXPECT_TRUE(offer->description()->GetContentByName("data") == NULL);
|
| - EXPECT_TRUE(offer->description()->GetTransportInfoByName("data") == NULL);
|
| + EXPECT_TRUE(offer->description()->GetContentByName("data") == nullptr);
|
| + EXPECT_TRUE(offer->description()->GetTransportInfoByName("data") == nullptr);
|
| }
|
|
|
| TEST_P(WebRtcSessionTest, TestCreateAnswerWithSctpInOfferAndNoStreams) {
|
| @@ -3918,9 +3920,9 @@ TEST_P(WebRtcSessionTest, TestCreateAnswerWithSctpInOfferAndNoStreams) {
|
|
|
| // Verifies the answer contains SCTP.
|
| std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| - EXPECT_TRUE(answer != NULL);
|
| - EXPECT_TRUE(answer->description()->GetContentByName("data") != NULL);
|
| - EXPECT_TRUE(answer->description()->GetTransportInfoByName("data") != NULL);
|
| + EXPECT_TRUE(answer != nullptr);
|
| + EXPECT_TRUE(answer->description()->GetContentByName("data") != nullptr);
|
| + EXPECT_TRUE(answer->description()->GetTransportInfoByName("data") != nullptr);
|
| }
|
|
|
| // Test that if DTLS is disabled, we don't end up with an SctpTransport
|
| @@ -3975,7 +3977,7 @@ TEST_P(WebRtcSessionTest, TestSctpDataChannelSendPortParsing) {
|
|
|
| SessionDescriptionInterface* answer =
|
| ChangeSDPSctpPort(new_recv_port, CreateAnswer());
|
| - ASSERT_TRUE(answer != NULL);
|
| + ASSERT_TRUE(answer != nullptr);
|
|
|
| // Now set the local description, which'll take ownership of the answer.
|
| SetLocalDescriptionWithoutError(answer);
|
| @@ -4042,7 +4044,7 @@ TEST_P(WebRtcSessionTest, TestCreateOfferBeforeIdentityRequestReturnSuccess) {
|
| SendAudioVideoStream1();
|
| std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
|
|
| - EXPECT_TRUE(offer != NULL);
|
| + EXPECT_TRUE(offer != nullptr);
|
| VerifyNoCryptoParams(offer->description(), true);
|
| VerifyFingerprintStatus(offer->description(), true);
|
| }
|
| @@ -4058,11 +4060,11 @@ TEST_P(WebRtcSessionTest, TestCreateAnswerBeforeIdentityRequestReturnSuccess) {
|
| options.recv_video = true;
|
| std::unique_ptr<JsepSessionDescription> offer(
|
| CreateRemoteOffer(options, cricket::SEC_DISABLED));
|
| - ASSERT_TRUE(offer.get() != NULL);
|
| + ASSERT_TRUE(offer.get() != nullptr);
|
| SetRemoteDescriptionWithoutError(offer.release());
|
|
|
| std::unique_ptr<SessionDescriptionInterface> answer(CreateAnswer());
|
| - EXPECT_TRUE(answer != NULL);
|
| + EXPECT_TRUE(answer != nullptr);
|
| VerifyNoCryptoParams(answer->description(), true);
|
| VerifyFingerprintStatus(answer->description(), true);
|
| }
|
| @@ -4076,7 +4078,7 @@ TEST_P(WebRtcSessionTest, TestCreateOfferAfterIdentityRequestReturnSuccess) {
|
| EXPECT_TRUE_WAIT(!session_->waiting_for_certificate_for_testing(), 1000);
|
|
|
| std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| - EXPECT_TRUE(offer != NULL);
|
| + EXPECT_TRUE(offer != nullptr);
|
| }
|
|
|
| // Verifies that CreateOffer fails when CreateOffer is called after async
|
| @@ -4087,7 +4089,7 @@ TEST_F(WebRtcSessionTest, TestCreateOfferAfterIdentityRequestReturnFailure) {
|
| EXPECT_TRUE_WAIT(!session_->waiting_for_certificate_for_testing(), 1000);
|
|
|
| std::unique_ptr<SessionDescriptionInterface> offer(CreateOffer());
|
| - EXPECT_TRUE(offer == NULL);
|
| + EXPECT_TRUE(offer == nullptr);
|
| }
|
|
|
| // Verifies that CreateOffer succeeds when Multiple CreateOffer calls are made
|
| @@ -4134,8 +4136,8 @@ TEST_F(WebRtcSessionTest, TestSetRemoteOfferFailIfDtlsDisabledAndNoCrypto) {
|
| // Adds a DTLS fingerprint to the remote offer.
|
| cricket::SessionDescription* sdp = offer->description();
|
| TransportInfo* audio = sdp->GetTransportInfoByName("audio");
|
| - ASSERT_TRUE(audio != NULL);
|
| - ASSERT_TRUE(audio->description.identity_fingerprint.get() == NULL);
|
| + ASSERT_TRUE(audio != nullptr);
|
| + ASSERT_TRUE(audio->description.identity_fingerprint.get() == nullptr);
|
| audio->description.identity_fingerprint.reset(
|
| rtc::SSLFingerprint::CreateFromRfc4572(
|
| rtc::DIGEST_SHA_256, kFakeDtlsFingerprint));
|
| @@ -4153,7 +4155,7 @@ TEST_F(WebRtcSessionTest, TestCombinedAudioVideoBweConstraint) {
|
|
|
| voice_channel_ = media_engine_->GetVoiceChannel(0);
|
|
|
| - ASSERT_TRUE(voice_channel_ != NULL);
|
| + ASSERT_TRUE(voice_channel_ != nullptr);
|
| const cricket::AudioOptions& audio_options = voice_channel_->options();
|
| EXPECT_EQ(rtc::Optional<bool>(true), audio_options.combined_audio_video_bwe);
|
| }
|
| @@ -4243,8 +4245,8 @@ TEST_F(WebRtcSessionTest, TestRtxRemovedByCreateAnswer) {
|
| SendAudioVideoStream1();
|
| std::string offer_sdp(kSdpWithRtx);
|
|
|
| - SessionDescriptionInterface* offer =
|
| - CreateSessionDescription(JsepSessionDescription::kOffer, offer_sdp, NULL);
|
| + SessionDescriptionInterface* offer = CreateSessionDescription(
|
| + JsepSessionDescription::kOffer, offer_sdp, nullptr);
|
| EXPECT_TRUE(offer->ToString(&offer_sdp));
|
|
|
| // Offer SDP contains the RTX codec.
|
|
|