[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

vestbo at webkit.org vestbo at webkit.org
Thu Apr 8 00:44:37 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 792a03fef8c349fc410038628ead1d02fa223d8b
Author: vestbo at webkit.org <vestbo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 21 15:06:48 2009 +0000

    [Qt] Clean up the WebKit layer unit-tests
    
    Reviewed by Simon Hausmann.
    
        - Use tests.pri for common options
        - Standardize file naming
        - Move all resources to 'resources' subdir
        - Standardize how TESTS_SOURCE_DIR is used
        - Get rid of UID3 for symbian (autogenerated)
        - Don't build app bundles on Mac OS X
    
    * tests/benchmarks/loading/loading.pro: Added.
    * tests/benchmarks/loading/tst_loading.pro: Removed.
    * tests/benchmarks/painting/painting.pro: Added.
    * tests/benchmarks/painting/tst_painting.pro: Removed.
    * tests/qgraphicswebview/qgraphicswebview.pro:
    * tests/qwebelement/qwebelement.pro:
    * tests/qwebelement/qwebelement.qrc: Removed.
    * tests/qwebelement/resources/image.png: Renamed from WebKit/qt/tests/qwebelement/image.png.
    * tests/qwebelement/resources/style.css: Renamed from WebKit/qt/tests/qwebelement/style.css.
    * tests/qwebelement/resources/style2.css: Renamed from WebKit/qt/tests/qwebelement/style2.css.
    * tests/qwebelement/tst_qwebelement.qrc: Added.
    * tests/qwebframe/qwebframe.pro:
    * tests/qwebframe/qwebframe.qrc: Removed.
    * tests/qwebframe/resources/image.png: Renamed from WebKit/qt/tests/qwebframe/image.png.
    * tests/qwebframe/resources/style.css: Renamed from WebKit/qt/tests/qwebframe/style.css.
    * tests/qwebframe/resources/test1.html: Renamed from WebKit/qt/tests/qwebframe/test1.html.
    * tests/qwebframe/resources/test2.html: Renamed from WebKit/qt/tests/qwebframe/test2.html.
    * tests/qwebframe/resources/testiframe.html: Renamed from WebKit/qt/tests/qwebframe/testiframe.html.
    * tests/qwebframe/resources/testiframe2.html: Renamed from WebKit/qt/tests/qwebframe/testiframe2.html.
    * tests/qwebframe/tst_qwebframe.cpp:
    * tests/qwebframe/tst_qwebframe.qrc: Added.
    * tests/qwebhistory/qwebhistory.pro:
    * tests/qwebhistory/resources/page1.html: Renamed from WebKit/qt/tests/qwebhistory/data/page1.html.
    * tests/qwebhistory/resources/page2.html: Renamed from WebKit/qt/tests/qwebhistory/data/page2.html.
    * tests/qwebhistory/resources/page3.html: Renamed from WebKit/qt/tests/qwebhistory/data/page3.html.
    * tests/qwebhistory/resources/page4.html: Renamed from WebKit/qt/tests/qwebhistory/data/page4.html.
    * tests/qwebhistory/resources/page5.html: Renamed from WebKit/qt/tests/qwebhistory/data/page5.html.
    * tests/qwebhistory/resources/page6.html: Renamed from WebKit/qt/tests/qwebhistory/data/page6.html.
    * tests/qwebhistory/tst_qwebhistory.cpp:
    (tst_QWebHistory::):
    * tests/qwebhistory/tst_qwebhistory.qrc:
    * tests/qwebhistoryinterface/qwebhistoryinterface.pro:
    * tests/qwebinspector/qwebinspector.pro:
    * tests/qwebpage/qwebpage.pro:
    * tests/qwebpage/resources/frame_a.html: Renamed from WebKit/qt/tests/qwebpage/frametest/frame_a.html.
    * tests/qwebpage/resources/iframe.html: Renamed from WebKit/qt/tests/qwebpage/frametest/iframe.html.
    * tests/qwebpage/resources/iframe2.html: Renamed from WebKit/qt/tests/qwebpage/frametest/iframe2.html.
    * tests/qwebpage/resources/iframe3.html: Renamed from WebKit/qt/tests/qwebpage/frametest/iframe3.html.
    * tests/qwebpage/resources/index.html: Renamed from WebKit/qt/tests/qwebpage/frametest/index.html.
    * tests/qwebpage/tst_qwebpage.cpp:
    (tst_QWebPage::backActionUpdate):
    (tst_QWebPage::frameAt):
    (tst_QWebPage::errorPageExtensionInFrameset):
    (tst_QWebPage::screenshot):
    * tests/qwebpage/tst_qwebpage.qrc:
    * tests/qwebplugindatabase/qwebplugindatabase.pro:
    * tests/qwebview/qwebview.pro:
    * tests/qwebview/resources/frame_a.html: Renamed from WebKit/qt/tests/qwebview/data/frame_a.html.
    * tests/qwebview/resources/index.html: Renamed from WebKit/qt/tests/qwebview/data/index.html.
    * tests/qwebview/tst_qwebview.cpp:
    (tst_QWebView::reusePage):
    (tst_QWebView::crashTests):
    * tests/qwebview/tst_qwebview.qrc:
    * tests/resources/image2.png: Renamed from WebKit/qt/tests/qwebframe/resources/image2.png.
    * tests/tests.pri: Added.
    * tests/tests.pro:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52444 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 8dfab69..75403c8 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,73 @@
+2009-12-21  Tor Arne Vestbø  <tor.arne.vestbo at nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Clean up the WebKit layer unit-tests
+
+            - Use tests.pri for common options
+            - Standardize file naming
+            - Move all resources to 'resources' subdir
+            - Standardize how TESTS_SOURCE_DIR is used
+            - Get rid of UID3 for symbian (autogenerated)
+            - Don't build app bundles on Mac OS X
+
+        * tests/benchmarks/loading/loading.pro: Added.
+        * tests/benchmarks/loading/tst_loading.pro: Removed.
+        * tests/benchmarks/painting/painting.pro: Added.
+        * tests/benchmarks/painting/tst_painting.pro: Removed.
+        * tests/qgraphicswebview/qgraphicswebview.pro:
+        * tests/qwebelement/qwebelement.pro:
+        * tests/qwebelement/qwebelement.qrc: Removed.
+        * tests/qwebelement/resources/image.png: Renamed from WebKit/qt/tests/qwebelement/image.png.
+        * tests/qwebelement/resources/style.css: Renamed from WebKit/qt/tests/qwebelement/style.css.
+        * tests/qwebelement/resources/style2.css: Renamed from WebKit/qt/tests/qwebelement/style2.css.
+        * tests/qwebelement/tst_qwebelement.qrc: Added.
+        * tests/qwebframe/qwebframe.pro:
+        * tests/qwebframe/qwebframe.qrc: Removed.
+        * tests/qwebframe/resources/image.png: Renamed from WebKit/qt/tests/qwebframe/image.png.
+        * tests/qwebframe/resources/style.css: Renamed from WebKit/qt/tests/qwebframe/style.css.
+        * tests/qwebframe/resources/test1.html: Renamed from WebKit/qt/tests/qwebframe/test1.html.
+        * tests/qwebframe/resources/test2.html: Renamed from WebKit/qt/tests/qwebframe/test2.html.
+        * tests/qwebframe/resources/testiframe.html: Renamed from WebKit/qt/tests/qwebframe/testiframe.html.
+        * tests/qwebframe/resources/testiframe2.html: Renamed from WebKit/qt/tests/qwebframe/testiframe2.html.
+        * tests/qwebframe/tst_qwebframe.cpp:
+        * tests/qwebframe/tst_qwebframe.qrc: Added.
+        * tests/qwebhistory/qwebhistory.pro:
+        * tests/qwebhistory/resources/page1.html: Renamed from WebKit/qt/tests/qwebhistory/data/page1.html.
+        * tests/qwebhistory/resources/page2.html: Renamed from WebKit/qt/tests/qwebhistory/data/page2.html.
+        * tests/qwebhistory/resources/page3.html: Renamed from WebKit/qt/tests/qwebhistory/data/page3.html.
+        * tests/qwebhistory/resources/page4.html: Renamed from WebKit/qt/tests/qwebhistory/data/page4.html.
+        * tests/qwebhistory/resources/page5.html: Renamed from WebKit/qt/tests/qwebhistory/data/page5.html.
+        * tests/qwebhistory/resources/page6.html: Renamed from WebKit/qt/tests/qwebhistory/data/page6.html.
+        * tests/qwebhistory/tst_qwebhistory.cpp:
+        (tst_QWebHistory::):
+        * tests/qwebhistory/tst_qwebhistory.qrc:
+        * tests/qwebhistoryinterface/qwebhistoryinterface.pro:
+        * tests/qwebinspector/qwebinspector.pro:
+        * tests/qwebpage/qwebpage.pro:
+        * tests/qwebpage/resources/frame_a.html: Renamed from WebKit/qt/tests/qwebpage/frametest/frame_a.html.
+        * tests/qwebpage/resources/iframe.html: Renamed from WebKit/qt/tests/qwebpage/frametest/iframe.html.
+        * tests/qwebpage/resources/iframe2.html: Renamed from WebKit/qt/tests/qwebpage/frametest/iframe2.html.
+        * tests/qwebpage/resources/iframe3.html: Renamed from WebKit/qt/tests/qwebpage/frametest/iframe3.html.
+        * tests/qwebpage/resources/index.html: Renamed from WebKit/qt/tests/qwebpage/frametest/index.html.
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::backActionUpdate):
+        (tst_QWebPage::frameAt):
+        (tst_QWebPage::errorPageExtensionInFrameset):
+        (tst_QWebPage::screenshot):
+        * tests/qwebpage/tst_qwebpage.qrc:
+        * tests/qwebplugindatabase/qwebplugindatabase.pro:
+        * tests/qwebview/qwebview.pro:
+        * tests/qwebview/resources/frame_a.html: Renamed from WebKit/qt/tests/qwebview/data/frame_a.html.
+        * tests/qwebview/resources/index.html: Renamed from WebKit/qt/tests/qwebview/data/index.html.
+        * tests/qwebview/tst_qwebview.cpp:
+        (tst_QWebView::reusePage):
+        (tst_QWebView::crashTests):
+        * tests/qwebview/tst_qwebview.qrc:
+        * tests/resources/image2.png: Renamed from WebKit/qt/tests/qwebframe/resources/image2.png.
+        * tests/tests.pri: Added.
+        * tests/tests.pro:
+
 2009-12-18  Ariya Hidayat  <ariya.hidayat at gmail.com>
 
         Build fix, not reviewed.
