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

Unified Diff: shell/shell_test_base_unittest.cc

Issue 1219683015: Convert //shell/... to use set_connection_error_handler() instead of set_error_handler(). (Closed) Base URL: https://github.com/domokit/mojo.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 | « shell/child_process_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/shell_test_base_unittest.cc
diff --git a/shell/shell_test_base_unittest.cc b/shell/shell_test_base_unittest.cc
index 03d047df4fc6ea2081fc92638eb15bf0a42dda56..89461c05435e2b13d4e1eecba95713f733ff76b8 100644
--- a/shell/shell_test_base_unittest.cc
+++ b/shell/shell_test_base_unittest.cc
@@ -71,20 +71,6 @@ class ShellTestBaseTest : public ShellTestBase {
TestTrackedRequestServicePtr request_tracking_;
};
-class QuitMessageLoopErrorHandler : public mojo::ErrorHandler {
- public:
- QuitMessageLoopErrorHandler() {}
- ~QuitMessageLoopErrorHandler() override {}
-
- // |mojo::ErrorHandler| implementation:
- void OnConnectionError() override {
- base::MessageLoop::current()->QuitWhenIdle();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(QuitMessageLoopErrorHandler);
-};
-
// Tests that we can connect to a single service within a single app.
TEST_F(ShellTestBaseTest, ConnectBasic) {
TestServicePtr service;
@@ -119,8 +105,8 @@ TEST_F(ShellTestBaseTest, ConnectInvalidService) {
// It may have quit before an error was processed.
if (!test_service.encountered_error()) {
- QuitMessageLoopErrorHandler quitter;
- test_service.set_error_handler(&quitter);
+ test_service.set_connection_error_handler(
+ []() { base::MessageLoop::current()->QuitWhenIdle(); });
message_loop()->Run();
EXPECT_TRUE(test_service.encountered_error());
}
@@ -162,8 +148,8 @@ TEST_F(ShellTestBaseTest, DISABLED_ConnectInvalidServiceNetwork) {
TestServicePtr test_service;
ConnectToService(GURL("http://example.com/non_existent_service"),
&test_service);
- QuitMessageLoopErrorHandler quitter;
- test_service.set_error_handler(&quitter);
+ test_service.set_connection_error_handler(
+ []() { base::MessageLoop::current()->QuitWhenIdle(); });
bool was_run = false;
test_service->Ping(SetAndQuit<bool>(&was_run, true));
message_loop()->Run();
« no previous file with comments | « shell/child_process_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698