diff options
author | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-15 19:31:27 +0000 |
---|---|---|
committer | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-15 19:31:27 +0000 |
commit | 0c3b34140b507de0364b054931a148322b9eecdc (patch) | |
tree | 2aa9125983c41369ed92ef78837919853145ca2e | |
parent | 698379da494963bbe211d6b7a69aa28dc0bcedec (diff) | |
download | chromium_src-0c3b34140b507de0364b054931a148322b9eecdc.zip chromium_src-0c3b34140b507de0364b054931a148322b9eecdc.tar.gz chromium_src-0c3b34140b507de0364b054931a148322b9eecdc.tar.bz2 |
Add a sleep timeout argument to the ui_test scripts. This will
allow tests that use inline calls to Sleep() to not delay too
long when running under Purify.
Review URL: http://codereview.chromium.org/18260
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8107 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/test/ui/ui_test.cc | 11 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.h | 3 | ||||
-rw-r--r-- | tools/purify/chrome_tests.py | 3 |
3 files changed, 15 insertions, 2 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 02bc890..b35305d 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -68,6 +68,7 @@ std::wstring UITest::js_flags_ = L""; const wchar_t kUiTestTimeout[] = L"ui-test-timeout"; const wchar_t kUiTestActionTimeout[] = L"ui-test-action-timeout"; const wchar_t kUiTestActionMaxTimeout[] = L"ui-test-action-max-timeout"; +const wchar_t kUiTestSleepTimeout[] = L"ui-test-sleep-timeout"; const wchar_t kExtraChromeFlagsSwitch[] = L"extra-chrome-flags"; @@ -103,7 +104,8 @@ UITest::UITest() use_existing_browser_(default_use_existing_browser_), command_execution_timeout_ms_(kMaxTestExecutionTime), action_timeout_ms_(kWaitForActionMsec), - action_max_timeout_ms_(kWaitForActionMaxMsec) { + action_max_timeout_ms_(kWaitForActionMaxMsec), + sleep_timeout_ms_(kWaitForActionMsec) { PathService::Get(chrome::DIR_APP, &browser_directory_); PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_); #if defined(OS_WIN) @@ -193,6 +195,13 @@ void UITest::InitializeTimeouts() { int max_timeout = StringToInt(action_max_str); action_max_timeout_ms_ = std::max(kWaitForActionMaxMsec, max_timeout); } + + if (CommandLine().HasSwitch(kUiTestSleepTimeout)) { + std::wstring sleep_timeout_str = + CommandLine().GetSwitchValue(kUiTestSleepTimeout); + int sleep_timeout = StringToInt(sleep_timeout_str); + sleep_timeout_ms_ = std::max(kWaitForActionMsec, sleep_timeout); + } } void UITest::LaunchBrowserAndServer() { diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index 1d36d29..7baeb60 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -320,6 +320,8 @@ class UITest : public testing::Test { int action_max_timeout_ms() const { return action_max_timeout_ms_; } + int sleep_timeout_ms() const { return sleep_timeout_ms_; } + std::wstring ui_test_name() const { return ui_test_name_; } // Count the number of active browser processes. This function only counts @@ -453,6 +455,7 @@ class UITest : public testing::Test { int command_execution_timeout_ms_; int action_timeout_ms_; int action_max_timeout_ms_; + int sleep_timeout_ms_; std::wstring ui_test_name_; }; diff --git a/tools/purify/chrome_tests.py b/tools/purify/chrome_tests.py index 04c44bb..78f675e 100644 --- a/tools/purify/chrome_tests.py +++ b/tools/purify/chrome_tests.py @@ -296,7 +296,8 @@ class ChromeTests: "--single-process", "--ui-test-timeout=180000", "--ui-test-action-timeout=80000", - "--ui-test-action-max-timeout=180000"], + "--ui-test-action-max-timeout=180000", + "--ui-test-sleep-timeout=40000"], multi=True) |