diff options
| author | Steve Block <steveblock@google.com> | 2010-02-02 14:57:50 +0000 |
|---|---|---|
| committer | Steve Block <steveblock@google.com> | 2010-02-04 15:06:55 +0000 |
| commit | d0825bca7fe65beaee391d30da42e937db621564 (patch) | |
| tree | 7461c49eb5844ffd1f35d1ba2c8b7584c1620823 /WebKit/qt/tests/qwebview | |
| parent | 3db770bd97c5a59b6c7574ca80a39e5a51c1defd (diff) | |
| download | external_webkit-d0825bca7fe65beaee391d30da42e937db621564.zip external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.gz external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.bz2 | |
Merge webkit.org at r54127 : Initial merge by git
Change-Id: Ib661abb595522f50ea406f72d3a0ce17f7193c82
Diffstat (limited to 'WebKit/qt/tests/qwebview')
| -rw-r--r-- | WebKit/qt/tests/qwebview/qwebview.pro | 14 | ||||
| -rw-r--r-- | WebKit/qt/tests/qwebview/resources/frame_a.html (renamed from WebKit/qt/tests/qwebview/data/frame_a.html) | 0 | ||||
| -rw-r--r-- | WebKit/qt/tests/qwebview/resources/index.html (renamed from WebKit/qt/tests/qwebview/data/index.html) | 0 | ||||
| -rw-r--r-- | WebKit/qt/tests/qwebview/tst_qwebview.cpp | 19 | ||||
| -rw-r--r-- | WebKit/qt/tests/qwebview/tst_qwebview.qrc | 4 |
5 files changed, 19 insertions, 18 deletions
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 index 9ff68f1..9ff68f1 100644 --- a/WebKit/qt/tests/qwebview/data/frame_a.html +++ b/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 index c53ad09..c53ad09 100644 --- a/WebKit/qt/tests/qwebview/data/index.html +++ b/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 bd2f185..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,21 +134,29 @@ 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); } view1->show(); +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) QTest::qWaitForWindowShown(view1); +#else + QTest::qWait(2000); +#endif delete view1; QVERIFY(page != 0); // deleting view must not have deleted the page, since it's not a child of view QWebView *view2 = new QWebView; view2->setPage(page); view2->show(); // in Windowless mode, you should still be able to see the plugin here +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) QTest::qWaitForWindowShown(view2); +#else + QTest::qWait(2000); +#endif delete view2; delete page; // must not crash @@ -185,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> |
