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

Unified Diff: device/serial/serial_service_unittest.cc

Issue 1212023004: Convert all usages of mojo::ErrorHandler in //device/serial to callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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_unittest.cc ('k') | no next file » | 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 a8f507e1cea8e0d2ea4c426634ae31a040666029..933267d7f247b00a7fed5cd446286908576a8d91 100644
--- a/device/serial/serial_service_unittest.cc
+++ b/device/serial/serial_service_unittest.cc
@@ -39,7 +39,7 @@ class FailToOpenIoHandler : public TestSerialIoHandler {
} // namespace
-class SerialServiceTest : public testing::Test, public mojo::ErrorHandler {
+class SerialServiceTest : public testing::Test {
public:
SerialServiceTest() : connected_(false), expecting_error_(false) {}
@@ -48,7 +48,7 @@ class SerialServiceTest : public testing::Test, public mojo::ErrorHandler {
StopMessageLoop();
}
- void OnConnectionError() override {
+ void OnConnectionError() {
StopMessageLoop();
EXPECT_TRUE(expecting_error_);
}
@@ -89,7 +89,8 @@ class SerialServiceTest : public testing::Test, public mojo::ErrorHandler {
service->Connect(path, serial::ConnectionOptions::New(),
mojo::GetProxy(&connection), mojo::GetProxy(&sink),
mojo::GetProxy(&source), source_client.Pass());
- connection.set_error_handler(this);
+ connection.set_connection_error_handler(base::Bind(
+ &SerialServiceTest::OnConnectionError, base::Unretained(this)));
expecting_error_ = !expecting_success;
connection->GetInfo(
base::Bind(&SerialServiceTest::OnGotInfo, base::Unretained(this)));
@@ -114,7 +115,8 @@ class SerialServiceTest : public testing::Test, public mojo::ErrorHandler {
TEST_F(SerialServiceTest, GetDevices) {
mojo::InterfacePtr<serial::SerialService> service;
SerialServiceImpl::Create(NULL, NULL, mojo::GetProxy(&service));
- service.set_error_handler(this);
+ service.set_connection_error_handler(base::Bind(
+ &SerialServiceTest::OnConnectionError, base::Unretained(this)));
mojo::Array<serial::DeviceInfoPtr> result;
service->GetDevices(
base::Bind(&SerialServiceTest::StoreDevices, base::Unretained(this)));
« no previous file with comments | « device/serial/serial_connection_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698