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

Unified Diff: webkit/tools/test_shell/test_shell_win.cc

Issue 14841004: Remove remaining references to test_shell_tests now that the bots have been updated. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 8 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 | « webkit/tools/test_shell/test_shell_switches.cc ('k') | webkit/tools/test_shell/test_webview_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « webkit/tools/test_shell/test_shell_switches.cc ('k') | webkit/tools/test_shell/test_webview_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698