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

Unified Diff: remoting/protocol/connection_unittest.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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 | « remoting/protocol/connection_to_host.h ('k') | remoting/protocol/content_description.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/connection_unittest.cc
diff --git a/remoting/protocol/connection_unittest.cc b/remoting/protocol/connection_unittest.cc
index 9f35abdf746c50c7cc9794eaef5b67b04ad801d1..f2a5d8cc32824af45be56aed911006c2ae5d45ec 100644
--- a/remoting/protocol/connection_unittest.cc
+++ b/remoting/protocol/connection_unittest.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "remoting/base/constants.h"
@@ -71,7 +72,7 @@ class TestScreenCapturer : public webrtc::DesktopCapturer {
}
void Capture(const webrtc::DesktopRegion& region) override {
// Return black 10x10 frame.
- scoped_ptr<webrtc::DesktopFrame> frame(
+ std::unique_ptr<webrtc::DesktopFrame> frame(
new webrtc::BasicDesktopFrame(webrtc::DesktopSize(100, 100)));
memset(frame->data(), 0, frame->stride() * frame->size().height());
frame->mutable_updated_region()->SetRect(
@@ -102,13 +103,13 @@ class ConnectionTest : public testing::Test,
// Create Connection objects.
if (is_using_webrtc()) {
host_connection_.reset(new WebrtcConnectionToClient(
- make_scoped_ptr(host_session_),
+ base::WrapUnique(host_session_),
TransportContext::ForTests(protocol::TransportRole::SERVER)));
client_connection_.reset(new WebrtcConnectionToHost());
} else {
host_connection_.reset(new IceConnectionToClient(
- make_scoped_ptr(host_session_),
+ base::WrapUnique(host_session_),
TransportContext::ForTests(protocol::TransportRole::SERVER),
message_loop_.task_runner()));
client_connection_.reset(new IceConnectionToHost());
@@ -187,13 +188,13 @@ class ConnectionTest : public testing::Test,
}
base::MessageLoopForIO message_loop_;
- scoped_ptr<base::RunLoop> run_loop_;
+ std::unique_ptr<base::RunLoop> run_loop_;
MockConnectionToClientEventHandler host_event_handler_;
MockClipboardStub host_clipboard_stub_;
MockHostStub host_stub_;
MockInputStub host_input_stub_;
- scoped_ptr<ConnectionToClient> host_connection_;
+ std::unique_ptr<ConnectionToClient> host_connection_;
FakeSession* host_session_; // Owned by |host_connection_|.
bool host_connected_ = false;
@@ -201,9 +202,9 @@ class ConnectionTest : public testing::Test,
MockClientStub client_stub_;
MockClipboardStub client_clipboard_stub_;
FakeVideoRenderer client_video_renderer_;
- scoped_ptr<ConnectionToHost> client_connection_;
+ std::unique_ptr<ConnectionToHost> client_connection_;
FakeSession* client_session_; // Owned by |client_connection_|.
- scoped_ptr<FakeSession> owned_client_session_;
+ std::unique_ptr<FakeSession> owned_client_session_;
bool client_connected_ = false;
private:
@@ -279,8 +280,9 @@ TEST_P(ConnectionTest, Events) {
TEST_P(ConnectionTest, Video) {
Connect();
- scoped_ptr<VideoStream> video_stream = host_connection_->StartVideoStream(
- make_scoped_ptr(new TestScreenCapturer()));
+ std::unique_ptr<VideoStream> video_stream =
+ host_connection_->StartVideoStream(
+ base::WrapUnique(new TestScreenCapturer()));
base::RunLoop run_loop;
« no previous file with comments | « remoting/protocol/connection_to_host.h ('k') | remoting/protocol/content_description.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698