Index: webkit/tools/test_shell/test_shell_win.cc |
=================================================================== |
--- webkit/tools/test_shell/test_shell_win.cc (revision 197949) |
+++ webkit/tools/test_shell/test_shell_win.cc (working copy) |
@@ -367,75 +367,6 @@ |
return true; |
} |
-void TestShell::TestFinished() { |
- if (!test_is_pending_) |
- return; // reached when running under test_shell_tests |
- |
- test_is_pending_ = false; |
- |
- UINT_PTR timer_id = reinterpret_cast<UINT_PTR>(this); |
- KillTimer(mainWnd(), timer_id); |
- |
- MessageLoop::current()->Quit(); |
-} |
- |
-// Thread main to run for the thread which just tests for timeout. |
-unsigned int __stdcall WatchDogThread(void *arg) { |
- // If we're debugging a layout test, don't timeout. |
- if (::IsDebuggerPresent()) |
- return 0; |
- |
- TestShell* shell = static_cast<TestShell*>(arg); |
- 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. |
- // Note: the layout test driver may or may not recognize |
- // this as a timeout. |
- puts("#TEST_TIMED_OUT\n"); |
- puts("#EOF\n"); |
- fflush(stdout); |
- TerminateProcess(GetCurrentProcess(), 0); |
- } |
- // Finished normally. |
- return 0; |
-} |
- |
-void TestShell::WaitTestFinished() { |
- DCHECK(!test_is_pending_) << "cannot be used recursively"; |
- |
- test_is_pending_ = true; |
- |
- // Create a watchdog thread which just sets a timer and |
- // kills the process if it times out. This catches really |
- // bad hangs where the shell isn't coming back to the |
- // message loop. If the watchdog is what catches a |
- // timeout, it can't do anything except terminate the test |
- // shell, which is unfortunate. |
- finished_event_ = CreateEvent(NULL, TRUE, FALSE, NULL); |
- DCHECK(finished_event_ != NULL); |
- |
- HANDLE thread_handle = reinterpret_cast<HANDLE>(_beginthreadex( |
- NULL, |
- 0, |
- &WatchDogThread, |
- this, |
- 0, |
- 0)); |
- DCHECK(thread_handle != NULL); |
- |
- // TestFinished() will post a quit message to break this loop when the page |
- // finishes loading. |
- while (test_is_pending_) |
- MessageLoop::current()->Run(); |
- |
- // Tell the watchdog that we are finished. |
- SetEvent(finished_event_); |
- |
- // Wait to join the watchdog thread. (up to 1s, then quit) |
- WaitForSingleObject(thread_handle, 1000); |
-} |
- |
void TestShell::InteractiveSetFocus(WebWidgetHost* host, bool enable) { |
if (!enable && ::GetFocus() == host->view_handle()) |
::SetFocus(NULL); |