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

Unified Diff: services/shell/tests/shutdown/shutdown_client_app.cc

Issue 2135223002: Use spin runloop instead of WaitForIncomingMethodCall() for test codes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase only Created 4 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 | « components/arc/test/fake_arc_bridge_instance.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/shell/tests/shutdown/shutdown_client_app.cc
diff --git a/services/shell/tests/shutdown/shutdown_client_app.cc b/services/shell/tests/shutdown/shutdown_client_app.cc
index a7f630f5d8c9b332f559f3f760234fb65e912fb5..21bf737e1e1d95fc3f1011b3c43cf0ce0dbf6f22 100644
--- a/services/shell/tests/shutdown/shutdown_client_app.cc
+++ b/services/shell/tests/shutdown/shutdown_client_app.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/macros.h"
+#include "base/run_loop.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/bindings/binding_set.h"
#include "services/shell/public/cpp/application_runner.h"
@@ -52,7 +53,12 @@ class ShutdownClientApp
service->SetClient(std::move(client_ptr));
- client_binding.WaitForIncomingMethodCall();
+ base::MessageLoop::ScopedNestableTaskAllower nestable_allower(
+ base::MessageLoop::current());
+ base::RunLoop run_loop;
+ client_binding.set_connection_error_handler(run_loop.QuitClosure());
+ run_loop.Run();
+
callback.Run();
}
« no previous file with comments | « components/arc/test/fake_arc_bridge_instance.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698