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

Unified Diff: base/file_util_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/debug/trace_event_unittest.cc ('k') | base/lazy_instance_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_unittest.cc
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index 4cd6f03dd7f437cb30640f8c93d540b4c0467a02..0cade2ae6f07be030ff4c5056e5ddba8233c0da8 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -22,7 +22,6 @@
#include "base/path_service.h"
#include "base/scoped_temp_dir.h"
#include "base/threading/platform_thread.h"
-#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
@@ -349,11 +348,11 @@ TEST_F(FileUtilTest, FLAKY_CountFilesCreatedAfter) {
// Age to perfection
#if defined(OS_WIN)
- base::PlatformThread::Sleep(100);
+ base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100));
#elif defined(OS_POSIX)
// We need to wait at least one second here because the precision of
// file creation time is one second.
- base::PlatformThread::Sleep(1500);
+ base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1500));
#endif
// Establish our cutoff time
@@ -1250,9 +1249,9 @@ TEST_F(FileUtilTest, GetFileCreationLocalTime) {
SYSTEMTIME start_time;
GetLocalTime(&start_time);
- Sleep(100);
+ base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100));
CreateTextFile(file_name, L"New file!");
- Sleep(100);
+ base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100));
SYSTEMTIME end_time;
GetLocalTime(&end_time);
« no previous file with comments | « base/debug/trace_event_unittest.cc ('k') | base/lazy_instance_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698