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

Unified Diff: shell/application_manager/application_manager_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/application_manager/application_manager.cc ('k') | shell/application_manager/shell_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/application_manager/application_manager_unittest.cc
diff --git a/shell/application_manager/application_manager_unittest.cc b/shell/application_manager/application_manager_unittest.cc
index b34668100062c57cbb4beee59669546625ce3b1f..31679673f8786a25454ccbb092360d4f3aa04740 100644
--- a/shell/application_manager/application_manager_unittest.cc
+++ b/shell/application_manager/application_manager_unittest.cc
@@ -46,20 +46,6 @@ void QuitClosure(bool* value) {
base::MessageLoop::current()->QuitWhenIdle();
}
-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);
-};
-
class TestServiceImpl : public TestService {
public:
TestServiceImpl(TestContext* context, InterfaceRequest<TestService> request)
@@ -741,8 +727,8 @@ TEST_F(ApplicationManagerTest, NoServiceNoLoad) {
// ApplicationManager, so this cannot succeed (but also shouldn't crash).
TestCPtr c;
application_manager_->ConnectToService(GURL(kTestAURLString), &c);
- QuitMessageLoopErrorHandler quitter;
- c.set_error_handler(&quitter);
+ c.set_connection_error_handler(
+ []() { base::MessageLoop::current()->QuitWhenIdle(); });
loop_.Run();
EXPECT_TRUE(c.encountered_error());
« no previous file with comments | « shell/application_manager/application_manager.cc ('k') | shell/application_manager/shell_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698