summaryrefslogtreecommitdiffstats
path: root/chrome/test/ui
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-16 21:20:30 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-16 21:20:30 +0000
commit4fc4ce130b4798c185124e6eb721068ee2cc670f (patch)
tree1d7aaaf843140444b2be2196071afab6305d0286 /chrome/test/ui
parent5040e1e453412c81319d6c9b9f603a82fb63fb2e (diff)
downloadchromium_src-4fc4ce130b4798c185124e6eb721068ee2cc670f.zip
chromium_src-4fc4ce130b4798c185124e6eb721068ee2cc670f.tar.gz
chromium_src-4fc4ce130b4798c185124e6eb721068ee2cc670f.tar.bz2
Moved the EvictFileFromSystemCacheWrapper function to the UITest class as we need this in other places.
Review URL: http://codereview.chromium.org/42238 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11779 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui')
-rw-r--r--chrome/test/ui/ui_test.cc9
-rw-r--r--chrome/test/ui/ui_test.h8
2 files changed, 17 insertions, 0 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index 0845b52..800f593 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -805,3 +805,12 @@ void UITest::PrintResultsImpl(const std::wstring& measurement,
trace.c_str(), prefix.c_str(), values.c_str(), suffix.c_str(),
units.c_str());
}
+
+bool UITest::EvictFileFromSystemCacheWrapper(const FilePath& path) {
+ for (int i = 0; i < 10; i++) {
+ if (file_util::EvictFileFromSystemCache(path))
+ return true;
+ PlatformThread::Sleep(1000);
+ }
+ return false;
+}
diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h
index 2bd3b9e..5587000 100644
--- a/chrome/test/ui/ui_test.h
+++ b/chrome/test/ui/ui_test.h
@@ -345,6 +345,14 @@ class UITest : public testing::Test {
const std::string& test_complete_cookie,
const std::string& expected_cookie_value,
const int wait_time);
+
+ // Wrapper around EvictFileFromSystemCache to retry 10 times in case of
+ // error.
+ // Apparently needed for Windows buildbots (to workaround an error when
+ // file is in use).
+ // TODO(phajdan.jr): Move to test_file_util if we need it in more places.
+ bool EvictFileFromSystemCacheWrapper(const FilePath& path);
+
private:
// Check that no processes related to Chrome exist, displaying
// the given message if any do.