summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-04-19 00:02:16 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-04-19 00:02:16 +0200
commit2ba0e25a0c6fee7e2144f1fc8b577f73e1155e6d (patch)
tree504e526cbb840733a316714c890fb25d1d64eb1c /tests
parent2c246e60e886b082e7438cf8f68cdc22bc919fd9 (diff)
parentf5ec28285ab7f71d6d75af963ae499603da6630e (diff)
Merge remote-tracking branch 'origin/5.5' into dev
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/publicapi/tst_publicapi.cpp50
-rw-r--r--tests/auto/quick/qmltests/data/append-document-title.js1
-rw-r--r--tests/auto/quick/qmltests/data/big-user-script.js110
-rw-r--r--tests/auto/quick/qmltests/data/change-document-title.js1
-rw-r--r--tests/auto/quick/qmltests/data/tst_userScripts.qml168
-rw-r--r--tests/auto/quick/qmltests/qmltests.pro8
-rw-r--r--tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp41
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp5
8 files changed, 336 insertions, 48 deletions
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp
index af24f42ed..eb925b178 100644
--- a/tests/auto/quick/publicapi/tst_publicapi.cpp
+++ b/tests/auto/quick/publicapi/tst_publicapi.cpp
@@ -116,6 +116,8 @@ static QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.HttpErrorDomain --> ErrorDomain"
<< "QQuickWebEngineView.FtpErrorDomain --> ErrorDomain"
<< "QQuickWebEngineView.DnsErrorDomain --> ErrorDomain"
+ << "QQuickWebEngineView.FindBackward --> FindFlags"
+ << "QQuickWebEngineView.FindCaseSensitively --> FindFlags"
<< "QQuickWebEngineView.LinkClickedNavigation --> NavigationType"
<< "QQuickWebEngineView.TypedNavigation --> NavigationType"
<< "QQuickWebEngineView.FormSubmittedNavigation --> NavigationType"
@@ -170,17 +172,29 @@ static QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.navigationHistory --> QQuickWebEngineHistory*"
<< "QQuickWebEngineView.newViewRequested(QQuickWebEngineNewViewRequest*) --> void"
<< "QQuickWebEngineView.userScripts --> QQmlListProperty<QQuickWebEngineScript>"
+ << "QQuickWebEngineView.settings --> QQuickWebEngineSettings*"
+ << "QQuickWebEngineView.testSupport --> QQuickWebEngineTestSupport*"
+ << "QQuickWebEngineView.webChannel --> QQmlWebChannel*"
+ << "QQuickWebEngineView.webChannelChanged() --> void"
+ << "QQuickWebEngineView.reloadAndBypassCache() --> void"
+ << "QQuickWebEngineView.findText(QString,FindFlags,QJSValue) --> void"
+ << "QQuickWebEngineView.findText(QString,FindFlags) --> void"
+ << "QQuickWebEngineView.findText(QString) --> void"
<< "QQuickWebEngineDownloadItem.id --> uint"
<< "QQuickWebEngineDownloadItem.state --> DownloadState"
- << "QQuickWebEngineDownloadItem.progress --> int"
<< "QQuickWebEngineDownloadItem.path --> QString"
+ << "QQuickWebEngineDownloadItem.totalBytes --> qlonglong"
+ << "QQuickWebEngineDownloadItem.receivedBytes --> qlonglong"
+ << "QQuickWebEngineDownloadItem.DownloadRequested --> DownloadState"
<< "QQuickWebEngineDownloadItem.DownloadInProgress --> DownloadState"
<< "QQuickWebEngineDownloadItem.DownloadCompleted --> DownloadState"
<< "QQuickWebEngineDownloadItem.DownloadCancelled --> DownloadState"
<< "QQuickWebEngineDownloadItem.DownloadInterrupted --> DownloadState"
<< "QQuickWebEngineDownloadItem.stateChanged() --> void"
- << "QQuickWebEngineDownloadItem.progressChanged() --> void"
<< "QQuickWebEngineDownloadItem.pathChanged() --> void"
+ << "QQuickWebEngineDownloadItem.receivedBytesChanged() --> void"
+ << "QQuickWebEngineDownloadItem.totalBytesChanged() --> void"
+ << "QQuickWebEngineDownloadItem.accept() --> void"
<< "QQuickWebEngineDownloadItem.cancel() --> void"
<< "QQuickWebEngineHistory.items --> QQuickWebEngineHistoryListModel*"
<< "QQuickWebEngineHistory.backItems --> QQuickWebEngineHistoryListModel*"
@@ -210,7 +224,7 @@ static QStringList expectedAPI = QStringList()
<< "QQuickWebEngineProfile.httpUserAgent --> QString"
<< "QQuickWebEngineProfile.httpCacheType --> HttpCacheType"
<< "QQuickWebEngineProfile.persistentCookiesPolicy --> PersistentCookiesPolicy"
- << "QQuickWebEngineProfile.httpCacheMaxSize --> int"
+ << "QQuickWebEngineProfile.httpCacheMaximumSize --> int"
<< "QQuickWebEngineProfile.storageNameChanged() --> void"
<< "QQuickWebEngineProfile.offTheRecordChanged() --> void"
<< "QQuickWebEngineProfile.persistentStoragePathChanged() --> void"
@@ -218,7 +232,33 @@ static QStringList expectedAPI = QStringList()
<< "QQuickWebEngineProfile.httpUserAgentChanged() --> void"
<< "QQuickWebEngineProfile.httpCacheTypeChanged() --> void"
<< "QQuickWebEngineProfile.persistentCookiesPolicyChanged() --> void"
- << "QQuickWebEngineProfile.httpCacheMaxSizeChanged() --> void"
+ << "QQuickWebEngineProfile.httpCacheMaximumSizeChanged() --> void"
+ << "QQuickWebEngineProfile.downloadRequested(QQuickWebEngineDownloadItem*) --> void"
+ << "QQuickWebEngineProfile.downloadFinished(QQuickWebEngineDownloadItem*) --> void"
+ << "QQuickWebEngineSettings.autoLoadImages --> bool"
+ << "QQuickWebEngineSettings.javascriptEnabled --> bool"
+ << "QQuickWebEngineSettings.javascriptCanOpenWindows --> bool"
+ << "QQuickWebEngineSettings.javascriptCanAccessClipboard --> bool"
+ << "QQuickWebEngineSettings.linksIncludedInFocusChain --> bool"
+ << "QQuickWebEngineSettings.localStorageEnabled --> bool"
+ << "QQuickWebEngineSettings.localContentCanAccessRemoteUrls --> bool"
+ << "QQuickWebEngineSettings.spatialNavigationEnabled --> bool"
+ << "QQuickWebEngineSettings.localContentCanAccessFileUrls --> bool"
+ << "QQuickWebEngineSettings.hyperlinkAuditingEnabled --> bool"
+ << "QQuickWebEngineSettings.errorPageEnabled --> bool"
+ << "QQuickWebEngineSettings.defaultTextEncoding --> QString"
+ << "QQuickWebEngineSettings.autoLoadImagesChanged() --> void"
+ << "QQuickWebEngineSettings.javascriptEnabledChanged() --> void"
+ << "QQuickWebEngineSettings.javascriptCanOpenWindowsChanged() --> void"
+ << "QQuickWebEngineSettings.javascriptCanAccessClipboardChanged() --> void"
+ << "QQuickWebEngineSettings.linksIncludedInFocusChainChanged() --> void"
+ << "QQuickWebEngineSettings.localStorageEnabledChanged() --> void"
+ << "QQuickWebEngineSettings.localContentCanAccessRemoteUrlsChanged() --> void"
+ << "QQuickWebEngineSettings.spatialNavigationEnabledChanged() --> void"
+ << "QQuickWebEngineSettings.localContentCanAccessFileUrlsChanged() --> void"
+ << "QQuickWebEngineSettings.hyperlinkAuditingEnabledChanged() --> void"
+ << "QQuickWebEngineSettings.errorPageEnabledChanged() --> void"
+ << "QQuickWebEngineSettings.defaultTextEncodingChanged() --> void"
<< "QQuickWebEngineCertificateError.ignoreCertificateError() --> void"
<< "QQuickWebEngineCertificateError.rejectCertificate() --> void"
<< "QQuickWebEngineCertificateError.defer() --> void"
@@ -226,8 +266,6 @@ static QStringList expectedAPI = QStringList()
<< "QQuickWebEngineCertificateError.error --> Error"
<< "QQuickWebEngineCertificateError.description --> QString"
<< "QQuickWebEngineCertificateError.overridable --> bool"
- << "QQuickWebEngineProfile.downloadStarted(QQuickWebEngineDownloadItem*) --> void"
- << "QQuickWebEngineProfile.downloadFinished(QQuickWebEngineDownloadItem*) --> void"
<< "QQuickWebEngineScript.Deferred --> InjectionPoint"
<< "QQuickWebEngineScript.DocumentReady --> InjectionPoint"
<< "QQuickWebEngineScript.DocumentCreation --> InjectionPoint"
diff --git a/tests/auto/quick/qmltests/data/append-document-title.js b/tests/auto/quick/qmltests/data/append-document-title.js
new file mode 100644
index 000000000..fb4a2a6f2
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/append-document-title.js
@@ -0,0 +1 @@
+document.title += " with appendix";
diff --git a/tests/auto/quick/qmltests/data/big-user-script.js b/tests/auto/quick/qmltests/data/big-user-script.js
new file mode 100644
index 000000000..e6e3d2b44
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/big-user-script.js
@@ -0,0 +1,110 @@
+// Used to make sure serialization of user scripts between UI process and Web process can handle files bigger
+// than the maximum message size defined in ConnectionXXX classes.
+
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+// ////////////////////////////////////////////////////////////////////////////////////////////////////
+
+document.title = "Big user script changed title";
diff --git a/tests/auto/quick/qmltests/data/change-document-title.js b/tests/auto/quick/qmltests/data/change-document-title.js
new file mode 100644
index 000000000..bdae45c21
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/change-document-title.js
@@ -0,0 +1 @@
+document.title = "New title";
diff --git a/tests/auto/quick/qmltests/data/tst_userScripts.qml b/tests/auto/quick/qmltests/data/tst_userScripts.qml
new file mode 100644
index 000000000..a9ed933d9
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_userScripts.qml
@@ -0,0 +1,168 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtTest 1.0
+import QtWebEngine 1.1
+
+Item {
+ WebEngineScript {
+ id: changeDocumentTitleScript
+ sourceUrl: Qt.resolvedUrl("change-document-title.js")
+ injectionPoint: WebEngineScript.DocumentReady
+ }
+
+ WebEngineScript {
+ id: appendDocumentTitleScript
+ sourceUrl: Qt.resolvedUrl("append-document-title.js")
+ injectionPoint: WebEngineScript.DocumentReady
+ }
+
+ WebEngineScript {
+ id: bigUserScript
+ sourceUrl: Qt.resolvedUrl("big-user-script.js")
+ injectionPoint: WebEngineScript.DocumentReady
+ }
+
+ TestWebEngineView {
+ id: webEngineView
+ width: 400
+ height: 300
+ }
+
+ TestWebEngineView {
+ id: webEngineViewWithConditionalUserScripts
+ width: 400
+ height: 300
+
+ onNavigationRequested: {
+ var urlString = request.url.toString();
+ if (urlString.indexOf("test1.html") !== -1)
+ userScripts = [ changeDocumentTitleScript ];
+ else if (urlString.indexOf("test2.html") !== -1)
+ userScripts = [ appendDocumentTitleScript ];
+ else
+ userScripts = [];
+ }
+ }
+
+ TestCase {
+ name: "WebEngineViewUserScripts"
+
+ function init() {
+ webEngineView.url = "";
+ webEngineView.userScripts = [];
+ }
+
+ function test_oneScript() {
+ webEngineView.url = Qt.resolvedUrl("test1.html");
+ webEngineView.waitForLoadSucceeded();
+ compare(webEngineView.title, "Test page 1");
+
+ webEngineView.userScripts = [ changeDocumentTitleScript ];
+ compare(webEngineView.title, "Test page 1");
+
+ webEngineView.reload();
+ webEngineView.waitForLoadSucceeded();
+ compare(webEngineView.title, "New title");
+
+ webEngineView.url = Qt.resolvedUrl("test2.html");
+ webEngineView.waitForLoadSucceeded();
+ compare(webEngineView.title, "New title");
+
+ webEngineView.userScripts = [];
+ compare(webEngineView.title, "New title");
+
+ webEngineView.reload();
+ webEngineView.waitForLoadSucceeded();
+ compare(webEngineView.title, "Test page with huge link area");
+ }
+
+ function test_twoScripts() {
+ webEngineView.url = Qt.resolvedUrl("test1.html");
+ webEngineView.waitForLoadSucceeded();
+ compare(webEngineView.title, "Test page 1");
+
+ webEngineView.userScripts = [ changeDocumentTitleScript, appendDocumentTitleScript ];
+
+ // Make sure the scripts are loaded in order.
+ appendDocumentTitleScript.injectionPoint = WebEngineScript.Deferred
+ webEngineView.reload();
+ webEngineView.waitForLoadSucceeded();
+ compare(webEngineView.title, "New title with appendix");
+
+ appendDocumentTitleScript.injectionPoint = WebEngineScript.DocumentReady
+ changeDocumentTitleScript.injectionPoint = WebEngineScript.Deferred
+ webEngineView.reload();
+ webEngineView.waitForLoadSucceeded();
+ compare(webEngineView.title, "New title");
+
+ // Make sure we can remove scripts from the preload list.
+ webEngineView.userScripts = [ appendDocumentTitleScript ];
+ webEngineView.reload();
+ webEngineView.waitForLoadSucceeded();
+ compare(webEngineView.title, "Test page 1 with appendix");
+
+ changeDocumentTitleScript.injectionPoint = WebEngineScript.DocumentReady
+ }
+
+ function test_setUserScriptsConditionally() {
+ webEngineViewWithConditionalUserScripts.url = Qt.resolvedUrl("test1.html");
+ webEngineViewWithConditionalUserScripts.waitForLoadSucceeded();
+ compare(webEngineViewWithConditionalUserScripts.title, "New title");
+
+ webEngineViewWithConditionalUserScripts.url = Qt.resolvedUrl("test2.html");
+ webEngineViewWithConditionalUserScripts.waitForLoadSucceeded();
+ compare(webEngineViewWithConditionalUserScripts.title, "Test page with huge link area with appendix");
+
+ webEngineViewWithConditionalUserScripts.url = Qt.resolvedUrl("test3.html");
+ webEngineViewWithConditionalUserScripts.waitForLoadSucceeded();
+ compare(webEngineViewWithConditionalUserScripts.title, "Test page 3");
+ }
+
+ function test_bigScript() {
+ webEngineView.userScripts = [ bigUserScript ];
+ webEngineView.url = Qt.resolvedUrl("test1.html");
+ webEngineView.waitForLoadSucceeded();
+ compare(webEngineView.title, "Big user script changed title");
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/qmltests.pro b/tests/auto/quick/qmltests/qmltests.pro
index c2e915c35..a8a63fd5a 100644
--- a/tests/auto/quick/qmltests/qmltests.pro
+++ b/tests/auto/quick/qmltests/qmltests.pro
@@ -7,6 +7,9 @@ IMPORTPATH += $$PWD/data
OTHER_FILES += \
$$PWD/data/TestWebEngineView.qml \
$$PWD/data/alert.html \
+ $$PWD/data/append-document-title.js \
+ $$PWD/data/big-user-script.js \
+ $$PWD/data/change-document-title.js \
$$PWD/data/confirm.html \
$$PWD/data/favicon.html \
$$PWD/data/favicon.png \
@@ -36,6 +39,9 @@ OTHER_FILES += \
$$PWD/data/tst_properties.qml \
$$PWD/data/tst_runJavaScript.qml \
$$PWD/data/tst_titleChanged.qml \
+ $$PWD/data/tst_unhandledKeyEventPropagation.qml \
+ $$PWD/data/tst_userScripts.qml \
+ $$PWD/data/tst_webchannel.qml \
$$PWD/data/tst_keyboardModifierMapping.qml \
$$PWD/mock-delegates/QtWebEngine/UIDelegates/AlertDialog.qml \
$$PWD/mock-delegates/QtWebEngine/UIDelegates/ConfirmDialog.qml \
@@ -46,7 +52,7 @@ OTHER_FILES += \
load(qt_build_paths)
-DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$PWD$${QMAKE_DIR_SEP}data\\\"\"
+DEFINES += QUICK_TEST_SOURCE_DIR=\\\"$$re_escape($$PWD$${QMAKE_DIR_SEP}data)\\\"
!isQMLTestSupportApiEnabled() {
PLUGIN_EXTENSION = .so
diff --git a/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp b/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp
index 9901bcd76..00e1b1123 100644
--- a/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp
+++ b/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp
@@ -87,8 +87,6 @@ private Q_SLOTS:
void setContent();
void setCacheLoadControlAttribute();
void setUrlWithPendingLoads();
- void setUrlWithFragment_data();
- void setUrlWithFragment();
void setUrlToEmpty();
void setUrlToInvalid();
void setUrlHistory();
@@ -1227,45 +1225,6 @@ void tst_QWebEngineFrame::setUrlWithPendingLoads()
page.setUrl(QUrl("about:blank"));
}
-void tst_QWebEngineFrame::setUrlWithFragment_data()
-{
- QTest::addColumn<QUrl>("previousUrl");
- QTest::newRow("empty") << QUrl();
- QTest::newRow("same URL no fragment") << QUrl("qrc:/test1.html");
- // See comments in setUrlSameUrl about using setUrl() with the same url().
- QTest::newRow("same URL with same fragment") << QUrl("qrc:/test1.html#");
- QTest::newRow("same URL with different fragment") << QUrl("qrc:/test1.html#anotherFragment");
- QTest::newRow("another URL") << QUrl("qrc:/test2.html");
-}
-
-// Based on bug report https://bugs.webkit.org/show_bug.cgi?id=32723
-void tst_QWebEngineFrame::setUrlWithFragment()
-{
- QSKIP("FIXME: https://trello.com/c/3L7F8VZJ/217-take-care-about-the-in-page-navigations-in-the-tests");
- QFETCH(QUrl, previousUrl);
-
- QWebEnginePage page;
-
- if (!previousUrl.isEmpty()) {
- page.load(previousUrl);
- ::waitForSignal(&page, SIGNAL(loadFinished(bool)));
- QCOMPARE(page.url(), previousUrl);
- }
-
- QSignalSpy spy(&page, SIGNAL(urlChanged(QUrl)));
- const QUrl url("qrc:/test1.html#");
- QVERIFY(!url.fragment().isNull());
-
- page.setUrl(url);
- ::waitForSignal(&page, SIGNAL(urlChanged(QUrl)));
-
- QCOMPARE(spy.count(), 1);
- QVERIFY(!toPlainTextSync(&page).isEmpty());
- // Slight change: This information now comes from Chromium and the behavior of requestedUrl changed in this case.
- // QCOMPARE(page.requestedUrl(), url);
- QCOMPARE(page.url(), url);
-}
-
void tst_QWebEngineFrame::setUrlToEmpty()
{
int expectedLoadFinishedCount = 0;
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 970ebf20a..9562871b3 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -1661,6 +1661,7 @@ void tst_QWebEnginePage::inputMethods_data()
QTest::newRow("QGraphicsWebView") << "QGraphicsWebView";
}
+#if defined(QWEBENGINEPAGE_INPUTMETHODQUERY)
static Qt::InputMethodHints inputMethodHints(QObject* object)
{
if (QGraphicsObject* o = qobject_cast<QGraphicsObject*>(object))
@@ -1686,6 +1687,7 @@ static void clickOnPage(QWebEnginePage* page, const QPoint& position)
QMouseEvent evrel(QEvent::MouseButtonRelease, position, Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
page->event(&evrel);
}
+#endif
void tst_QWebEnginePage::inputMethods()
{
@@ -2827,6 +2829,7 @@ public:
protected:
virtual QString userAgentForUrl(const QUrl& url) const
{
+ Q_UNUSED(url);
return QString("My User Agent\nX-New-Http-Header: Oh Noes!");
}
};
@@ -3178,6 +3181,7 @@ void tst_QWebEnginePage::findTextSuccessiveShouldCallAllCallbacks()
QVERIFY(spy5.wasCalled());
}
+#if defined(QWEBENGINEPAGE_SUPPORTEDCONTENTTYPES)
static QString getMimeTypeForExtension(const QString &ext)
{
QMimeType mimeType = QMimeDatabase().mimeTypeForFile(QStringLiteral("filename.") + ext.toLower(), QMimeDatabase::MatchExtension);
@@ -3186,6 +3190,7 @@ static QString getMimeTypeForExtension(const QString &ext)
return QString();
}
+#endif
void tst_QWebEnginePage::supportedContentType()
{