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

Unified Diff: base/win/object_watcher_unittest.cc

Issue 868143004: Add an explicit ObjectWatcher::IsWatching() method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « base/win/object_watcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/object_watcher_unittest.cc
diff --git a/base/win/object_watcher_unittest.cc b/base/win/object_watcher_unittest.cc
index 46b98de524d3fd7af4789a93eda4f7fe2355cb4c..1a5e9e2a1a73e124e983c851b8b6cce5ea82dd82 100644
--- a/base/win/object_watcher_unittest.cc
+++ b/base/win/object_watcher_unittest.cc
@@ -37,7 +37,7 @@ void RunTest_BasicSignal(MessageLoop::Type message_loop_type) {
MessageLoop message_loop(message_loop_type);
ObjectWatcher watcher;
- EXPECT_EQ(NULL, watcher.GetWatchedObject());
+ EXPECT_FALSE(watcher.IsWatching());
// A manual-reset event that is not yet signaled.
HANDLE event = CreateEvent(NULL, TRUE, FALSE, NULL);
@@ -45,13 +45,14 @@ void RunTest_BasicSignal(MessageLoop::Type message_loop_type) {
QuitDelegate delegate;
bool ok = watcher.StartWatching(event, &delegate);
EXPECT_TRUE(ok);
+ EXPECT_TRUE(watcher.IsWatching());
EXPECT_EQ(event, watcher.GetWatchedObject());
SetEvent(event);
MessageLoop::current()->Run();
- EXPECT_EQ(NULL, watcher.GetWatchedObject());
+ EXPECT_FALSE(watcher.IsWatching());
CloseHandle(event);
}
@@ -115,7 +116,7 @@ void RunTest_SignalBeforeWatch(MessageLoop::Type message_loop_type) {
MessageLoop::current()->Run();
- EXPECT_EQ(NULL, watcher.GetWatchedObject());
+ EXPECT_FALSE(watcher.IsWatching());
CloseHandle(event);
}
« no previous file with comments | « base/win/object_watcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698