summaryrefslogtreecommitdiffstats
path: root/Source/WebKit2/UIProcess/API/qt/tests
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/UIProcess/API/qt/tests')
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp14
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/qwkpage/qwkpage.pro1
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp59
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/tests.pri2
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/tests.pro2
5 files changed, 75 insertions, 3 deletions
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp b/Source/WebKit2/UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp
index f26c69d..8cb7263 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp
@@ -35,6 +35,7 @@ private slots:
void init();
void cleanup();
+ void loadEmptyUrl();
void loadEmptyPage();
private:
@@ -83,10 +84,21 @@ void tst_QGraphicsWKView::loadEmptyPage()
{
m_view->show();
- m_view->m_webView-> load(QUrl::fromLocalFile(TESTDIR "/html/basic_page.html"));
+ m_view->m_webView-> load(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/basic_page.html")));
QVERIFY(waitForSignal(m_view->m_webView, SIGNAL(loadFinished(bool))));
}
+void tst_QGraphicsWKView::loadEmptyUrl()
+{
+ // That should not crash.
+ m_view->show();
+ m_view->m_webView->load(QUrl());
+ QVERIFY(!waitForSignal(m_view->m_webView->page(), SIGNAL(engineConnectionChanged(bool)), 50));
+
+ m_view->m_webView->load(QUrl(QLatin1String("")));
+ QVERIFY(!waitForSignal(m_view->m_webView->page(), SIGNAL(engineConnectionChanged(bool)), 50));
+}
+
QTEST_MAIN(tst_QGraphicsWKView)
#include "tst_qgraphicswkview.moc"
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qwkpage/qwkpage.pro b/Source/WebKit2/UIProcess/API/qt/tests/qwkpage/qwkpage.pro
new file mode 100644
index 0000000..e99c7f4
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qwkpage/qwkpage.pro
@@ -0,0 +1 @@
+include(../tests.pri)
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp b/Source/WebKit2/UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp
new file mode 100644
index 0000000..39fcac2
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp
@@ -0,0 +1,59 @@
+/*
+ Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <QScopedPointer>
+#include <QtTest/QtTest>
+#include <qwkcontext.h>
+#include <qwkpage.h>
+
+class tst_QWKPage : public QObject {
+ Q_OBJECT
+
+private slots:
+ void init();
+ void cleanup();
+
+ void loadEmptyUrl();
+
+private:
+ QScopedPointer<QWKContext> m_context;
+ QScopedPointer<QWKPage> m_page;
+};
+
+void tst_QWKPage::init()
+{
+ m_context.reset(new QWKContext);
+ m_page.reset(new QWKPage(m_context.data()));
+}
+
+void tst_QWKPage::cleanup()
+{
+ m_page.reset();
+ m_context.reset();
+}
+
+void tst_QWKPage::loadEmptyUrl()
+{
+ m_page->load(QUrl());
+ m_page->load(QUrl(QLatin1String("")));
+}
+
+QTEST_MAIN(tst_QWKPage)
+
+#include "tst_qwkpage.moc"
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/tests.pri b/Source/WebKit2/UIProcess/API/qt/tests/tests.pri
index 3a2aac1..032acc3 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/tests.pri
+++ b/Source/WebKit2/UIProcess/API/qt/tests/tests.pri
@@ -13,4 +13,4 @@ include(../../../../../WebKit.pri)
QT += testlib
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-DEFINES += TESTDIR=\\\"$$PWD\\\"
+!symbian: DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD\\\"
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/tests.pro b/Source/WebKit2/UIProcess/API/qt/tests/tests.pro
index eb85021..f8db5a4 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/tests.pro
+++ b/Source/WebKit2/UIProcess/API/qt/tests/tests.pro
@@ -1,2 +1,2 @@
TEMPLATE = subdirs
-SUBDIRS = qgraphicswkview
+SUBDIRS = qgraphicswkview qwkpage