diff --git a/WebKit/qt/tests/benchmarks/loading/loading.pro b/WebKit/qt/tests/benchmarks/loading/loading.pro
new file mode 100644
index 0000000..8b24274
--- /dev/null
+++ b/WebKit/qt/tests/benchmarks/loading/loading.pro
@@ -0,0 +1 @@
+include(../../tests.pri)
diff --git a/WebKit/qt/tests/benchmarks/loading/tst_loading.pro b/WebKit/qt/tests/benchmarks/loading/tst_loading.pro
deleted file mode 100644
index bc5e75f..0000000
--- a/WebKit/qt/tests/benchmarks/loading/tst_loading.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TEMPLATE = app
-TARGET = tst_loading
-include(../../../../../WebKit.pri)
-SOURCES += tst_loading.cpp
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
-    TARGET.UID3 = 0xA000E541
-    TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
diff --git a/WebKit/qt/tests/benchmarks/painting/painting.pro b/WebKit/qt/tests/benchmarks/painting/painting.pro
new file mode 100644
index 0000000..8acdd5c
--- /dev/null
+++ b/WebKit/qt/tests/benchmarks/painting/painting.pro
@@ -0,0 +1 @@
+include(../../tests.pri)
\ No newline at end of file
diff --git a/WebKit/qt/tests/benchmarks/painting/tst_painting.pro b/WebKit/qt/tests/benchmarks/painting/tst_painting.pro
deleted file mode 100644
index 48c7072..0000000
--- a/WebKit/qt/tests/benchmarks/painting/tst_painting.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TEMPLATE = app
-TARGET = tst_painting
-include(../../../../../WebKit.pri)
-SOURCES += tst_painting.cpp
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
-    TARGET.UID3 = 0xA000E542
-    TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
diff --git a/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro b/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
index 57b4437..4ca2bf6 100644
--- a/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
+++ b/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
@@ -1,10 +1 @@
-TEMPLATE = app
-TARGET = tst_qgraphicswebview
-include(../../../../WebKit.pri)
-SOURCES  += tst_qgraphicswebview.cpp
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
-    TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri)
\ No newline at end of file
diff --git a/WebKit/qt/tests/qwebelement/qwebelement.pro b/WebKit/qt/tests/qwebelement/qwebelement.pro
index c45a9ac..4ca2bf6 100644
--- a/WebKit/qt/tests/qwebelement/qwebelement.pro
+++ b/WebKit/qt/tests/qwebelement/qwebelement.pro
@@ -1,12 +1 @@
-TEMPLATE = app
-TARGET = tst_qwebelement
-include(../../../../WebKit.pri)
-SOURCES  += tst_qwebelement.cpp
-RESOURCES += qwebelement.qrc
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
-    TARGET.UID3 = 0xA000E53A
-    TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri)
\ No newline at end of file
diff --git a/WebKit/qt/tests/qwebelement/qwebelement.qrc b/WebKit/qt/tests/qwebelement/qwebelement.qrc
deleted file mode 100644
index 28b9d7b..0000000
--- a/WebKit/qt/tests/qwebelement/qwebelement.qrc
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource prefix="/">
-<file>style.css</file>
-<file>style2.css</file>
-<file>image.png</file>
-</qresource>
-</RCC>
diff --git a/WebKit/qt/tests/qwebelement/image.png b/WebKit/qt/tests/qwebelement/resources/image.png
similarity index 100%
rename from WebKit/qt/tests/qwebelement/image.png
rename to WebKit/qt/tests/qwebelement/resources/image.png
diff --git a/WebKit/qt/tests/qwebelement/style.css b/WebKit/qt/tests/qwebelement/resources/style.css
similarity index 100%
rename from WebKit/qt/tests/qwebelement/style.css
rename to WebKit/qt/tests/qwebelement/resources/style.css
diff --git a/WebKit/qt/tests/qwebelement/style2.css b/WebKit/qt/tests/qwebelement/resources/style2.css
similarity index 100%
rename from WebKit/qt/tests/qwebelement/style2.css
rename to WebKit/qt/tests/qwebelement/resources/style2.css
diff --git a/WebKit/qt/tests/qwebelement/tst_qwebelement.qrc b/WebKit/qt/tests/qwebelement/tst_qwebelement.qrc
new file mode 100644
index 0000000..7384c76
--- /dev/null
+++ b/WebKit/qt/tests/qwebelement/tst_qwebelement.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+<file alias="style.css">resources/style.css</file>
+<file alias="style2.css">resources/style2.css</file>
+<file alias="image.png">resources/image.png</file>
+</qresource>
+</RCC>
diff --git a/WebKit/qt/tests/qwebframe/qwebframe.pro b/WebKit/qt/tests/qwebframe/qwebframe.pro
index b8734cd..4ca2bf6 100644
--- a/WebKit/qt/tests/qwebframe/qwebframe.pro
+++ b/WebKit/qt/tests/qwebframe/qwebframe.pro
@@ -1,13 +1 @@
-TEMPLATE = app
-TARGET = tst_qwebframe
-include(../../../../WebKit.pri)
-SOURCES  += tst_qwebframe.cpp
-RESOURCES += qwebframe.qrc
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-!symbian:DEFINES += SRCDIR=\\\"$$PWD/resources\\\"
-
-symbian {
-    TARGET.UID3 = 0xA000E53D
-    TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri)
\ No newline at end of file
diff --git a/WebKit/qt/tests/qwebframe/qwebframe.qrc b/WebKit/qt/tests/qwebframe/qwebframe.qrc
deleted file mode 100644
index 8afa0c1..0000000
--- a/WebKit/qt/tests/qwebframe/qwebframe.qrc
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource prefix="/">
-<file>image.png</file>
-<file>style.css</file>
-<file>test1.html</file>
-<file>test2.html</file>
-<file>testiframe.html</file>
-<file>testiframe2.html</file>
-</qresource>
-</RCC>
diff --git a/WebKit/qt/tests/qwebframe/image.png b/WebKit/qt/tests/qwebframe/resources/image.png
similarity index 100%
rename from WebKit/qt/tests/qwebframe/image.png
rename to WebKit/qt/tests/qwebframe/resources/image.png
diff --git a/WebKit/qt/tests/qwebframe/style.css b/WebKit/qt/tests/qwebframe/resources/style.css
similarity index 100%
rename from WebKit/qt/tests/qwebframe/style.css
rename to WebKit/qt/tests/qwebframe/resources/style.css
diff --git a/WebKit/qt/tests/qwebframe/test1.html b/WebKit/qt/tests/qwebframe/resources/test1.html
similarity index 100%
rename from WebKit/qt/tests/qwebframe/test1.html
rename to WebKit/qt/tests/qwebframe/resources/test1.html
diff --git a/WebKit/qt/tests/qwebframe/test2.html b/WebKit/qt/tests/qwebframe/resources/test2.html
similarity index 100%
rename from WebKit/qt/tests/qwebframe/test2.html
rename to WebKit/qt/tests/qwebframe/resources/test2.html
diff --git a/WebKit/qt/tests/qwebframe/testiframe.html b/WebKit/qt/tests/qwebframe/resources/testiframe.html
similarity index 100%
rename from WebKit/qt/tests/qwebframe/testiframe.html
rename to WebKit/qt/tests/qwebframe/resources/testiframe.html
diff --git a/WebKit/qt/tests/qwebframe/testiframe2.html b/WebKit/qt/tests/qwebframe/resources/testiframe2.html
similarity index 100%
rename from WebKit/qt/tests/qwebframe/testiframe2.html
rename to WebKit/qt/tests/qwebframe/resources/testiframe2.html
diff --git a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index c6292ff..55d4270 100644
--- a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -38,10 +38,6 @@
 #endif
 #include "../util.h"
 
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
-
 struct CustomType {
     QString string;
 };
