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

Unified Diff: mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc

Issue 2062333002: mojo::Callback -> base::Callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
Index: mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc b/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc
index 7f4bc4a21b3bb23c1a521eb3490aab92041bad76..59fed4f778ca1ab4104a576a69d67882978b5105 100644
--- a/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/multiplex_router_unittest.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "base/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
@@ -247,6 +248,11 @@ TEST_F(MultiplexRouterTest, LazyResponses) {
std::string(reinterpret_cast<const char*>(response.payload())));
}
+void ForwardErrorHandler(bool* called, const base::Closure& callback) {
+ *called = true;
+ callback.Run();
+}
+
// Tests that if the receiving application destroys the responder_ without
// sending a response, then we trigger connection error at both sides. Moreover,
// both sides still appear to have a valid message pipe handle bound.
@@ -257,10 +263,8 @@ TEST_F(MultiplexRouterTest, MissingResponses) {
false, base::ThreadTaskRunnerHandle::Get());
bool error_handler_called0 = false;
client0.set_connection_error_handler(
- [&error_handler_called0, &run_loop0]() {
- error_handler_called0 = true;
- run_loop0.Quit();
- });
+ base::Bind(&ForwardErrorHandler, &error_handler_called0,
+ run_loop0.QuitClosure()));
base::RunLoop run_loop3;
LazyResponseGenerator generator(run_loop3.QuitClosure());
@@ -269,10 +273,8 @@ TEST_F(MultiplexRouterTest, MissingResponses) {
false, base::ThreadTaskRunnerHandle::Get());
bool error_handler_called1 = false;
client1.set_connection_error_handler(
- [&error_handler_called1, &run_loop1]() {
- error_handler_called1 = true;
- run_loop1.Quit();
- });
+ base::Bind(&ForwardErrorHandler, &error_handler_called1,
+ run_loop1.QuitClosure()));
Message request;
AllocRequestMessage(1, "hello", &request);
« no previous file with comments | « mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc ('k') | mojo/public/cpp/bindings/tests/pickle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698