Title: [107171] trunk/Tools
Revision
107171
Author
[email protected]
Date
2012-02-08 20:04:54 -0800 (Wed, 08 Feb 2012)

Log Message

[Qt][DRT] DumpRenderTreeQt should support --no-timeout and --timeout options
https://bugs.webkit.org/show_bug.cgi?id=78146

Patch by Jesus Sanchez-Palencia <[email protected]> on 2012-02-08
Reviewed by Ryosuke Niwa.

Our DumpRenderTree should support --no-timeout and --timeout options in order
to be able to use run-perf-tests and have a Performance Bot.
This patch adds setTimeout and setShouldTimeout functions to our LayoutTestController
and the necessary code to handle such command line arguments to our DumpRenderTree.

* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::DumpRenderTree::setTimeout):
(WebCore):
(WebCore::DumpRenderTree::setShouldTimeout):
* DumpRenderTree/qt/DumpRenderTreeQt.h:
(DumpRenderTree):
* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
(LayoutTestController::LayoutTestController):
(LayoutTestController::waitUntilDone):
(LayoutTestController::notifyDone):
* DumpRenderTree/qt/LayoutTestControllerQt.h:
(LayoutTestController::setTimeout):
(LayoutTestController::setShouldTimeout):
(LayoutTestController):
* DumpRenderTree/qt/main.cpp:
(isOption):
(printUsage):
(main):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (107170 => 107171)


--- trunk/Tools/ChangeLog	2012-02-09 03:34:29 UTC (rev 107170)
+++ trunk/Tools/ChangeLog	2012-02-09 04:04:54 UTC (rev 107171)
@@ -1,3 +1,34 @@
+2012-02-08  Jesus Sanchez-Palencia  <[email protected]>
+
+        [Qt][DRT] DumpRenderTreeQt should support --no-timeout and --timeout options
+        https://bugs.webkit.org/show_bug.cgi?id=78146
+
+        Reviewed by Ryosuke Niwa.
+
+        Our DumpRenderTree should support --no-timeout and --timeout options in order
+        to be able to use run-perf-tests and have a Performance Bot.
+        This patch adds setTimeout and setShouldTimeout functions to our LayoutTestController
+        and the necessary code to handle such command line arguments to our DumpRenderTree.
+
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::DumpRenderTree::setTimeout):
+        (WebCore):
+        (WebCore::DumpRenderTree::setShouldTimeout):
+        * DumpRenderTree/qt/DumpRenderTreeQt.h:
+        (DumpRenderTree):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::LayoutTestController):
+        (LayoutTestController::waitUntilDone):
+        (LayoutTestController::notifyDone):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+        (LayoutTestController::setTimeout):
+        (LayoutTestController::setShouldTimeout):
+        (LayoutTestController):
+        * DumpRenderTree/qt/main.cpp:
+        (isOption):
+        (printUsage):
+        (main):
+
 2012-02-08  Gustavo Noronha Silva  <[email protected]>
 
         Rubber-stamped by Martin Robinson.

Modified: trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp (107170 => 107171)


--- trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp	2012-02-09 03:34:29 UTC (rev 107170)
+++ trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp	2012-02-09 04:04:54 UTC (rev 107171)
@@ -1138,4 +1138,14 @@
     return pages;
 }
 
+void DumpRenderTree::setTimeout(int timeout)
+{
+    m_controller->setTimeout(timeout);
 }
+
+void DumpRenderTree::setShouldTimeout(bool flag)
+{
+    m_controller->setShouldTimeout(flag);
+}
+
+}

Modified: trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h (107170 => 107171)


--- trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h	2012-02-09 03:34:29 UTC (rev 107170)
+++ trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h	2012-02-09 04:04:54 UTC (rev 107171)
@@ -106,6 +106,9 @@
     void setRedirectOutputFileName(const QString& fileName) { m_redirectOutputFileName = fileName; }
     void setRedirectErrorFileName(const QString& fileName) { m_redirectErrorFileName = fileName; }
 
