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

Unified Diff: base/time/time_win_unittest.cc

Issue 1356743003: Revert of Check for CloseHandle failures even when not debugging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « base/threading/platform_thread_win.cc ('k') | base/win/object_watcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time/time_win_unittest.cc
diff --git a/base/time/time_win_unittest.cc b/base/time/time_win_unittest.cc
index 93b200b53575ee52b2bfae136fedf6b50e119bd3..75b237ed65da1a36f9f17c9da6ce0352113ac504 100644
--- a/base/time/time_win_unittest.cc
+++ b/base/time/time_win_unittest.cc
@@ -12,7 +12,6 @@
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
-#include "base/win/scoped_handle.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::Time;
@@ -87,17 +86,15 @@
// Setup
MockTimeTicks::InstallTicker();
g_rollover_test_start = CreateEvent(0, TRUE, FALSE, 0);
- // Since using _beginthreadex() (as opposed to _beginthread), make sure
- // CloseHandle is called.
- base::win::ScopedHandle threads[kThreads];
+ HANDLE threads[kThreads];
for (int index = 0; index < kThreads; index++) {
void* argument = reinterpret_cast<void*>(kChecks);
unsigned thread_id;
- threads[index].Set(reinterpret_cast<HANDLE>(
+ threads[index] = reinterpret_cast<HANDLE>(
_beginthreadex(NULL, 0, RolloverTestThreadMain, argument, 0,
- &thread_id)));
- EXPECT_EQ(true, threads[index].IsValid());
+ &thread_id));
+ EXPECT_NE((HANDLE)NULL, threads[index]);
}
// Start!
@@ -105,11 +102,14 @@
// Wait for threads to finish
for (int index = 0; index < kThreads; index++) {
- DWORD rv = WaitForSingleObject(threads[index].Get(), INFINITE);
+ DWORD rv = WaitForSingleObject(threads[index], INFINITE);
EXPECT_EQ(rv, WAIT_OBJECT_0);
+ // Since using _beginthreadex() (as opposed to _beginthread),
+ // an explicit CloseHandle() is supposed to be called.
+ CloseHandle(threads[index]);
}
- CHECK(::CloseHandle(g_rollover_test_start));
+ CloseHandle(g_rollover_test_start);
// Teardown
MockTimeTicks::UninstallTicker();
« no previous file with comments | « base/threading/platform_thread_win.cc ('k') | base/win/object_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698