| 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);
|
|
|