Index: base/test/test_file_util_win.cc |
diff --git a/base/test/test_file_util_win.cc b/base/test/test_file_util_win.cc |
index 90df710d22ccf6160e5c234c24399270eecd1d21..884a3afe195c80815afc246c0b1b2b21298d8e4b 100644 |
--- a/base/test/test_file_util_win.cc |
+++ b/base/test/test_file_util_win.cc |
@@ -63,7 +63,8 @@ bool DenyFilePermission(const FilePath& path, DWORD permission) { |
bool DieFileDie(const FilePath& file, bool recurse) { |
// It turns out that to not induce flakiness a long timeout is needed. |
- const int kTimeoutMs = 10000; |
+ const int iters = 25; |
Paweł Hajdan Jr.
2012/01/03 08:06:46
nit: No abbreviations, also if this is a constant
|
+ const base::TimeDelta kTimeout = base::TimeDelta::FromSeconds(10) / iters; |
if (!file_util::PathExists(file)) |
return true; |
@@ -71,10 +72,10 @@ bool DieFileDie(const FilePath& file, bool recurse) { |
// Sometimes Delete fails, so try a few more times. Divide the timeout |
// into short chunks, so that if a try succeeds, we won't delay the test |
// for too long. |
- for (int i = 0; i < 25; ++i) { |
+ for (int i = 0; i < iters; ++i) { |
if (file_util::Delete(file, recurse)) |
return true; |
- base::PlatformThread::Sleep(kTimeoutMs / 25); |
+ base::PlatformThread::Sleep(kTimeout); |
} |
return false; |
} |