⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 107171 in webkit


Ignore:
Timestamp:
Feb 8, 2012, 8:04:54 PM (15 years ago)
Author:
commit-queue@webkit.org
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 <jesus.palencia@openbossa.org> 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):

Location:
trunk/Tools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r107165 r107171  
     12012-02-08  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
     2
     3        [Qt][DRT] DumpRenderTreeQt should support --no-timeout and --timeout options
     4        https://bugs.webkit.org/show_bug.cgi?id=78146
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Our DumpRenderTree should support --no-timeout and --timeout options in order
     9        to be able to use run-perf-tests and have a Performance Bot.
     10        This patch adds setTimeout and setShouldTimeout functions to our LayoutTestController
     11        and the necessary code to handle such command line arguments to our DumpRenderTree.
     12
     13        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
     14        (WebCore::DumpRenderTree::setTimeout):
     15        (WebCore):
     16        (WebCore::DumpRenderTree::setShouldTimeout):
     17        * DumpRenderTree/qt/DumpRenderTreeQt.h:
     18        (DumpRenderTree):
     19        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
     20        (LayoutTestController::LayoutTestController):
     21        (LayoutTestController::waitUntilDone):
     22        (LayoutTestController::notifyDone):
     23        * DumpRenderTree/qt/LayoutTestControllerQt.h:
     24        (LayoutTestController::setTimeout):
     25        (LayoutTestController::setShouldTimeout):
     26        (LayoutTestController):
     27        * DumpRenderTree/qt/main.cpp:
     28        (isOption):
     29        (printUsage):
     30        (main):
     31
    1322012-02-08  Gustavo Noronha Silva  <gns@gnome.org>
    233
  • trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp

    r105876 r107171  
    11391139}
    11401140
    1141 }
     1141void DumpRenderTree::setTimeout(int timeout)
     1142{
     1143    m_controller->setTimeout(timeout);
     1144}
     1145
     1146void DumpRenderTree::setShouldTimeout(bool flag)
     1147{
     1148    m_controller->setShouldTimeout(flag);
     1149}
     1150
     1151}
  • trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h

    r105876 r107171  
    107107    void setRedirectErrorFileName(const QString& fileName) { m_redirectErrorFileName = fileName; }
    108108
     109    void setTimeout(int);
     110    void setShouldTimeout(bool flag);
     111
    109112public Q_SLOTS:
    110113    void initJSObjects();
  • trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp

    r106438 r107171  
    4242    : QObject()
    4343    , m_drt(drt)
     44    , m_shouldTimeout(true)
     45    , m_timeout(30000)
    4446{
    4547    reset();
     
    147149    //qDebug() << ">>>>waitForDone";
    148150    m_waitForDone = true;
    149     m_timeoutTimer.start(30000, this);
     151
     152    if (!m_shouldTimeout)
     153        return;
     154
     155    m_timeoutTimer.start(m_timeout, this);
    150156}
    151157
     
    179185    qDebug() << ">>>>notifyDone";
    180186
    181     if (!m_timeoutTimer.isActive())
     187    if (m_shouldTimeout && !m_timeoutTimer.isActive())
    182188        return;
    183189
  • trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h

    r106438 r107171  
    8080    static const unsigned int maxViewWidth;
    8181    static const unsigned int maxViewHeight;
     82
     83    void setTimeout(int timeout) { m_timeout = timeout; }
     84    void setShouldTimeout(bool flag) { m_shouldTimeout = flag; }
    8285
    8386protected:
     
    318321    QStringList m_desktopNotificationAllowedOrigins;
    319322    bool m_ignoreDesktopNotification;
     323
     324    bool m_shouldTimeout;
     325    int m_timeout;
    320326};
    321327
  • trunk/Tools/DumpRenderTree/qt/main.cpp

    r106919 r107171  
    7474    return str == QString("-v") || str == QString("--pixel-tests")
    7575           || str == QString("--stdout") || str == QString("--stderr")
     76           || str == QString("--timeout") || str == QString("--no-timeout")
    7677           || str == QString("-");
    7778}
     
    9091void printUsage()
    9192{
    92     fprintf(stderr, "Usage: DumpRenderTree [-v|--pixel-tests] [--stdout output_filename] [-stderr error_filename] filename [filename2..n]\n");
     93    fprintf(stderr, "Usage: DumpRenderTree [-v|--pixel-tests] [--stdout output_filename] [-stderr error_filename] [--no-timeout] [--timeout timeout_MS] filename [filename2..n]\n");
    9394    fprintf(stderr, "Or folder containing test files: DumpRenderTree [-v|--pixel-tests] dirpath\n");
    9495    fflush(stderr);
     
    214215    QWebDatabase::removeAllDatabases();
    215216
     217    index = args.indexOf(QLatin1String("--timeout"));
     218    if (index != -1) {
     219        int timeout = takeOptionValue(args, index).toInt();
     220        dumper.setTimeout(timeout);
     221        args.removeAt(index);
     222    }
     223
     224    index = args.indexOf(QLatin1String("--no-timeout"));
     225    if (index != -1) {
     226        dumper.setShouldTimeout(false);
     227        args.removeAt(index);
     228    }
     229
    216230    index = args.indexOf(QLatin1String("-"));
    217231    if (index != -1) {
Note: See TracChangeset for help on using the changeset viewer.