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):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107171
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-08 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ [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 <gns@gnome.org>
Rubber-stamped by Martin Robinson.
return pages;
}
+void DumpRenderTree::setTimeout(int timeout)
+{
+ m_controller->setTimeout(timeout);
+}
+
+void DumpRenderTree::setShouldTimeout(bool flag)
+{
+ m_controller->setShouldTimeout(flag);
+}
+
}
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();
LayoutTestController::LayoutTestController(WebCore::DumpRenderTree* drt)
: QObject()
, m_drt(drt)
+ , m_shouldTimeout(true)
+ , m_timeout(30000)
{
reset();
DumpRenderTreeSupportQt::dumpNotification(true);
{
//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)
{
qDebug() << ">>>>notifyDone";
- if (!m_timeoutTimer.isActive())
+ if (m_shouldTimeout && !m_timeoutTimer.isActive())
return;
m_timeoutTimer.stop();
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*);
QWebHistory* m_webHistory;
QStringList m_desktopNotificationAllowedOrigins;
bool m_ignoreDesktopNotification;
+
+ bool m_shouldTimeout;
+ int m_timeout;
};
#endif // LayoutTestControllerQt_h
{
return str == QString("-v") || str == QString("--pixel-tests")
|| str == QString("--stdout") || str == QString("--stderr")
+ || str == QString("--timeout") || str == QString("--no-timeout")
|| str == QString("-");
}
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);
}
}
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);