Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: webrtc/api/peerconnection_unittest.cc

Issue 1798173002: Helpers in peer connection unit tests: Use scoped_ptr instead of raw pointers (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/api/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnection_unittest.cc
diff --git a/webrtc/api/peerconnection_unittest.cc b/webrtc/api/peerconnection_unittest.cc
index 533b9dbc4272ba59d4f7bb19034463fb87a0a96c..6400655f9c4520177286ce3b9dc092717b473d1a 100644
--- a/webrtc/api/peerconnection_unittest.cc
+++ b/webrtc/api/peerconnection_unittest.cc
@@ -196,7 +196,7 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver,
void Negotiate(bool audio, bool video) {
rtc::scoped_ptr<SessionDescriptionInterface> offer;
- ASSERT_TRUE(DoCreateOffer(offer.use()));
+ ASSERT_TRUE(DoCreateOffer(&offer));
if (offer->description()->GetContentByName("audio")) {
offer->description()->GetContentByName("audio")->rejected = !audio;
@@ -831,7 +831,7 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver,
webrtc::CreateSessionDescription("offer", msg, nullptr));
EXPECT_TRUE(DoSetRemoteDescription(desc.release()));
rtc::scoped_ptr<SessionDescriptionInterface> answer;
- EXPECT_TRUE(DoCreateAnswer(answer.use()));
+ EXPECT_TRUE(DoCreateAnswer(&answer));
std::string sdp;
EXPECT_TRUE(answer->ToString(&sdp));
EXPECT_TRUE(DoSetLocalDescription(answer.release()));
@@ -848,7 +848,7 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver,
EXPECT_TRUE(DoSetRemoteDescription(desc.release()));
}
- bool DoCreateOfferAnswer(SessionDescriptionInterface** desc,
+ bool DoCreateOfferAnswer(rtc::scoped_ptr<SessionDescriptionInterface>* desc,
bool offer) {
rtc::scoped_refptr<MockCreateSessionDescriptionObserver>
observer(new rtc::RefCountedObject<
@@ -867,18 +867,18 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver,
}
}
EXPECT_EQ_WAIT(true, observer->called(), kMaxWaitMs);
- *desc = observer->release_desc();
+ desc->reset(observer->release_desc());
if (observer->result() && ExpectIceRestart()) {
EXPECT_EQ(0u, (*desc)->candidates(0)->count());
}
return observer->result();
}
- bool DoCreateOffer(SessionDescriptionInterface** desc) {
+ bool DoCreateOffer(rtc::scoped_ptr<SessionDescriptionInterface>* desc) {
return DoCreateOfferAnswer(desc, true);
}
- bool DoCreateAnswer(SessionDescriptionInterface** desc) {
+ bool DoCreateAnswer(rtc::scoped_ptr<SessionDescriptionInterface>* desc) {
return DoCreateOfferAnswer(desc, false);
}
« no previous file with comments | « no previous file | webrtc/api/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698