[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
abecsi at webkit.org
abecsi at webkit.org
Wed Dec 22 12:37:56 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit e8ac133371714d14528e25fff81c5221b978d031
Author: abecsi at webkit.org <abecsi at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Aug 26 10:17:56 2010 +0000
[Qt] DumpRenderTree runs only one test from command mode
https://bugs.webkit.org/show_bug.cgi?id=44012
Patch by Mahesh Kulkarni <mahesh.kulkarni at nokia.com> on 2010-08-26
Reviewed by Kenneth Rohde Christiansen.
Enables support to run multiple test files and single
folder containing html files in stand alone mode
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::DumpRenderTree::DumpRenderTree):
(WebCore::DumpRenderTree::processArgsLine):
(WebCore::DumpRenderTree::loadNextTestInStandAloneMode):
(WebCore::DumpRenderTree::processLine):
(WebCore::DumpRenderTree::dump):
* DumpRenderTree/qt/DumpRenderTreeQt.h:
(WebCore::DumpRenderTree::setStandAloneMode):
(WebCore::DumpRenderTree::isStandAloneMode):
* DumpRenderTree/qt/main.cpp:
(main):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66092 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 179fdc1..5811ef3 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,25 @@
+2010-08-26 Mahesh Kulkarni <mahesh.kulkarni at nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] DumpRenderTree runs only one test from command mode
+ https://bugs.webkit.org/show_bug.cgi?id=44012
+
+ Enables support to run multiple test files and single
+ folder containing html files in stand alone mode
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::processArgsLine):
+ (WebCore::DumpRenderTree::loadNextTestInStandAloneMode):
+ (WebCore::DumpRenderTree::processLine):
+ (WebCore::DumpRenderTree::dump):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ (WebCore::DumpRenderTree::setStandAloneMode):
+ (WebCore::DumpRenderTree::isStandAloneMode):
+ * DumpRenderTree/qt/main.cpp:
+ (main):
+
2010-08-25 Martin Robinson <mrobinson at igalia.com>
Updating webkitpy test expectations.
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
index 4a57d1d..632e357 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
@@ -391,7 +391,7 @@ DumpRenderTree::DumpRenderTree()
: m_dumpPixels(false)
, m_stdin(0)
, m_enableTextOutput(false)
- , m_singleFileMode(false)
+ , m_standAloneMode(false)
, m_graphicsBased(false)
, m_persistentStoragePath(QString(getenv("DUMPRENDERTREE_TEMP")))
{
@@ -605,6 +605,40 @@ void DumpRenderTree::readLine()
processLine(QString::fromLocal8Bit(line.constData(), line.length()));
}
+void DumpRenderTree::processArgsLine(const QStringList &args)
+{
+ setStandAloneMode(true);
+
+ for (int i = 1; i < args.size(); ++i)
+ if (!args.at(i).startsWith('-'))
+ m_standAloneModeTestList.append(args[i]);
+
+ QFileInfo firstEntry(m_standAloneModeTestList.first());
+ if (firstEntry.isDir()) {
+ QDir folderEntry(m_standAloneModeTestList.first());
+ QStringList supportedExt;
+ // Check for all supported extensions (from Scripts/webkitpy/layout_tests/layout_package/test_files.py).
+ supportedExt << "*.html" << "*.shtml" << "*.xml" << "*.xhtml" << "*.xhtmlmp" << "*.pl" << "*.php" << "*.svg";
+ m_standAloneModeTestList = folderEntry.entryList(supportedExt, QDir::Files);
+ for (int i = 0; i < m_standAloneModeTestList.size(); ++i)
+ m_standAloneModeTestList[i] = folderEntry.absoluteFilePath(m_standAloneModeTestList[i]);
+ }
+
+ processLine(m_standAloneModeTestList.first());
+ m_standAloneModeTestList.removeFirst();
+
+ connect(this, SIGNAL(ready()), this, SLOT(loadNextTestInStandAloneMode()));
+}
+
+void DumpRenderTree::loadNextTestInStandAloneMode()
+{
+ if (m_standAloneModeTestList.isEmpty())
+ emit quit();
+
+ processLine(m_standAloneModeTestList.first());
+ m_standAloneModeTestList.removeFirst();
+}
+
void DumpRenderTree::processLine(const QString &input)
{
QString line = input;
@@ -636,11 +670,7 @@ void DumpRenderTree::processLine(const QString &input)
fi = QFileInfo(currentDir, line.prepend(QLatin1String("LayoutTests/")));
if (!fi.exists()) {
- if (isSingleFileMode())
- emit quit();
- else
- emit ready();
-
+ emit ready();
return;
}
@@ -834,7 +864,7 @@ void DumpRenderTree::dump()
QWebFrame *mainFrame = m_page->mainFrame();
- if (isSingleFileMode()) {
+ if (isStandAloneMode()) {
QString markup = mainFrame->toHtml();
fprintf(stdout, "Source:\n\n%s\n", markup.toUtf8().constData());
}
@@ -922,10 +952,7 @@ void DumpRenderTree::dump()
fflush(stdout);
fflush(stderr);
- if (isSingleFileMode())
- emit quit();
- else
- emit ready();
+ emit ready();
}
void DumpRenderTree::titleChanged(const QString &s)
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
index de0c6c5..54aa484 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
@@ -79,9 +79,6 @@ public:
void setTextOutputEnabled(bool enable) { m_enableTextOutput = enable; }
bool isTextOutputEnabled() { return m_enableTextOutput; }
- void setSingleFileMode(bool flag) { m_singleFileMode = flag; }
- bool isSingleFileMode() { return m_singleFileMode; }
-
void setGraphicsBased(bool flag) { m_graphicsBased = flag; }
bool isGraphicsBased() { return m_graphicsBased; }
@@ -106,6 +103,7 @@ public:
#if defined(Q_WS_X11)
static void initializeFonts();
#endif
+ void processArgsLine(const QStringList&);
public Q_SLOTS:
void initJSObjects();
@@ -128,8 +126,12 @@ private Q_SLOTS:
void showPage();
void hidePage();
void dryRunPrint(QWebFrame*);
+ void loadNextTestInStandAloneMode();
private:
+ void setStandAloneMode(bool flag) { m_standAloneMode = flag; }
+ bool isStandAloneMode() { return m_standAloneMode; }
+
QString dumpFramesAsText(QWebFrame* frame);
QString dumpBackForwardList(QWebPage* page);
QString dumpFrameScrollPosition(QWebFrame* frame);
@@ -137,6 +139,7 @@ private:
bool m_dumpPixels;
QString m_expectedHash;
+ QStringList m_standAloneModeTestList;
WebPage *m_page;
QWidget* m_mainView;
@@ -150,7 +153,7 @@ private:
QList<QObject*> windows;
bool m_enableTextOutput;
- bool m_singleFileMode;
+ bool m_standAloneMode;
bool m_graphicsBased;
QString m_persistentStoragePath;
};
diff --git a/WebKitTools/DumpRenderTree/qt/main.cpp b/WebKitTools/DumpRenderTree/qt/main.cpp
index 7d1c08c..8349d73 100644
--- a/WebKitTools/DumpRenderTree/qt/main.cpp
+++ b/WebKitTools/DumpRenderTree/qt/main.cpp
@@ -143,7 +143,8 @@ int main(int argc, char* argv[])
QStringList args = app.arguments();
if (args.count() < 2) {
- qDebug() << "Usage: DumpRenderTree [-v|--pixel-tests] filename";
+ qDebug() << "Usage: DumpRenderTree [-v|--pixel-tests] filename [filename2..n]";
+ qDebug() << "Or folder containing test files: DumpRenderTree [-v|--pixel-tests] dirpath";
exit(0);
}
@@ -161,15 +162,8 @@ int main(int argc, char* argv[])
if (args.contains(QLatin1String("-"))) {
QObject::connect(&dumper, SIGNAL(ready()), &dumper, SLOT(readLine()), Qt::QueuedConnection);
QTimer::singleShot(0, &dumper, SLOT(readLine()));
- } else {
- dumper.setSingleFileMode(true);
- for (int i = 1; i < args.size(); ++i) {
- if (!args.at(i).startsWith('-')) {
- dumper.processLine(args.at(i));
- break;
- }
- }
- }
+ } else
+ dumper.processArgsLine(args);
return app.exec();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list