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

Unified Diff: base/win/object_watcher_unittest.cc

Issue 1350493002: Check for CloseHandle failures even when not debugging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code tweaks Created 5 years, 3 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
Index: base/win/object_watcher_unittest.cc
diff --git a/base/win/object_watcher_unittest.cc b/base/win/object_watcher_unittest.cc
index b30ca41a4fe4d3f6cb37455a72ed57ed69d063e4..5498b5dab93b357098fbbd99c4bbc2fee8bc2954 100644
--- a/base/win/object_watcher_unittest.cc
+++ b/base/win/object_watcher_unittest.cc
@@ -52,7 +52,7 @@ void RunTest_BasicSignal(MessageLoop::Type message_loop_type) {
MessageLoop::current()->Run();
EXPECT_FALSE(watcher.IsWatching());
- CloseHandle(event);
+ CHECK(::CloseHandle(event));
}
void RunTest_BasicCancel(MessageLoop::Type message_loop_type) {
@@ -69,7 +69,7 @@ void RunTest_BasicCancel(MessageLoop::Type message_loop_type) {
watcher.StopWatching();
- CloseHandle(event);
+ CHECK(::CloseHandle(event));
}
void RunTest_CancelAfterSet(MessageLoop::Type message_loop_type) {
@@ -98,7 +98,7 @@ void RunTest_CancelAfterSet(MessageLoop::Type message_loop_type) {
// Our delegate should not have fired.
EXPECT_EQ(1, counter);
- CloseHandle(event);
+ CHECK(::CloseHandle(event));
}
void RunTest_SignalBeforeWatch(MessageLoop::Type message_loop_type) {
@@ -116,7 +116,7 @@ void RunTest_SignalBeforeWatch(MessageLoop::Type message_loop_type) {
MessageLoop::current()->Run();
EXPECT_FALSE(watcher.IsWatching());
- CloseHandle(event);
+ CHECK(::CloseHandle(event));
}
void RunTest_OutlivesMessageLoop(MessageLoop::Type message_loop_type) {
@@ -133,7 +133,7 @@ void RunTest_OutlivesMessageLoop(MessageLoop::Type message_loop_type) {
watcher.StartWatching(event, &delegate);
}
}
- CloseHandle(event);
+ CHECK(::CloseHandle(event));
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698