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

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

Issue 1832193002: Mojo C++ bindings: refactor SyncHandleWatcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « mojo/public/cpp/bindings/lib/sync_handle_watcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/tests/sync_method_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/sync_method_unittest.cc b/mojo/public/cpp/bindings/tests/sync_method_unittest.cc
index f1a47674f5c5baa13afd86c0c1f42fb17d74bfe2..f64ba2da0f93a865fe9daabef4f89ed2e1d4d722 100644
--- a/mojo/public/cpp/bindings/tests/sync_method_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/sync_method_unittest.cc
@@ -366,13 +366,19 @@ TEST_F(SyncMethodTest, QueuedMessagesProcessedBeforeErrorNotification) {
});
bool async_echo_response_dispatched = false;
+ bool connection_error_dispatched = false;
base::RunLoop run_loop2;
- ptr->AsyncEcho(123,
- [&async_echo_response_dispatched, &run_loop2](int32_t result) {
- async_echo_response_dispatched = true;
- EXPECT_EQ(123, result);
- run_loop2.Quit();
- });
+ ptr->AsyncEcho(
+ 123, [&async_echo_response_dispatched, &connection_error_dispatched, &ptr,
+ &run_loop2](int32_t result) {
+ async_echo_response_dispatched = true;
+ // At this point, error notification should not be dispatched
+ // yet.
+ EXPECT_FALSE(connection_error_dispatched);
+ EXPECT_FALSE(ptr.encountered_error());
+ EXPECT_EQ(123, result);
+ run_loop2.Quit();
+ });
// Run until the AsyncEcho request reaches the service side.
run_loop1.Run();
@@ -386,7 +392,6 @@ TEST_F(SyncMethodTest, QueuedMessagesProcessedBeforeErrorNotification) {
impl.binding()->Close();
});
- bool connection_error_dispatched = false;
base::RunLoop run_loop3;
ptr.set_connection_error_handler(
[&connection_error_dispatched, &run_loop3]() {
@@ -408,8 +413,6 @@ TEST_F(SyncMethodTest, QueuedMessagesProcessedBeforeErrorNotification) {
run_loop2.Run();
EXPECT_TRUE(async_echo_response_dispatched);
- ASSERT_FALSE(connection_error_dispatched);
- EXPECT_FALSE(ptr.encountered_error());
// Run until the error notification is dispatched.
run_loop3.Run();
« no previous file with comments | « mojo/public/cpp/bindings/lib/sync_handle_watcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698