diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-19 16:35:54 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-19 16:35:54 +0000 |
commit | 84e1dff96238dfede15aed36ee2a9bf5a71dd9f9 (patch) | |
tree | f759071d37c3530bfe9a7a45d087a0c20c7f3091 | |
parent | dfa7406f877705d423d0fb63a9ea1a0001f0fbae (diff) | |
download | chromium_src-84e1dff96238dfede15aed36ee2a9bf5a71dd9f9.zip chromium_src-84e1dff96238dfede15aed36ee2a9bf5a71dd9f9.tar.gz chromium_src-84e1dff96238dfede15aed36ee2a9bf5a71dd9f9.tar.bz2 |
[GTTF] Make automation timeouts more sane.
Do not expose command execution timeout outside ui_test.cc. This way
people have less timeouts to choose from, which leaves less space
for confusion.
The option to manipulate the command execution timeout is still
available, because it's still used and makes sense.
Also updated misleading comments and names in ui_test.cc.
TEST=ui_tests
BUG=none
Review URL: http://codereview.chromium.org/1078003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42112 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/cookie_modal_dialog_uitest.cc | 2 | ||||
-rw-r--r-- | chrome/test/automated_ui_tests/automated_ui_test_base.cc | 2 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.cc | 14 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.h | 4 |
4 files changed, 9 insertions, 13 deletions
diff --git a/chrome/browser/cookie_modal_dialog_uitest.cc b/chrome/browser/cookie_modal_dialog_uitest.cc index 75f39a7..bcd204c 100644 --- a/chrome/browser/cookie_modal_dialog_uitest.cc +++ b/chrome/browser/cookie_modal_dialog_uitest.cc @@ -33,7 +33,7 @@ class CookieModalDialogTest : public UITest { bool modal_dialog_showing = false; MessageBoxFlags::DialogButton available_buttons; ASSERT_TRUE(automation()->WaitForAppModalDialog( - command_execution_timeout_ms())); + action_max_timeout_ms())); ASSERT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing, &available_buttons)); ASSERT_TRUE(modal_dialog_showing); diff --git a/chrome/test/automated_ui_tests/automated_ui_test_base.cc b/chrome/test/automated_ui_tests/automated_ui_test_base.cc index 946f3da..9665aa3 100644 --- a/chrome/test/automated_ui_tests/automated_ui_test_base.cc +++ b/chrome/test/automated_ui_tests/automated_ui_test_base.cc @@ -312,7 +312,7 @@ bool AutomatedUITestBase::Navigate(const GURL& url) { } bool did_timeout = false; AutomationMsg_NavigationResponseValues result = - tab->NavigateToURLWithTimeout(url, 1, command_execution_timeout_ms(), + tab->NavigateToURLWithTimeout(url, 1, action_max_timeout_ms(), &did_timeout); if (result != AUTOMATION_MSG_NAVIGATION_SUCCESS) { LogErrorMessage("navigation_failed"); diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 6e753b5..f4dbfb0 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -45,8 +45,8 @@ using base::TimeTicks; // Delay to let browser complete a requested action. static const int kWaitForActionMsec = 2000; static const int kWaitForActionMaxMsec = 10000; -// Delay to let the browser complete the test. -static const int kMaxTestExecutionTime = 30000; +// Command execution timeout passed to AutomationProxy. +static const int kCommandExecutionTimeout = 30000; // Delay to let the browser shut down before trying more brutal methods. static const int kWaitForTerminateMsec = 30000; @@ -111,7 +111,7 @@ UITestBase::UITestBase() enable_file_cookies_(true), profile_type_(UITestBase::DEFAULT_THEME), test_start_time_(base::Time::NowFromSystemTime()), - command_execution_timeout_ms_(kMaxTestExecutionTime), + command_execution_timeout_ms_(kCommandExecutionTimeout), action_timeout_ms_(kWaitForActionMsec), action_max_timeout_ms_(kWaitForActionMaxMsec), sleep_timeout_ms_(kWaitForActionMsec), @@ -137,7 +137,7 @@ UITestBase::UITestBase(MessageLoop::Type msg_loop_type) profile_type_(UITestBase::DEFAULT_THEME), test_start_time_(base::Time::NowFromSystemTime()), message_loop_(msg_loop_type), - command_execution_timeout_ms_(kMaxTestExecutionTime), + command_execution_timeout_ms_(kCommandExecutionTimeout), action_timeout_ms_(kWaitForActionMsec), action_max_timeout_ms_(kWaitForActionMaxMsec), sleep_timeout_ms_(kWaitForActionMsec), @@ -204,7 +204,7 @@ void UITestBase::InitializeTimeouts() { if (command_line.HasSwitch(kUiTestTimeout)) { std::wstring timeout_str = command_line.GetSwitchValue(kUiTestTimeout); int timeout = StringToInt(WideToUTF16Hack(timeout_str)); - command_execution_timeout_ms_ = std::max(kMaxTestExecutionTime, timeout); + command_execution_timeout_ms_ = std::max(kCommandExecutionTimeout, timeout); } if (command_line.HasSwitch(kUiTestActionTimeout)) { @@ -542,7 +542,7 @@ void UITestBase::NavigateToURLBlockUntilNavigationsComplete( bool is_timeout = true; EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab_proxy->NavigateToURLWithTimeout( - url, number_of_navigations, command_execution_timeout_ms(), + url, number_of_navigations, action_max_timeout_ms(), &is_timeout)) << url.spec(); ASSERT_FALSE(is_timeout) << url.spec(); } @@ -558,7 +558,7 @@ void UITestBase::NavigateToURLBlockUntilNavigationsComplete( bool is_timeout = true; EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab_proxy->NavigateToURLWithTimeout( - url, number_of_navigations, command_execution_timeout_ms(), + url, number_of_navigations, action_max_timeout_ms(), &is_timeout)) << url.spec(); ASSERT_FALSE(is_timeout) << url.spec(); } diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index 334e8b2..4d39a9c 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -411,10 +411,6 @@ class UITestBase { base::ProcessId browser_process_id() const { return process_id_; } // Timeout accessors. - int command_execution_timeout_ms() const { - return command_execution_timeout_ms_; - } - void set_command_execution_timeout_ms(int timeout) { command_execution_timeout_ms_ = timeout; } |