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

Unified Diff: device/serial/serial_connection_unittest.cc

Issue 1874313002: Convert device to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 | « device/serial/serial_connection.cc ('k') | device/serial/serial_device_enumerator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/serial/serial_connection_unittest.cc
diff --git a/device/serial/serial_connection_unittest.cc b/device/serial/serial_connection_unittest.cc
index 3d5f51e9983e53e14e9ce884e904bcd20cfa6bac..35543bb3d170562b3b4627f30344b137d5ec1fab 100644
--- a/device/serial/serial_connection_unittest.cc
+++ b/device/serial/serial_connection_unittest.cc
@@ -5,6 +5,8 @@
#include "device/serial/serial_connection.h"
#include <stdint.h>
+
+#include <memory>
#include <string>
#include <utility>
@@ -73,7 +75,7 @@ class SerialConnectionTest : public testing::Test {
base::Bind(&SerialConnectionTest::CreateIoHandler,
base::Unretained(this)),
base::ThreadTaskRunnerHandle::Get()),
- scoped_ptr<SerialDeviceEnumerator>(new FakeSerialDeviceEnumerator),
+ std::unique_ptr<SerialDeviceEnumerator>(new FakeSerialDeviceEnumerator),
mojo::GetProxy(&service));
service.set_connection_error_handler(base::Bind(
&SerialConnectionTest::OnConnectionError, base::Unretained(this)));
@@ -163,7 +165,7 @@ class SerialConnectionTest : public testing::Test {
EventReceived(EVENT_SEND_ERROR);
}
- void OnDataReceived(scoped_ptr<ReadOnlyBuffer> buffer) {
+ void OnDataReceived(std::unique_ptr<ReadOnlyBuffer> buffer) {
data_received_ += std::string(buffer->GetData(), buffer->GetSize());
buffer->Done(buffer->GetSize());
receive_error_ = serial::ReceiveError::NONE;
@@ -191,10 +193,10 @@ class SerialConnectionTest : public testing::Test {
std::string data_received_;
Event expected_event_;
- scoped_ptr<base::MessageLoop> message_loop_;
+ std::unique_ptr<base::MessageLoop> message_loop_;
base::Closure stop_run_loop_;
mojo::InterfacePtr<serial::Connection> connection_;
- scoped_ptr<DataSender> sender_;
+ std::unique_ptr<DataSender> sender_;
scoped_refptr<DataReceiver> receiver_;
scoped_refptr<TestSerialIoHandler> io_handler_;
« no previous file with comments | « device/serial/serial_connection.cc ('k') | device/serial/serial_device_enumerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698