@@ -677,7 +673,6 @@ void tst_QWebFrame::init()
     m_page = m_view->page();
     m_myObject = new MyQObject();
     m_page->mainFrame()->addToJavaScriptWindowObject("myObject", m_myObject);
-    QDir::setCurrent(SRCDIR);
 }
 
 void tst_QWebFrame::cleanup()
@@ -2377,6 +2372,11 @@ void tst_QWebFrame::setHtmlWithResource()
 
 void tst_QWebFrame::setHtmlWithBaseURL()
 {
+    if (!QDir(TESTS_SOURCE_DIR).exists())
+        QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
+
+    QDir::setCurrent(TESTS_SOURCE_DIR);
+
     QString html("<html><body><p>hello world</p><img src='resources/image2.png'/></body></html>");
 
     QWebPage page;
@@ -2385,7 +2385,7 @@ void tst_QWebFrame::setHtmlWithBaseURL()
     // in few seconds, the image should be completey loaded
     QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
 
-    frame->setHtml(html, QUrl::fromLocalFile(QDir::currentPath()));
+    frame->setHtml(html, QUrl::fromLocalFile(TESTS_SOURCE_DIR));
     waitForSignal(frame, SIGNAL(loadFinished(bool)), 200);
     QCOMPARE(spy.count(), 1);
 
@@ -2491,6 +2491,7 @@ void tst_QWebFrame::popupFocus()
     QTest::mouseClick(&view, Qt::LeftButton, 0, QPoint(25, 25));
     QObject* webpopup = firstChildByClassName(&view, "WebCore::QWebPopup");
     QComboBox* combo = qobject_cast<QComboBox*>(webpopup);
+    QVERIFY(combo != 0);
     QTRY_VERIFY(!view.hasFocus() && combo->view()->hasFocus()); // Focus should be on the popup
 
     // hide the popup and check if focus is on the page
diff --git a/WebKit/qt/tests/qwebframe/tst_qwebframe.qrc b/WebKit/qt/tests/qwebframe/tst_qwebframe.qrc
new file mode 100644
index 0000000..2a7d0b9
--- /dev/null
+++ b/WebKit/qt/tests/qwebframe/tst_qwebframe.qrc
@@ -0,0 +1,10 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+<file alias="image.png">resources/image.png</file>
+<file alias="style.css">resources/style.css</file>
+<file alias="test1.html">resources/test1.html</file>
+<file alias="test2.html">resources/test2.html</file>
+<file alias="testiframe.html">resources/testiframe.html</file>
+<file alias="testiframe2.html">resources/testiframe2.html</file>
+</qresource>
+</RCC>
diff --git a/WebKit/qt/tests/qwebhistory/qwebhistory.pro b/WebKit/qt/tests/qwebhistory/qwebhistory.pro
index 7445e3b..4ca2bf6 100644
--- a/WebKit/qt/tests/qwebhistory/qwebhistory.pro
+++ b/WebKit/qt/tests/qwebhistory/qwebhistory.pro
@@ -1,12 +1 @@
-TEMPLATE = app
-TARGET = tst_qwebhistory
-include(../../../../WebKit.pri)
-SOURCES  += tst_qwebhistory.cpp
-RESOURCES  += tst_qwebhistory.qrc
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
-    TARGET.UID3 = 0xA000E53B
-    TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri)
\ No newline at end of file
diff --git a/WebKit/qt/tests/qwebhistory/data/page1.html b/WebKit/qt/tests/qwebhistory/resources/page1.html
similarity index 100%
rename from WebKit/qt/tests/qwebhistory/data/page1.html
rename to WebKit/qt/tests/qwebhistory/resources/page1.html
diff --git a/WebKit/qt/tests/qwebhistory/data/page2.html b/WebKit/qt/tests/qwebhistory/resources/page2.html
similarity index 100%
rename from WebKit/qt/tests/qwebhistory/data/page2.html
rename to WebKit/qt/tests/qwebhistory/resources/page2.html
diff --git a/WebKit/qt/tests/qwebhistory/data/page3.html b/WebKit/qt/tests/qwebhistory/resources/page3.html
similarity index 100%
rename from WebKit/qt/tests/qwebhistory/data/page3.html
rename to WebKit/qt/tests/qwebhistory/resources/page3.html
diff --git a/WebKit/qt/tests/qwebhistory/data/page4.html b/WebKit/qt/tests/qwebhistory/resources/page4.html
similarity index 100%
rename from WebKit/qt/tests/qwebhistory/data/page4.html
rename to WebKit/qt/tests/qwebhistory/resources/page4.html
diff --git a/WebKit/qt/tests/qwebhistory/data/page5.html b/WebKit/qt/tests/qwebhistory/resources/page5.html
similarity index 100%
rename from WebKit/qt/tests/qwebhistory/data/page5.html
rename to WebKit/qt/tests/qwebhistory/resources/page5.html
diff --git a/WebKit/qt/tests/qwebhistory/data/page6.html b/WebKit/qt/tests/qwebhistory/resources/page6.html
similarity index 100%
rename from WebKit/qt/tests/qwebhistory/data/page6.html
rename to WebKit/qt/tests/qwebhistory/resources/page6.html
diff --git a/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp b/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
index ec2d497..e967dcc 100644
--- a/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
+++ b/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
@@ -37,7 +37,7 @@ public:
 protected :
     void loadPage(int nr)
     {
-        frame->load(QUrl("qrc:/data/page" + QString::number(nr) + ".html"));
+        frame->load(QUrl("qrc:/resources/page" + QString::number(nr) + ".html"));
         waitForLoadFinished.exec();
     }
 
