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

Unified Diff: device/serial/serial_connection_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/data_source_sender.cc ('k') | device/serial/serial_service_unittest.cc » ('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 eb0ca272619fc2eb1e147514ab14ca6d6c44dd78..552bb3afda2681f4b7f5699c90cdd373d00d3bcd 100644
--- a/device/serial/serial_connection_unittest.cc
+++ b/device/serial/serial_connection_unittest.cc
@@ -16,7 +16,6 @@
#include "device/serial/serial_service_impl.h"
#include "device/serial/test_serial_io_handler.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/mojo/src/mojo/public/cpp/bindings/error_handler.h"
#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h"
#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
@@ -34,7 +33,7 @@ class FakeSerialDeviceEnumerator : public SerialDeviceEnumerator {
} // namespace
-class SerialConnectionTest : public testing::Test, public mojo::ErrorHandler {
+class SerialConnectionTest : public testing::Test {
public:
enum Event {
EVENT_NONE,
@@ -72,7 +71,8 @@ class SerialConnectionTest : public testing::Test, public mojo::ErrorHandler {
base::ThreadTaskRunnerHandle::Get()),
scoped_ptr<SerialDeviceEnumerator>(new FakeSerialDeviceEnumerator),
mojo::GetProxy(&service));
- service.set_error_handler(this);
+ service.set_connection_error_handler(base::Bind(
+ &SerialConnectionTest::OnConnectionError, base::Unretained(this)));
mojo::InterfacePtr<serial::DataSink> sink;
mojo::InterfacePtr<serial::DataSource> source;
mojo::InterfacePtr<serial::DataSourceClient> source_client;
@@ -86,7 +86,8 @@ class SerialConnectionTest : public testing::Test, public mojo::ErrorHandler {
receiver_ =
new DataReceiver(source.Pass(), source_client_request.Pass(),
kBufferSize, serial::RECEIVE_ERROR_DISCONNECTED);
- connection_.set_error_handler(this);
+ connection_.set_connection_error_handler(base::Bind(
+ &SerialConnectionTest::OnConnectionError, base::Unretained(this)));
connection_->GetInfo(
base::Bind(&SerialConnectionTest::StoreInfo, base::Unretained(this)));
WaitForEvent(EVENT_GOT_INFO);
@@ -169,7 +170,7 @@ class SerialConnectionTest : public testing::Test, public mojo::ErrorHandler {
EventReceived(EVENT_RECEIVE_ERROR);
}
- void OnConnectionError() override {
+ void OnConnectionError() {
EventReceived(EVENT_ERROR);
FAIL() << "Connection error";
}
« no previous file with comments | « device/serial/data_source_sender.cc ('k') | device/serial/serial_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698