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

Unified Diff: mojo/edk/embedder/embedder_unittest.cc

Issue 1420533012: EDK: Make mojo::embedder::AsyncWait (etc.) take an std::function instead of a base::Callback. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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 | « mojo/edk/embedder/embedder.cc ('k') | mojo/edk/system/async_waiter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/embedder/embedder_unittest.cc
diff --git a/mojo/edk/embedder/embedder_unittest.cc b/mojo/edk/embedder/embedder_unittest.cc
index 066a1905546a7de5e3042cb7d04d329f0f9a49c4..3a3e7991e7e29d7de9c7e682197a12b5f639b531 100644
--- a/mojo/edk/embedder/embedder_unittest.cc
+++ b/mojo/edk/embedder/embedder_unittest.cc
@@ -243,8 +243,7 @@ TEST_F(EmbedderTest, AsyncWait) {
TestAsyncWaiter waiter;
EXPECT_EQ(MOJO_RESULT_OK,
AsyncWait(client_mp.get().value(), MOJO_HANDLE_SIGNAL_READABLE,
- base::Bind(&TestAsyncWaiter::Awake,
- base::Unretained(&waiter))));
+ [&waiter](MojoResult result) { waiter.Awake(result); }));
test_io_thread().PostTask(base::Bind(&WriteHello, server_mp.get()));
EXPECT_TRUE(waiter.TryWait());
@@ -254,8 +253,9 @@ TEST_F(EmbedderTest, AsyncWait) {
TestAsyncWaiter waiter_that_doesnt_wait;
EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
AsyncWait(client_mp.get().value(), MOJO_HANDLE_SIGNAL_READABLE,
- base::Bind(&TestAsyncWaiter::Awake,
- base::Unretained(&waiter_that_doesnt_wait))));
+ [&waiter_that_doesnt_wait](MojoResult result) {
+ waiter_that_doesnt_wait.Awake(result);
+ }));
char buffer[1000];
uint32_t num_bytes = static_cast<uint32_t>(sizeof(buffer));
@@ -266,8 +266,9 @@ TEST_F(EmbedderTest, AsyncWait) {
TestAsyncWaiter unsatisfiable_waiter;
EXPECT_EQ(MOJO_RESULT_OK,
AsyncWait(client_mp.get().value(), MOJO_HANDLE_SIGNAL_READABLE,
- base::Bind(&TestAsyncWaiter::Awake,
- base::Unretained(&unsatisfiable_waiter))));
+ [&unsatisfiable_waiter](MojoResult result) {
+ unsatisfiable_waiter.Awake(result);
+ }));
test_io_thread().PostTask(
base::Bind(&CloseScopedHandle, base::Passed(server_mp.Pass())));
« no previous file with comments | « mojo/edk/embedder/embedder.cc ('k') | mojo/edk/system/async_waiter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698