diff --git a/WebKit/qt/tests/qwebhistory/tst_qwebhistory.qrc b/WebKit/qt/tests/qwebhistory/tst_qwebhistory.qrc
index 7c5ff0e..6e2f50a 100644
--- a/WebKit/qt/tests/qwebhistory/tst_qwebhistory.qrc
+++ b/WebKit/qt/tests/qwebhistory/tst_qwebhistory.qrc
@@ -1,11 +1,11 @@
 <!DOCTYPE RCC><RCC version="1.0">
 <qresource>
-    <file>data/page1.html</file>
-    <file>data/page2.html</file>    
-    <file>data/page3.html</file>
-    <file>data/page4.html</file>
-    <file>data/page5.html</file>
-    <file>data/page6.html</file>
+    <file>resources/page1.html</file>
+    <file>resources/page2.html</file>    
+    <file>resources/page3.html</file>
+    <file>resources/page4.html</file>
+    <file>resources/page5.html</file>
+    <file>resources/page6.html</file>
 </qresource>
 </RCC>
 
diff --git a/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro b/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
index 764f806..4ca2bf6 100644
--- a/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
+++ b/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
@@ -1,11 +1 @@
-TEMPLATE = app
-TARGET = tst_qwebhistoryinterface
-include(../../../../WebKit.pri)
-SOURCES  += tst_qwebhistoryinterface.cpp
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
-    TARGET.UID3 = 0xA000E53C
-    TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri)
\ No newline at end of file
diff --git a/WebKit/qt/tests/qwebinspector/qwebinspector.pro b/WebKit/qt/tests/qwebinspector/qwebinspector.pro
index 520887e..e99c7f4 100644
--- a/WebKit/qt/tests/qwebinspector/qwebinspector.pro
+++ b/WebKit/qt/tests/qwebinspector/qwebinspector.pro
@@ -1,6 +1 @@
-TEMPLATE = app
-TARGET = tst_qwebinspector
-include(../../../../WebKit.pri)
-SOURCES  += tst_qwebinspector.cpp
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+include(../tests.pri)
diff --git a/WebKit/qt/tests/qwebpage/qwebpage.pro b/WebKit/qt/tests/qwebpage/qwebpage.pro
index 7853b28..4ca2bf6 100644
--- a/WebKit/qt/tests/qwebpage/qwebpage.pro
+++ b/WebKit/qt/tests/qwebpage/qwebpage.pro
@@ -1,13 +1 @@
-TEMPLATE = app
-TARGET = tst_qwebpage
-include(../../../../WebKit.pri)
-SOURCES  += tst_qwebpage.cpp
-RESOURCES  += tst_qwebpage.qrc
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\"
-
-symbian {
-    TARGET.UID3 = 0xA000E53E
-    TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri)
\ No newline at end of file
diff --git a/WebKit/qt/tests/qwebpage/frametest/frame_a.html b/WebKit/qt/tests/qwebpage/resources/frame_a.html
similarity index 100%
rename from WebKit/qt/tests/qwebpage/frametest/frame_a.html
rename to WebKit/qt/tests/qwebpage/resources/frame_a.html
diff --git a/WebKit/qt/tests/qwebpage/frametest/iframe.html b/WebKit/qt/tests/qwebpage/resources/iframe.html
similarity index 100%
rename from WebKit/qt/tests/qwebpage/frametest/iframe.html
rename to WebKit/qt/tests/qwebpage/resources/iframe.html
diff --git a/WebKit/qt/tests/qwebpage/frametest/iframe2.html b/WebKit/qt/tests/qwebpage/resources/iframe2.html
similarity index 100%
rename from WebKit/qt/tests/qwebpage/frametest/iframe2.html
rename to WebKit/qt/tests/qwebpage/resources/iframe2.html
diff --git a/WebKit/qt/tests/qwebpage/frametest/iframe3.html b/WebKit/qt/tests/qwebpage/resources/iframe3.html
similarity index 100%
rename from WebKit/qt/tests/qwebpage/frametest/iframe3.html
rename to WebKit/qt/tests/qwebpage/resources/iframe3.html
diff --git a/WebKit/qt/tests/qwebpage/frametest/index.html b/WebKit/qt/tests/qwebpage/resources/index.html
similarity index 100%
rename from WebKit/qt/tests/qwebpage/frametest/index.html
rename to WebKit/qt/tests/qwebpage/resources/index.html
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index e68c210..e4c0ed6 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -40,10 +40,6 @@
 #include <QPushButton>
 #include <QDir>
 
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
-
 // Will try to wait for the condition while allowing event processing
 #define QTRY_COMPARE(__expr, __expected) \
     do { \
@@ -1275,7 +1271,7 @@ void tst_QWebPage::backActionUpdate()
     QAction *action = page->action(QWebPage::Back);
     QVERIFY(!action->isEnabled());
     QSignalSpy loadSpy(page, SIGNAL(loadFinished(bool)));
-    QUrl url = QUrl("qrc:///frametest/index.html");
+    QUrl url = QUrl("qrc:///resources/index.html");
     page->mainFrame()->load(url);
     QTRY_COMPARE(loadSpy.count(), 1);
     QVERIFY(!action->isEnabled());
@@ -1306,7 +1302,7 @@ void tst_QWebPage::frameAt()
     QWebView webView;
     QWebPage* webPage = webView.page();
     QSignalSpy loadSpy(webPage, SIGNAL(loadFinished(bool)));
-    QUrl url = QUrl("qrc:///frametest/iframe.html");
+    QUrl url = QUrl("qrc:///resources/iframe.html");
     webPage->mainFrame()->load(url);
     QTRY_COMPARE(loadSpy.count(), 1);
     frameAtHelper(webPage, webPage->mainFrame(), webPage->mainFrame()->pos());
@@ -1717,7 +1713,7 @@ void tst_QWebPage::errorPageExtensionInFrameset()
     ErrorPage* page = new ErrorPage;
     m_view->setPage(page);
 
-    m_view->load(QUrl("qrc:///frametest/index.html"));
+    m_view->load(QUrl("qrc:///resources/index.html"));
 
     QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool)));
     QTRY_COMPARE(spyLoadFinished.count(), 1);
