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

Unified Diff: device/serial/serial_connection_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_connection_factory.cc ('k') | device/serial/serial_service_impl.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 00904b945aa4644d48aa6a4f8ae31db53120438c..39c15dba7dc0b63a41e71955c635dc7a868f15df 100644
--- a/device/serial/serial_connection_unittest.cc
+++ b/device/serial/serial_connection_unittest.cc
@@ -23,6 +23,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 {
@@ -70,12 +71,13 @@ class SerialConnectionTest : public testing::Test {
void SetUp() override {
message_loop_.reset(new base::MessageLoop);
mojo::InterfacePtr<serial::SerialService> service;
- new SerialServiceImpl(
- new SerialConnectionFactory(
- base::Bind(&SerialConnectionTest::CreateIoHandler,
- base::Unretained(this)),
- base::ThreadTaskRunnerHandle::Get()),
- std::unique_ptr<SerialDeviceEnumerator>(new FakeSerialDeviceEnumerator),
+ mojo::MakeStrongBinding(
+ base::MakeUnique<SerialServiceImpl>(
+ new SerialConnectionFactory(
+ base::Bind(&SerialConnectionTest::CreateIoHandler,
+ base::Unretained(this)),
+ base::ThreadTaskRunnerHandle::Get()),
+ base::MakeUnique<FakeSerialDeviceEnumerator>()),
mojo::GetProxy(&service));
service.set_connection_error_handler(base::Bind(
&SerialConnectionTest::OnConnectionError, base::Unretained(this)));
« no previous file with comments | « device/serial/serial_connection_factory.cc ('k') | device/serial/serial_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698