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

Unified Diff: base/threading/watchdog_unittest.cc

Issue 9055001: Change code in base (primarily unit tests) to use Sleep(TimeDelta). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Qualify windows Sleep calls to go through PlatformThread. Created 9 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
« no previous file with comments | « base/threading/thread_unittest.cc ('k') | base/time_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/watchdog_unittest.cc
diff --git a/base/threading/watchdog_unittest.cc b/base/threading/watchdog_unittest.cc
index f96487b4dad414d4677374eb1eebaf01ae4a2afd..ed4cac98e14c09d2a5ffb397ccf4dfbd6a935854 100644
--- a/base/threading/watchdog_unittest.cc
+++ b/base/threading/watchdog_unittest.cc
@@ -99,7 +99,7 @@ TEST_F(WatchdogTest, ConstructorDisabledTest) {
WatchdogCounter watchdog(TimeDelta::FromMilliseconds(10), "Disabled", false);
watchdog.Arm();
// Alarm should not fire, as it was disabled.
- PlatformThread::Sleep(500);
+ PlatformThread::Sleep(TimeDelta::FromMilliseconds(500));
EXPECT_EQ(0, watchdog.alarm_counter());
}
@@ -109,7 +109,8 @@ TEST_F(WatchdogTest, DisarmTest) {
TimeTicks start = TimeTicks::Now();
watchdog.Arm();
- PlatformThread::Sleep(100); // Sleep a bit, but not past the alarm point.
+ // Sleep a bit, but not past the alarm point.
+ PlatformThread::Sleep(TimeDelta::FromMilliseconds(100));
watchdog.Disarm();
TimeTicks end = TimeTicks::Now();
@@ -124,7 +125,7 @@ TEST_F(WatchdogTest, DisarmTest) {
// Sleep past the point where it would have fired if it wasn't disarmed,
// and verify that it didn't fire.
- PlatformThread::Sleep(1000);
+ PlatformThread::Sleep(TimeDelta::FromSeconds(1));
EXPECT_EQ(0, watchdog.alarm_counter());
// ...but even after disarming, we can still use the alarm...
« no previous file with comments | « base/threading/thread_unittest.cc ('k') | base/time_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698