summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/tools/test_shell/test_shell.h8
-rw-r--r--webkit/tools/test_shell/test_shell_gtk.cc2
-rw-r--r--webkit/tools/test_shell/test_shell_mac.mm2
-rw-r--r--webkit/tools/test_shell/test_shell_win.cc2
4 files changed, 8 insertions, 6 deletions
diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h
index 72c0407..dfe64b3 100644
--- a/webkit/tools/test_shell/test_shell.h
+++ b/webkit/tools/test_shell/test_shell.h
@@ -242,9 +242,11 @@ public:
// Get the timeout for running a test.
static int GetLayoutTestTimeout() { return file_test_timeout_ms_; }
- // Get the timeout for running a test in seconds
- static int GetLayoutTestTimeoutInSeconds() {
- return file_test_timeout_ms_ / 1000;
+ // Get the timeout killing an unresponsive TestShell.
+ // Make it a bit longer than the regular timeout to avoid killing the
+ // TestShell process unless we really need to.
+ static int GetLayoutTestTimeoutForWatchDog() {
+ return file_test_timeout_ms_ + 1000;
}
#if defined(OS_WIN)
diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc
index 20afed9..5a7b4e8 100644
--- a/webkit/tools/test_shell/test_shell_gtk.cc
+++ b/webkit/tools/test_shell/test_shell_gtk.cc
@@ -439,7 +439,7 @@ void TestShell::WaitTestFinished() {
// Install an alarm signal handler that will kill us if we time out.
signal(SIGALRM, AlarmHandler);
- alarm(GetLayoutTestTimeoutInSeconds());
+ alarm(GetLayoutTestTimeoutForWatchDog() / 1000);
// TestFinished() will post a quit message to break this loop when the page
// finishes loading.
diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm
index b15d789..afe59b3 100644
--- a/webkit/tools/test_shell/test_shell_mac.mm
+++ b/webkit/tools/test_shell/test_shell_mac.mm
@@ -405,7 +405,7 @@ void TestShell::WaitTestFinished() {
// Windows multiplies by 2.5, but that causes us to run for far, far too
// long. We use the passed value and let the scripts flag override
// the value as needed.
- NSTimeInterval timeout_seconds = GetLayoutTestTimeoutInSeconds();
+ NSTimeInterval timeout_seconds = GetLayoutTestTimeoutForWatchDog() / 1000;
WatchDogTarget* watchdog = [[[WatchDogTarget alloc]
initWithTimeout:timeout_seconds] autorelease];
NSThread* thread = [[NSThread alloc] initWithTarget:watchdog
diff --git a/webkit/tools/test_shell/test_shell_win.cc b/webkit/tools/test_shell/test_shell_win.cc
index 7d2cf88..f2e518a 100644
--- a/webkit/tools/test_shell/test_shell_win.cc
+++ b/webkit/tools/test_shell/test_shell_win.cc
@@ -399,7 +399,7 @@ unsigned int __stdcall WatchDogThread(void *arg) {
return 0;
TestShell* shell = static_cast<TestShell*>(arg);
- DWORD timeout = static_cast<DWORD>(shell->GetLayoutTestTimeout() * 2.5);
+ DWORD timeout = static_cast<DWORD>(shell->GetLayoutTestTimeoutForWatchDog());
DWORD rv = WaitForSingleObject(shell->finished_event(), timeout);
if (rv == WAIT_TIMEOUT) {
// Print a warning to be caught by the layout-test script.