summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-19 20:49:40 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-19 20:49:40 +0000
commit04b74d13d927794495a1a3a1b89d67f85a104e12 (patch)
treeb9a5dc732659cada99a8e2d7f652749dbc583e6b /chrome
parent34da373d3e61abac19c011d4526fb9b7041cfca1 (diff)
downloadchromium_src-04b74d13d927794495a1a3a1b89d67f85a104e12.zip
chromium_src-04b74d13d927794495a1a3a1b89d67f85a104e12.tar.gz
chromium_src-04b74d13d927794495a1a3a1b89d67f85a104e12.tar.bz2
Add a switch to allow longer shutdown timeouts, since quitting under valgrind is very slow on the Mac.
BUG=none TEST=Most/all of the UI tests should pass on the Mac when run under valgrind. Review URL: http://codereview.chromium.org/140008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18849 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/test/ui/ui_test.cc16
-rw-r--r--chrome/test/ui/ui_test.h1
2 files changed, 15 insertions, 2 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index d994d5e..2ab0032 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -41,6 +41,8 @@ static const int kWaitForActionMsec = 2000;
static const int kWaitForActionMaxMsec = 10000;
// Delay to let the browser complete the test.
static const int kMaxTestExecutionTime = 30000;
+// Delay to let the browser shut down.
+static const int kWaitForTerminateMsec = 5000;
const wchar_t UITest::kFailedNoCrashService[] =
L"NOTE: This test is expected to fail if crash_service.exe is not "
@@ -68,6 +70,7 @@ 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 kUiTestTerminateTimeout[] = L"ui-test-terminate-timeout";
const wchar_t kExtraChromeFlagsSwitch[] = L"extra-chrome-flags";
@@ -111,7 +114,8 @@ UITest::UITest()
command_execution_timeout_ms_(kMaxTestExecutionTime),
action_timeout_ms_(kWaitForActionMsec),
action_max_timeout_ms_(kWaitForActionMaxMsec),
- sleep_timeout_ms_(kWaitForActionMsec) {
+ sleep_timeout_ms_(kWaitForActionMsec),
+ terminate_timeout_ms_(kWaitForTerminateMsec) {
PathService::Get(chrome::DIR_APP, &browser_directory_);
PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_);
}
@@ -199,6 +203,14 @@ void UITest::InitializeTimeouts() {
int sleep_timeout = StringToInt(WideToUTF16Hack(sleep_timeout_str));
sleep_timeout_ms_ = std::max(kWaitForActionMsec, sleep_timeout);
}
+
+ if (CommandLine::ForCurrentProcess()->HasSwitch(kUiTestTerminateTimeout)) {
+ std::wstring terminate_timeout_str =
+ CommandLine::ForCurrentProcess()->GetSwitchValue(
+ kUiTestTerminateTimeout);
+ int terminate_timeout = StringToInt(WideToUTF16Hack(terminate_timeout_str));
+ terminate_timeout_ms_ = std::max(kWaitForActionMsec, terminate_timeout);
+ }
}
AutomationProxy* UITest::CreateAutomationProxy(int execution_timeout) {
@@ -427,7 +439,7 @@ void UITest::QuitBrowser() {
// Wait for the browser process to quit. It should quit once all tabs have
// been closed.
- int timeout = 5000;
+ int timeout = terminate_timeout_ms_;
#ifdef WAIT_FOR_DEBUGGER_ON_OPEN
timeout = 500000;
#endif
diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h
index 4d778a6..2bd9538 100644
--- a/chrome/test/ui/ui_test.h
+++ b/chrome/test/ui/ui_test.h
@@ -503,6 +503,7 @@ class UITest : public testing::Test {
int action_timeout_ms_;
int action_max_timeout_ms_;
int sleep_timeout_ms_;
+ int terminate_timeout_ms_;
std::wstring ui_test_name_;
};