+    void setTimeout(int);
+    void setShouldTimeout(bool flag);
+
 public Q_SLOTS:
     void initJSObjects();
 

Modified: trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp (107170 => 107171)


--- trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp	2012-02-09 03:34:29 UTC (rev 107170)
+++ trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp	2012-02-09 04:04:54 UTC (rev 107171)
@@ -41,6 +41,8 @@
 LayoutTestController::LayoutTestController(WebCore::DumpRenderTree* drt)
     : QObject()
     , m_drt(drt)
+    , m_shouldTimeout(true)
+    , m_timeout(30000)
 {
     reset();
     DumpRenderTreeSupportQt::dumpNotification(true);
@@ -146,7 +148,11 @@
 {
     //qDebug() << ">>>>waitForDone";
     m_waitForDone = true;
-    m_timeoutTimer.start(30000, this);
+
+    if (!m_shouldTimeout)
+        return;
+
+    m_timeoutTimer.start(m_timeout, this);
 }
 
 QString LayoutTestController::counterValueForElementById(const QString& id)
@@ -178,7 +184,7 @@
 {
     qDebug() << ">>>>notifyDone";
 
-    if (!m_timeoutTimer.isActive())
+    if (m_shouldTimeout && !m_timeoutTimer.isActive())
         return;
 
     m_timeoutTimer.stop();

Modified: trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h (107170 => 107171)


--- trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h	2012-02-09 03:34:29 UTC (rev 107170)
+++ trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h	2012-02-09 04:04:54 UTC (rev 107171)
@@ -80,6 +80,9 @@
     static const unsigned int maxViewWidth;
     static const unsigned int maxViewHeight;
 
+    void setTimeout(int timeout) { m_timeout = timeout; }
+    void setShouldTimeout(bool flag) { m_shouldTimeout = flag; }
+
 protected:
     void timerEvent(QTimerEvent*);
 
@@ -317,6 +320,9 @@
     QWebHistory* m_webHistory;
     QStringList m_desktopNotificationAllowedOrigins;
     bool m_ignoreDesktopNotification;
+
+    bool m_shouldTimeout;
+    int m_timeout;
 };
 
 #endif // LayoutTestControllerQt_h

Modified: trunk/Tools/DumpRenderTree/qt/main.cpp (107170 => 107171)


--- trunk/Tools/DumpRenderTree/qt/main.cpp	2012-02-09 03:34:29 UTC (rev 107170)
+++ trunk/Tools/DumpRenderTree/qt/main.cpp	2012-02-09 04:04:54 UTC (rev 107171)
@@ -73,6 +73,7 @@
 {
     return str == QString("-v") || str == QString("--pixel-tests")
            || str == QString("--stdout") || str == QString("--stderr")
+           || str == QString("--timeout") || str == QString("--no-timeout")
            || str == QString("-");
 }
 
@@ -89,7 +90,7 @@
 
 void printUsage()
 {
-    fprintf(stderr, "Usage: DumpRenderTree [-v|--pixel-tests] [--stdout output_filename] [-stderr error_filename] filename [filename2..n]\n");
+    fprintf(stderr, "Usage: DumpRenderTree [-v|--pixel-tests] [--stdout output_filename] [-stderr error_filename] [--no-timeout] [--timeout timeout_MS] filename [filename2..n]\n");
     fprintf(stderr, "Or folder containing test files: DumpRenderTree [-v|--pixel-tests] dirpath\n");
     fflush(stderr);
 }
@@ -213,6 +214,19 @@
     }
     QWebDatabase::removeAllDatabases();
 
+    index = args.indexOf(QLatin1String("--timeout"));
+    if (index != -1) {
+        int timeout = takeOptionValue(args, index).toInt();
+        dumper.setTimeout(timeout);
+        args.removeAt(index);
+    }
+
+    index = args.indexOf(QLatin1String("--no-timeout"));
+    if (index != -1) {
+        dumper.setShouldTimeout(false);
+        args.removeAt(index);
+    }
+
     index = args.indexOf(QLatin1String("-"));
     if (index != -1) {
         args.removeAt(index);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to