Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Unified Diff: chrome/test/ui/ui_test.cc

Issue 140008: Add a switch to allow longer shutdown timeouts, since quitting under valgrind... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/ui/ui_test.h ('k') | tools/valgrind/chrome_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ui/ui_test.cc
===================================================================
--- chrome/test/ui/ui_test.cc (revision 18751)
+++ chrome/test/ui/ui_test.cc (working copy)
@@ -41,6 +41,8 @@
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 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 @@
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 @@
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 @@
// 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
« no previous file with comments | « chrome/test/ui/ui_test.h ('k') | tools/valgrind/chrome_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698