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

Unified Diff: mojo/common/handle_watcher_unittest.cc

Issue 781753004: Fix handle_watcher when start is called twice on the same handle. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years 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
« mojo/common/handle_watcher.cc ('K') | « mojo/common/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/common/handle_watcher_unittest.cc
diff --git a/mojo/common/handle_watcher_unittest.cc b/mojo/common/handle_watcher_unittest.cc
index 3e879d28868b4e89cf3b5421a49a2544a169d30b..46d2a27c56232453b3a035ed6b122df0590f38cc 100644
--- a/mojo/common/handle_watcher_unittest.cc
+++ b/mojo/common/handle_watcher_unittest.cc
@@ -280,6 +280,22 @@ TEST_P(HandleWatcherTest, Restart) {
EXPECT_FALSE(callback_helper2.got_callback());
}
+// Verifies Start() invoked a second time on the same handle works.
+TEST_P(HandleWatcherTest, RestartOnSameHandle) {
+ MessagePipe test_pipe;
+ CallbackHelper callback_helper;
+ ASSERT_TRUE(test_pipe.handle0.is_valid());
+
+ HandleWatcher watcher;
+ callback_helper.Start(&watcher, test_pipe.handle0.get());
+ RunUntilIdle();
+ EXPECT_FALSE(callback_helper.got_callback());
+
+ callback_helper.Start(&watcher, test_pipe.handle0.get());
+ RunUntilIdle();
+ EXPECT_FALSE(callback_helper.got_callback());
+}
+
// Verifies deadline is honored.
TEST_P(HandleWatcherTest, Deadline) {
InstallTickClock();
« mojo/common/handle_watcher.cc ('K') | « mojo/common/handle_watcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698