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

Unified Diff: device/serial/serial_service_unittest.cc

Issue 2326913003: Privatize StrongBinding lifetime management (Closed)
Patch Set: rebase Created 4 years, 3 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_service_impl.cc ('k') | device/usb/mojo/device_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/serial/serial_service_unittest.cc
diff --git a/device/serial/serial_service_unittest.cc b/device/serial/serial_service_unittest.cc
index 6a3a466d2186dfdd53ded9c1b7d8dea56527e683..7e4405a2be4409e5379803a1f3743679ffe6b6bb 100644
--- a/device/serial/serial_service_unittest.cc
+++ b/device/serial/serial_service_unittest.cc
@@ -15,6 +15,7 @@
#include "device/serial/test_serial_io_handler.h"
#include "mojo/public/cpp/bindings/interface_ptr.h"
#include "mojo/public/cpp/bindings/interface_request.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace device {
@@ -78,12 +79,13 @@ class SerialServiceTest : public testing::Test {
if (!io_handler_.get())
io_handler_ = new TestSerialIoHandler;
mojo::InterfacePtr<serial::SerialService> service;
- new SerialServiceImpl(
- new SerialConnectionFactory(
- base::Bind(&SerialServiceTest::ReturnIoHandler,
- base::Unretained(this)),
- base::ThreadTaskRunnerHandle::Get()),
- std::unique_ptr<SerialDeviceEnumerator>(new FakeSerialDeviceEnumerator),
+ mojo::MakeStrongBinding(
+ base::MakeUnique<SerialServiceImpl>(
+ new SerialConnectionFactory(
+ base::Bind(&SerialServiceTest::ReturnIoHandler,
+ base::Unretained(this)),
+ base::ThreadTaskRunnerHandle::Get()),
+ base::MakeUnique<FakeSerialDeviceEnumerator>()),
mojo::GetProxy(&service));
mojo::InterfacePtr<serial::Connection> connection;
mojo::InterfacePtr<serial::DataSink> sink;
« no previous file with comments | « device/serial/serial_service_impl.cc ('k') | device/usb/mojo/device_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698