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..4d8904e49f92f4de15da6b3cbff475f8879d3ec5 100644 |
--- a/base/test/test_file_util_win.cc |
+++ b/base/test/test_file_util_win.cc |
@@ -63,7 +63,9 @@ 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 kIterations = 25; |
+ const base::TimeDelta kTimeout = base::TimeDelta::FromSeconds(10) / |
+ kIterations; |
if (!file_util::PathExists(file)) |
return true; |
@@ -71,10 +73,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 < kIterations; ++i) { |
if (file_util::Delete(file, recurse)) |
return true; |
- base::PlatformThread::Sleep(kTimeoutMs / 25); |
+ base::PlatformThread::Sleep(kTimeout); |
} |
return false; |
} |