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

Unified Diff: base/shared_memory_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/shared_memory_posix.cc ('k') | base/spin_wait.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/shared_memory_unittest.cc
diff --git a/base/shared_memory_unittest.cc b/base/shared_memory_unittest.cc
index ef5cf2e728491eb86d11f5c742b52d5eda10bf38..a0df9b5c8e43fd6d551a26999b938be4d7503264 100644
--- a/base/shared_memory_unittest.cc
+++ b/base/shared_memory_unittest.cc
@@ -58,7 +58,7 @@ class MultipleThreadMain : public PlatformThread::Delegate {
for (int idx = 0; idx < 100; idx++) {
*ptr = idx;
- PlatformThread::Sleep(1); // Short wait.
+ PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1));
EXPECT_EQ(*ptr, idx);
}
// Reset back to 0 for the next test that uses the same name.
@@ -113,7 +113,7 @@ class MultipleLockThread : public PlatformThread::Delegate {
memory2.Lock();
int i = (id_ << 16) + idx;
*ptr = i;
- PlatformThread::Sleep(1); // Short wait.
+ PlatformThread::Sleep(TimeDelta::FromMilliseconds(1));
EXPECT_EQ(*ptr, i);
memory2.Unlock();
}
@@ -388,7 +388,7 @@ class SharedMemoryProcessTest : public MultiProcessTest {
memory.Lock();
int i = (1 << 16) + idx;
*ptr = i;
- PlatformThread::Sleep(10); // Short wait.
+ PlatformThread::Sleep(TimeDelta::FromMilliseconds(10));
if (*ptr != i)
errors++;
memory.Unlock();
« no previous file with comments | « base/shared_memory_posix.cc ('k') | base/spin_wait.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698