Title: [106126] trunk/Tools
Revision
106126
Author
[email protected]
Date
2012-01-27 09:54:13 -0800 (Fri, 27 Jan 2012)

Log Message

[Gtk] DumpRenderTree lacks --no-timeout command line option
https://bugs.webkit.org/show_bug.cgi?id=77196

Patch by Zan Dobersek <[email protected]> on 2012-01-27
Reviewed by Martin Robinson.

Add the --no-timeout command line option and reorganize
watchdog code to make running DumpRenderTree without
timeout possible.

* DumpRenderTree/gtk/DumpRenderTree.cpp:
(setWaitToDumpWatchdog):
(shouldSetWaitToDumpWatchdog):
(initializeGlobalsFromCommandLineOptions):
* DumpRenderTree/gtk/DumpRenderTreeGtk.h:
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
(waitToDumpWatchdogFired):
(LayoutTestController::setWaitToDump):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (106125 => 106126)


--- trunk/Tools/ChangeLog	2012-01-27 17:51:23 UTC (rev 106125)
+++ trunk/Tools/ChangeLog	2012-01-27 17:54:13 UTC (rev 106126)
@@ -1,3 +1,23 @@
+2012-01-27  Zan Dobersek  <[email protected]>
+
+        [Gtk] DumpRenderTree lacks --no-timeout command line option
+        https://bugs.webkit.org/show_bug.cgi?id=77196
+
+        Reviewed by Martin Robinson.
+
+        Add the --no-timeout command line option and reorganize
+        watchdog code to make running DumpRenderTree without
+        timeout possible.
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (setWaitToDumpWatchdog):
+        (shouldSetWaitToDumpWatchdog):
+        (initializeGlobalsFromCommandLineOptions):
+        * DumpRenderTree/gtk/DumpRenderTreeGtk.h:
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (waitToDumpWatchdogFired):
+        (LayoutTestController::setWaitToDump):
+
 2012-01-27  Andras Becsi  <[email protected]>
 
         [Qt][WK2] Enable the automatic touch->mouse mocking on the new Qt5 hashes

Modified: trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp (106125 => 106126)


--- trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp	2012-01-27 17:51:23 UTC (rev 106125)
+++ trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp	2012-01-27 17:54:13 UTC (rev 106126)
@@ -76,6 +76,7 @@
 static bool printSeparators;
 static int dumpPixels;
 static int dumpTree = 1;
+static int useTimeoutWatchdog = 1;
 
 AccessibilityController* axController = 0;
 RefPtr<LayoutTestController> gLayoutTestController;
@@ -368,6 +369,16 @@
         dumpBackForwardListForWebView(WEBKIT_WEB_VIEW(currentView->data));
 }
 
+void setWaitToDumpWatchdog(guint timer)
+{
+    waitToDumpWatchdog = timer;
+}
+
+bool shouldSetWaitToDumpWatchdog()
+{
+    return !waitToDumpWatchdog && useTimeoutWatchdog;
+}
+
 static void invalidateAnyPreviousWaitToDumpWatchdog()
 {
     if (waitToDumpWatchdog) {
@@ -487,6 +498,7 @@
         {"notree", no_argument, &dumpTree, false},
         {"pixel-tests", no_argument, &dumpPixels, true},
         {"tree", no_argument, &dumpTree, true},
+        {"no-timeout", no_argument, &useTimeoutWatchdog, false},
         {NULL, 0, NULL, 0}
     };
     

Modified: trunk/Tools/DumpRenderTree/gtk/DumpRenderTreeGtk.h (106125 => 106126)


--- trunk/Tools/DumpRenderTree/gtk/DumpRenderTreeGtk.h	2012-01-27 17:51:23 UTC (rev 106125)
+++ trunk/Tools/DumpRenderTree/gtk/DumpRenderTreeGtk.h	2012-01-27 17:54:13 UTC (rev 106126)
@@ -36,11 +36,13 @@
 
 extern WebKitWebFrame* mainFrame;
 extern WebKitWebFrame* topLoadingFrame;
-extern guint waitToDumpWatchdog;
 extern bool waitForPolicy;
 extern GSList* webViewList;
 
 gchar* JSStringCopyUTF8CString(JSStringRef jsString);
 CString getTopLevelPath();
 
+void setWaitToDumpWatchdog(guint timer);
+bool shouldSetWaitToDumpWatchdog();
+
 #endif // DumpRenderTreeGtk_h

Modified: trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp (106125 => 106126)


--- trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp	2012-01-27 17:51:23 UTC (rev 106125)
+++ trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp	2012-01-27 17:54:13 UTC (rev 106126)
@@ -373,7 +373,7 @@
 
 static gboolean waitToDumpWatchdogFired(void*)
 {
-    waitToDumpWatchdog = 0;
+    setWaitToDumpWatchdog(0);
     gLayoutTestController->waitToDumpWatchdogTimerFired();
     return FALSE;
 }
@@ -383,8 +383,8 @@
     static const int timeoutSeconds = 30;
 
     m_waitToDump = waitUntilDone;
-    if (m_waitToDump && !waitToDumpWatchdog)
-        waitToDumpWatchdog = g_timeout_add_seconds(timeoutSeconds, waitToDumpWatchdogFired, 0);
+    if (m_waitToDump && shouldSetWaitToDumpWatchdog())
+        setWaitToDumpWatchdog(g_timeout_add_seconds(timeoutSeconds, waitToDumpWatchdogFired, 0));
 }
 
 int LayoutTestController::windowCount()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to