@@ -1766,13 +1762,16 @@ void tst_QWebPage::screenshot_data()
 
 void tst_QWebPage::screenshot()
 {
-    QDir::setCurrent(SRCDIR);
+    if (!QDir(TESTS_SOURCE_DIR).exists())
+        QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
+
+    QDir::setCurrent(TESTS_SOURCE_DIR);
 
     QFETCH(QString, html);
     QWebPage* page = new QWebPage;
     page->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
     QWebFrame* mainFrame = page->mainFrame();
-    mainFrame->setHtml(html, QUrl::fromLocalFile(QDir::currentPath()));
+    mainFrame->setHtml(html, QUrl::fromLocalFile(TESTS_SOURCE_DIR));
     if (html.contains("</embed>")) {
         // some reasonable time for the PluginStream to feed test.swf to flash and start painting
         QTest::qWait(2000);
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.qrc b/WebKit/qt/tests/qwebpage/tst_qwebpage.qrc
index 3085ce2..0627cb4 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.qrc
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.qrc
@@ -1,10 +1,10 @@
 <!DOCTYPE RCC><RCC version="1.0">
 <qresource>
-    <file>frametest/index.html</file>
-    <file>frametest/frame_a.html</file>
-    <file>frametest/iframe.html</file>
-    <file>frametest/iframe2.html</file>
-    <file>frametest/iframe3.html</file>
+    <file>resources/index.html</file>
+    <file>resources/frame_a.html</file>
+    <file>resources/iframe.html</file>
+    <file>resources/iframe2.html</file>
+    <file>resources/iframe3.html</file>
 </qresource>
 </RCC>
 
diff --git a/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro b/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
index 569146a..e99c7f4 100644
--- a/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
+++ b/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
@@ -1,11 +1 @@
-TEMPLATE = app
-TARGET = tst_qwebplugindatabase
-include(../../../../WebKit.pri)
-SOURCES  += tst_qwebplugindatabase.cpp
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
-    TARGET.UID3 = 0xA000E540
-    TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri)
diff --git a/WebKit/qt/tests/qwebview/qwebview.pro b/WebKit/qt/tests/qwebview/qwebview.pro
index 735537b..4ca2bf6 100644
--- a/WebKit/qt/tests/qwebview/qwebview.pro
+++ b/WebKit/qt/tests/qwebview/qwebview.pro
@@ -1,13 +1 @@
-TEMPLATE = app
-TARGET = tst_qwebview
-include(../../../../WebKit.pri)
-SOURCES  += tst_qwebview.cpp
-QT += testlib network
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-RESOURCES  += tst_qwebview.qrc
-DEFINES += SRCDIR=\\\"$$PWD/\\\"
-
-symbian {
-    TARGET.UID3 = 0xA000E53F
-    TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
+include(../tests.pri)
\ No newline at end of file
diff --git a/WebKit/qt/tests/qwebview/data/frame_a.html b/WebKit/qt/tests/qwebview/resources/frame_a.html
similarity index 100%
rename from WebKit/qt/tests/qwebview/data/frame_a.html
rename to WebKit/qt/tests/qwebview/resources/frame_a.html
diff --git a/WebKit/qt/tests/qwebview/data/index.html b/WebKit/qt/tests/qwebview/resources/index.html
similarity index 100%
rename from WebKit/qt/tests/qwebview/data/index.html
rename to WebKit/qt/tests/qwebview/resources/index.html
diff --git a/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/WebKit/qt/tests/qwebview/tst_qwebview.cpp
index f0fdffa..ebcf4bb 100644
--- a/WebKit/qt/tests/qwebview/tst_qwebview.cpp
+++ b/WebKit/qt/tests/qwebview/tst_qwebview.cpp
@@ -30,6 +30,8 @@
 #include <qwebkitversion.h>
 #include <qwebframe.h>
 
+#include <QDebug>
+
 class tst_QWebView : public QObject
 {
     Q_OBJECT
@@ -121,7 +123,10 @@ void tst_QWebView::reusePage_data()
 
 void tst_QWebView::reusePage()
 {
-    QDir::setCurrent(SRCDIR);
+    if (!QDir(TESTS_SOURCE_DIR).exists())
+        QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
+
+    QDir::setCurrent(TESTS_SOURCE_DIR);
 
     QFETCH(QString, html);
     QWebView* view1 = new QWebView;
@@ -129,7 +134,7 @@ void tst_QWebView::reusePage()
     view1->setPage(page);
     page->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
     QWebFrame* mainFrame = page->mainFrame();
-    mainFrame->setHtml(html, QUrl::fromLocalFile(QDir::currentPath()));
+    mainFrame->setHtml(html, QUrl::fromLocalFile(TESTS_SOURCE_DIR));
     if (html.contains("</embed>")) {
         // some reasonable time for the PluginStream to feed test.swf to flash and start painting
         waitForSignal(view1, SIGNAL(loadFinished(bool)), 2000);
@@ -193,7 +198,7 @@ void tst_QWebView::crashTests()
     // Test page should have frames.
     QWebView view;
     WebViewCrashTest tester(&view);
-    QUrl url("qrc:///data/index.html");
+    QUrl url("qrc:///resources/index.html");
     view.load(url);
     QTRY_VERIFY(tester.m_executed); // If fail it means that the test wasn't executed.
 }
diff --git a/WebKit/qt/tests/qwebview/tst_qwebview.qrc b/WebKit/qt/tests/qwebview/tst_qwebview.qrc
index ede34a9..5abc64c 100644
--- a/WebKit/qt/tests/qwebview/tst_qwebview.qrc
+++ b/WebKit/qt/tests/qwebview/tst_qwebview.qrc
@@ -1,7 +1,7 @@
 <!DOCTYPE RCC><RCC version="1.0">
 <qresource>
-    <file>data/index.html</file>
-    <file>data/frame_a.html</file>
+    <file>resources/index.html</file>
+    <file>resources/frame_a.html</file>
 </qresource>
 </RCC>
 
diff --git a/WebKit/qt/tests/qwebframe/resources/image2.png b/WebKit/qt/tests/resources/image2.png
similarity index 100%
rename from WebKit/qt/tests/qwebframe/resources/image2.png
rename to WebKit/qt/tests/resources/image2.png
diff --git a/WebKit/qt/tests/tests.pri b/WebKit/qt/tests/tests.pri
new file mode 100644
index 0000000..e71c6dc
--- /dev/null
+++ b/WebKit/qt/tests/tests.pri
@@ -0,0 +1,23 @@
+TEMPLATE = app
+CONFIG -= app_bundle
+
+TARGET = tst_$$TARGET
+SOURCES += $$_PRO_FILE_PWD_/$${TARGET}.cpp
+
+exists($$_PRO_FILE_PWD_/$${TARGET}.qrc):RESOURCES += $$_PRO_FILE_PWD_/$${TARGET}.qrc
+
+include(../../../WebKit.pri)
+QT += testlib network
+
+QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian {
+    TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
+
+# This define is used by some tests to look up resources in the source tree
+!symbian {
+    DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD/\\\"
+} else {
+    DEFINES += TESTS_SOURCE_DIR=\\\"\\\"
+}
\ No newline at end of file
diff --git a/WebKit/qt/tests/tests.pro b/WebKit/qt/tests/tests.pro
index b967ca9..8e49d07 100644
--- a/WebKit/qt/tests/tests.pro
+++ b/WebKit/qt/tests/tests.pro
@@ -1,4 +1,4 @@
 
 TEMPLATE = subdirs
 SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebview qwebhistory qwebinspector
-greaterThan(QT_MINOR_VERSION, 4): SUBDIRS += benchmarks/painting/tst_painting.pro benchmarks/loading/tst_loading.pro
+greaterThan(QT_MINOR_VERSION, 4): SUBDIRS += benchmarks/painting benchmarks/loading

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list