diff options
author | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-16 02:57:22 +0000 |
---|---|---|
committer | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-16 02:57:22 +0000 |
commit | 7fb087e0800d0faaa31e4a029ad6813f251b4848 (patch) | |
tree | 2076a41c5df464dda2709950cde1c4b4786280ed /chrome/test/ui | |
parent | f643bc141744031f1e3b304f753dd3837e6600eb (diff) | |
download | chromium_src-7fb087e0800d0faaa31e4a029ad6813f251b4848.zip chromium_src-7fb087e0800d0faaa31e4a029ad6813f251b4848.tar.gz chromium_src-7fb087e0800d0faaa31e4a029ad6813f251b4848.tar.bz2 |
Remove timeout constants from ui_tests. All tests will now
use accessors for various timeouts which can be set (via
command line parameters) to values appropriate to the test
environment, such as longer timeouts when running under purify.
Review URL: http://codereview.chromium.org/18109
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8164 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui')
-rw-r--r-- | chrome/test/ui/ui_test.cc | 14 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.h | 16 |
2 files changed, 12 insertions, 18 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index b35305d..3393d69 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -38,10 +38,10 @@ using base::TimeTicks; // Delay to let browser complete a requested action. -const int UITest::kWaitForActionMsec = 2000; -const int UITest::kWaitForActionMaxMsec = 10000; +static const int kWaitForActionMsec = 2000; +static const int kWaitForActionMaxMsec = 10000; // Delay to let the browser complete the test. -const int UITest::kMaxTestExecutionTime = 30000; +static const int kMaxTestExecutionTime = 30000; const wchar_t UITest::kFailedNoCrashService[] = L"NOTE: This test is expected to fail if crash_service.exe is not " @@ -85,7 +85,7 @@ bool UITest::DieFileDie(const std::wstring& file, bool recurse) { for (int i = 0; i < 10; ++i) { if (file_util::Delete(file, recurse)) return true; - PlatformThread::Sleep(kWaitForActionMaxMsec / 10); + PlatformThread::Sleep(action_max_timeout_ms() / 10); } return false; } @@ -520,7 +520,7 @@ bool UITest::WaitForFindWindowVisibilityChange(TabProxy* tab, return true; // Find window visibility change complete. // Give it a chance to catch up. - Sleep(kWaitForActionMaxMsec / kCycles); + Sleep(sleep_timeout_ms() / kCycles); } return false; } @@ -537,7 +537,7 @@ bool UITest::WaitForBookmarkBarVisibilityChange(BrowserProxy* browser, return true; // Bookmark bar visibility change complete. // Give it a chance to catch up. - Sleep(kWaitForActionMaxMsec / kCycles); + Sleep(sleep_timeout_ms() / kCycles); } return false; } @@ -671,7 +671,7 @@ std::string UITest::WaitUntilCookieNonEmpty(TabProxy* tab, void UITest::WaitUntilTabCount(int tab_count) { for (int i = 0; i < 10; ++i) { - Sleep(kWaitForActionMaxMsec / 10); + Sleep(sleep_timeout_ms() / 10); if (GetTabCount() == tab_count) break; } diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index 7baeb60..7f6c906 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -45,21 +45,10 @@ class TabProxy; class UITest : public testing::Test { protected: - // Delay to let browser complete a requested action. - static const int kWaitForActionMsec; - static const int kWaitForActionMaxMsec; - // Delay to let the browser complete the test. - static const int kMaxTestExecutionTime; - // String to display when a test fails because the crash service isn't // running. static const wchar_t kFailedNoCrashService[]; - // Tries to delete the specified file/directory returning true on success. - // This differs from file_util::Delete in that it repeatedly invokes Delete - // until successful, or a timeout is reached. Returns true on success. - static bool DieFileDie(const std::wstring& file, bool recurse); - // Constructor UITest(); @@ -75,6 +64,11 @@ class UITest : public testing::Test { // ********* Utility functions ********* + // Tries to delete the specified file/directory returning true on success. + // This differs from file_util::Delete in that it repeatedly invokes Delete + // until successful, or a timeout is reached. Returns true on success. + bool DieFileDie(const std::wstring& file, bool recurse); + // Launches the browser and IPC testing server. void LaunchBrowserAndServer(); |