summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick')
-rw-r--r--tests/auto/quick/dialogs/WebView.qml10
-rw-r--r--tests/auto/quick/dialogs/dialogs.pro13
-rw-r--r--tests/auto/quick/dialogs/dialogs.qrc6
-rw-r--r--tests/auto/quick/inspectorserver/inspectorserver.pro4
-rw-r--r--tests/auto/quick/inspectorserver/tst_inspectorserver.cpp4
-rw-r--r--tests/auto/quick/publicapi/CMakeLists.txt1
-rw-r--r--tests/auto/quick/publicapi/publicapi.pro3
-rw-r--r--tests/auto/quick/publicapi/tst_publicapi.cpp23
-rw-r--r--tests/auto/quick/qmltests/BLACKLIST5
-rw-r--r--tests/auto/quick/qmltests/data/TestWebEngineView.qml16
-rw-r--r--tests/auto/quick/qmltests/data/tst_action.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_activeFocusOnPress.qml4
-rw-r--r--tests/auto/quick/qmltests/data/tst_audioMuted.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_certificateError.qml30
-rw-r--r--tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml8
-rw-r--r--tests/auto/quick/qmltests/data/tst_download.qml10
-rw-r--r--tests/auto/quick/qmltests/data/tst_filePicker.qml10
-rw-r--r--tests/auto/quick/qmltests/data/tst_findText.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_focusOnNavigation.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_fullScreenRequest.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_geopermission.qml8
-rw-r--r--tests/auto/quick/qmltests/data/tst_getUserMedia.qml8
-rw-r--r--tests/auto/quick/qmltests/data/tst_inputMethod.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_keyboardEvents.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_linkHovered.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadFail.qml8
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadHtml.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadProgress.qml8
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadUrl.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_mouseClick.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_mouseMove.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_navigationHistory.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_navigationRequested.qml30
-rw-r--r--tests/auto/quick/qmltests/data/tst_newViewRequest.qml32
-rw-r--r--tests/auto/quick/qmltests/data/tst_notification.qml10
-rw-r--r--tests/auto/quick/qmltests/data/tst_properties.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_runJavaScript.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_scrollPosition.qml8
-rw-r--r--tests/auto/quick/qmltests/data/tst_settings.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_titleChanged.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml14
-rw-r--r--tests/auto/quick/qmltests/data/tst_userScripts.qml8
-rw-r--r--tests/auto/quick/qmltests/data/tst_viewSource.qml10
-rw-r--r--tests/auto/quick/qmltests/data/tst_webchannel.qml8
-rw-r--r--tests/auto/quick/qmltests/mock-delegates/TestParams/FilePickerParams.qml2
-rw-r--r--tests/auto/quick/qmltests/mock-delegates/TestParams/JSDialogParams.qml2
-rw-r--r--tests/auto/quick/qmltests/qmltests.pro134
-rw-r--r--tests/auto/quick/qmltests/tst_qmltests.cpp4
-rw-r--r--tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro6
-rw-r--r--tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp4
-rw-r--r--tests/auto/quick/qquickwebengineview/CMakeLists.txt1
-rw-r--r--tests/auto/quick/qquickwebengineview/qquickwebengineview.pro6
-rw-r--r--tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp8
-rw-r--r--tests/auto/quick/qquickwebengineviewgraphics/CMakeLists.txt1
-rw-r--r--tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro4
-rw-r--r--tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp2
-rw-r--r--tests/auto/quick/qtbug-70248/qtbug-70248.pro5
-rw-r--r--tests/auto/quick/qtbug-70248/test.qml6
-rw-r--r--tests/auto/quick/qtbug-70248/test.qrc5
-rw-r--r--tests/auto/quick/quick.pro16
-rw-r--r--tests/auto/quick/tests.pri20
-rw-r--r--tests/auto/quick/uidelegates/tst_uidelegates.cpp7
64 files changed, 229 insertions, 405 deletions
diff --git a/tests/auto/quick/dialogs/WebView.qml b/tests/auto/quick/dialogs/WebView.qml
index 01f4ac29..29b5d2ca 100644
--- a/tests/auto/quick/dialogs/WebView.qml
+++ b/tests/auto/quick/dialogs/WebView.qml
@@ -26,11 +26,11 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtWebEngine 1.4
-import QtQuick.Window 2.0
-import QtTest 1.0
-import io.qt.tester 1.0
+import QtQuick
+import QtWebEngine
+import QtQuick.Window
+import QtTest
+import io.qt.tester
Window {
width: 50
diff --git a/tests/auto/quick/dialogs/dialogs.pro b/tests/auto/quick/dialogs/dialogs.pro
deleted file mode 100644
index 79952d8e..00000000
--- a/tests/auto/quick/dialogs/dialogs.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-include(../tests.pri)
-QT += core-private webenginequick webenginequick-private
-
-HEADERS += \
- server.h \
- testhandler.h
-
-SOURCES += \
- server.cpp \
- testhandler.cpp
-
-RESOURCES += \
- dialogs.qrc
diff --git a/tests/auto/quick/dialogs/dialogs.qrc b/tests/auto/quick/dialogs/dialogs.qrc
deleted file mode 100644
index a0715dbc..00000000
--- a/tests/auto/quick/dialogs/dialogs.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>index.html</file>
- <file>WebView.qml</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/quick/inspectorserver/inspectorserver.pro b/tests/auto/quick/inspectorserver/inspectorserver.pro
deleted file mode 100644
index 5110a3ae..00000000
--- a/tests/auto/quick/inspectorserver/inspectorserver.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-include(../tests.pri)
-QT += webenginequick
-QT_PRIVATE += core-private webenginequick-private webenginecore-private
-DEFINES += IMPORT_DIR=\"\\\"$${ROOT_BUILD_DIR}$${QMAKE_DIR_SEP}imports\\\"\"
diff --git a/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp b/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp
index 2879895c..7b85c734 100644
--- a/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp
+++ b/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp
@@ -72,8 +72,8 @@ void tst_InspectorServer::prepareWebViewComponent()
static QQmlEngine* engine = new QQmlEngine(this);
m_component.reset(new QQmlComponent(engine, this));
- m_component->setData(QByteArrayLiteral("import QtQuick 2.0\n"
- "import QtWebEngine 1.2\n"
+ m_component->setData(QByteArrayLiteral("import QtQuick\n"
+ "import QtWebEngine\n"
"WebEngineView { }")
, QUrl());
}
diff --git a/tests/auto/quick/publicapi/CMakeLists.txt b/tests/auto/quick/publicapi/CMakeLists.txt
index abed54a1..4fa18e0b 100644
--- a/tests/auto/quick/publicapi/CMakeLists.txt
+++ b/tests/auto/quick/publicapi/CMakeLists.txt
@@ -4,5 +4,4 @@ qt_internal_add_test(tst_publicapi
LIBRARIES
Qt::CorePrivate
Qt::WebEngineQuickPrivate
- Qt::WebEngineWidgetsPrivate
)
diff --git a/tests/auto/quick/publicapi/publicapi.pro b/tests/auto/quick/publicapi/publicapi.pro
deleted file mode 100644
index bb0e03f6..00000000
--- a/tests/auto/quick/publicapi/publicapi.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-include(../tests.pri)
-QT += webenginequick
-QT_PRIVATE += core-private webenginequick-private webenginecore-private
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp
index fe0b9d2b..c8e09f1c 100644
--- a/tests/auto/quick/publicapi/tst_publicapi.cpp
+++ b/tests/auto/quick/publicapi/tst_publicapi.cpp
@@ -52,7 +52,7 @@
#include <private/qquickwebengineclientcertificateselection_p.h>
#include <private/qquickwebenginedialogrequests_p.h>
#include <private/qquickwebenginedownloadrequest_p.h>
-#include <private/qquickwebenginenewviewrequest_p.h>
+#include <private/qquickwebenginenewwindowrequest_p.h>
#include <private/qquickwebenginesettings_p.h>
#include <private/qquickwebenginesingleton_p.h>
@@ -80,7 +80,7 @@ static const QList<const QMetaObject *> typesToCheck = QList<const QMetaObject *
<< &QQuickWebEngineJavaScriptDialogRequest::staticMetaObject
<< &QQuickWebEngineColorDialogRequest::staticMetaObject
<< &QQuickWebEngineFileDialogRequest::staticMetaObject
- << &QQuickWebEngineNewViewRequest::staticMetaObject
+ << &QQuickWebEngineNewWindowRequest::staticMetaObject
<< &QQuickWebEngineTooltipRequest::staticMetaObject
<< &QWebEngineContextMenuRequest::staticMetaObject
<< &QWebEngineCertificateError::staticMetaObject
@@ -343,7 +343,7 @@ static const QStringList expectedAPI = QStringList()
<< "QWebEngineNewWindowRequest.InNewDialog --> DestinationType"
<< "QWebEngineNewWindowRequest.InNewTab --> DestinationType"
<< "QWebEngineNewWindowRequest.InNewWindow --> DestinationType"
- << "QQuickWebEngineNewViewRequest.openIn(QQuickWebEngineView*) --> void"
+ << "QQuickWebEngineNewWindowRequest.openIn(QQuickWebEngineView*) --> void"
<< "QQuickWebEngineProfile.AllowPersistentCookies --> PersistentCookiesPolicy"
<< "QQuickWebEngineProfile.DiskHttpCache --> HttpCacheType"
<< "QQuickWebEngineProfile.ForcePersistentCookies --> PersistentCookiesPolicy"
@@ -715,7 +715,20 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.loading --> bool"
<< "QQuickWebEngineView.loadingChanged(QWebEngineLoadingInfo) --> void"
<< "QQuickWebEngineView.navigationRequested(QWebEngineNavigationRequest*) --> void"
- << "QQuickWebEngineView.newViewRequested(QQuickWebEngineNewViewRequest*) --> void"
+ << "QQuickWebEngineView.newWindowRequested(QQuickWebEngineNewWindowRequest*) --> void"
+ << "QQuickWebEngineView.AcceptRequest --> NavigationRequestAction"
+ << "QQuickWebEngineView.IgnoreRequest --> NavigationRequestAction"
+ << "QQuickWebEngineView.BackForwardNavigation --> NavigationType"
+ << "QQuickWebEngineView.FormSubmittedNavigation --> NavigationType"
+ << "QQuickWebEngineView.LinkClickedNavigation --> NavigationType"
+ << "QQuickWebEngineView.OtherNavigation --> NavigationType"
+ << "QQuickWebEngineView.RedirectNavigation --> NavigationType"
+ << "QQuickWebEngineView.ReloadNavigation --> NavigationType"
+ << "QQuickWebEngineView.TypedNavigation --> NavigationType"
+ << "QQuickWebEngineView.NewViewInBackgroundTab --> NewViewDestination"
+ << "QQuickWebEngineView.NewViewInDialog --> NewViewDestination"
+ << "QQuickWebEngineView.NewViewInTab --> NewViewDestination"
+ << "QQuickWebEngineView.NewViewInWindow --> NewViewDestination"
<< "QQuickWebEngineView.pdfPrintingFinished(QString,bool) --> void"
<< "QQuickWebEngineView.printRequested() --> void"
<< "QQuickWebEngineView.printToPdf(QJSValue) --> void"
@@ -764,7 +777,7 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.windowCloseRequested() --> void"
<< "QQuickWebEngineView.zoomFactor --> double"
<< "QQuickWebEngineView.zoomFactorChanged(double) --> void"
- << "QQuickWebEngineView.acceptAsNewView(QWebEngineNewWindowRequest*) --> void"
+ << "QQuickWebEngineView.acceptAsNewWindow(QWebEngineNewWindowRequest*) --> void"
<< "QWebEngineQuotaRequest.accept() --> void"
<< "QWebEngineQuotaRequest.origin --> QUrl"
<< "QWebEngineQuotaRequest.reject() --> void"
diff --git a/tests/auto/quick/qmltests/BLACKLIST b/tests/auto/quick/qmltests/BLACKLIST
index f4d7d98d..f4009e16 100644
--- a/tests/auto/quick/qmltests/BLACKLIST
+++ b/tests/auto/quick/qmltests/BLACKLIST
@@ -1,5 +1,8 @@
-[NewViewRequest::test_loadNewViewRequest]
+[NewWindowRequest::test_loadNewWindowRequest]
macos
[WebEngineViewContextMenu::test_contextMenuLinkAndSelectedText]
macos
+
+[CertificateError::test_fatalError]
+*
diff --git a/tests/auto/quick/qmltests/data/TestWebEngineView.qml b/tests/auto/quick/qmltests/data/TestWebEngineView.qml
index aa9d67d9..68417c6c 100644
--- a/tests/auto/quick/qmltests/data/TestWebEngineView.qml
+++ b/tests/auto/quick/qmltests/data/TestWebEngineView.qml
@@ -35,19 +35,29 @@ WebEngineView {
property bool windowCloseRequestedSignalEmitted: false
settings.focusOnNavigationEnabled: true
+ function loadSucceeded() { return loadStatus == WebEngineView.LoadSucceededStatus }
+ function loadFailed() { return loadStatus == WebEngineView.LoadFailedStatus }
+ function loadStopped() { return loadStatus == WebEngineView.LoadStoppedStatus }
+
+ function waitForLoadResult(timeout) {
+ loadStatus = null
+ var r = _waitFor(function() { return loadStatus != null && loadStatus != WebEngineView.LoadStartedStatus }, timeout)
+ return r
+ }
+
function waitForLoadSucceeded(timeout) {
- var success = _waitFor(function() { return loadStatus == WebEngineView.LoadSucceededStatus }, timeout)
loadStatus = null
+ var success = _waitFor(function() { return loadStatus == WebEngineView.LoadSucceededStatus }, timeout)
return success
}
function waitForLoadFailed(timeout) {
- var failure = _waitFor(function() { return loadStatus == WebEngineView.LoadFailedStatus }, timeout)
loadStatus = null
+ var failure = _waitFor(function() { return loadStatus == WebEngineView.LoadFailedStatus }, timeout)
return failure
}
function waitForLoadStopped(timeout) {
- var stop = _waitFor(function() { return loadStatus == WebEngineView.LoadStoppedStatus }, timeout)
loadStatus = null
+ var stop = _waitFor(function() { return loadStatus == WebEngineView.LoadStoppedStatus }, timeout)
return stop
}
function waitForWindowCloseRequested() {
diff --git a/tests/auto/quick/qmltests/data/tst_action.qml b/tests/auto/quick/qmltests/data/tst_action.qml
index 91f260e0..554f0929 100644
--- a/tests/auto/quick/qmltests/data/tst_action.qml
+++ b/tests/auto/quick/qmltests/data/tst_action.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.2
-import QtTest 1.0
-import QtWebEngine 1.8
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_activeFocusOnPress.qml b/tests/auto/quick/qmltests/data/tst_activeFocusOnPress.qml
index 83a2dc8c..d423bdd1 100644
--- a/tests/auto/quick/qmltests/data/tst_activeFocusOnPress.qml
+++ b/tests/auto/quick/qmltests/data/tst_activeFocusOnPress.qml
@@ -26,8 +26,8 @@
**
****************************************************************************/
-import QtQuick 2.5
-import QtTest 1.0
+import QtQuick
+import QtTest
Item {
id: root
diff --git a/tests/auto/quick/qmltests/data/tst_audioMuted.qml b/tests/auto/quick/qmltests/data/tst_audioMuted.qml
index d0d9e35c..c6a882f5 100644
--- a/tests/auto/quick/qmltests/data/tst_audioMuted.qml
+++ b/tests/auto/quick/qmltests/data/tst_audioMuted.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.4
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: view
diff --git a/tests/auto/quick/qmltests/data/tst_certificateError.qml b/tests/auto/quick/qmltests/data/tst_certificateError.qml
index a707f4a7..a9031896 100644
--- a/tests/auto/quick/qmltests/data/tst_certificateError.qml
+++ b/tests/auto/quick/qmltests/data/tst_certificateError.qml
@@ -26,11 +26,11 @@
**
****************************************************************************/
-import QtQuick 2.2
-import QtTest 1.0
-import QtWebEngine 1.9
+import QtQuick
+import QtTest
+import QtWebEngine
-import Test.Shared 1.0 as Shared
+import Test.Shared as Shared
TestWebEngineView {
id: view; width: 320; height: 320
@@ -121,5 +121,27 @@ TestWebEngineView {
verify(error.overridable)
compare(error.type, WebEngineCertificateError.CertificateAuthorityInvalid)
}
+
+ function test_fatalError() {
+ let error = undefined
+ var handleCertificateError = function(e) { error = e; }
+ view.certificateError.connect(handleCertificateError);
+
+ view.url = Qt.resolvedUrl('https://revoked.badssl.com');
+ if (!view.waitForLoadResult()) {
+ verify(!error, "There shouldn't be any certificate error if not loaded due to missing internet access!");
+ skip("Couldn't load page from network, skipping test.");
+ }
+ view.certificateError.disconnect(handleCertificateError);
+
+ // revoked certificate might not be reported as invalid by chromium and the load will silently succeed
+ const failed = view.loadStatus == WebEngineView.LoadFailedStatus, hasError = Boolean(error)
+ compare(hasError, failed)
+ if (failed) {
+ verify(!error.overridable);
+ // Fatal certificate errors are implicitly rejected. But second call should not cause crash.
+ error.rejectCertificate();
+ }
+ }
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml b/tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml
index 78029434..8ab9925d 100644
--- a/tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml
+++ b/tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -44,7 +44,7 @@ TestWebEngineView {
signalName: "linkHovered"
}
- onLinkHovered: {
+ onLinkHovered: function(hoveredUrl) {
webEngineView.lastUrl = hoveredUrl
}
diff --git a/tests/auto/quick/qmltests/data/tst_download.qml b/tests/auto/quick/qmltests/data/tst_download.qml
index bac4d5cc..93c430a5 100644
--- a/tests/auto/quick/qmltests/data/tst_download.qml
+++ b/tests/auto/quick/qmltests/data/tst_download.qml
@@ -26,11 +26,11 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.10
-import Qt.labs.platform 1.0
-import Test.util 1.0
+import QtQuick
+import QtTest
+import QtWebEngine
+import Qt.labs.platform
+import Test.util
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_filePicker.qml b/tests/auto/quick/qmltests/data/tst_filePicker.qml
index 5b963c7b..475718c3 100644
--- a/tests/auto/quick/qmltests/data/tst_filePicker.qml
+++ b/tests/auto/quick/qmltests/data/tst_filePicker.qml
@@ -26,11 +26,11 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
-import "../../qmltests/data" 1.0
-import "../mock-delegates/TestParams" 1.0
+import QtQuick
+import QtTest
+import QtWebEngine
+import "../../qmltests/data"
+import "../mock-delegates/TestParams"
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_findText.qml b/tests/auto/quick/qmltests/data/tst_findText.qml
index 0b4a8d45..874f6184 100644
--- a/tests/auto/quick/qmltests/data/tst_findText.qml
+++ b/tests/auto/quick/qmltests/data/tst_findText.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_focusOnNavigation.qml b/tests/auto/quick/qmltests/data/tst_focusOnNavigation.qml
index b2b7374f..7ed684f7 100644
--- a/tests/auto/quick/qmltests/data/tst_focusOnNavigation.qml
+++ b/tests/auto/quick/qmltests/data/tst_focusOnNavigation.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.5
-import QtTest 1.0
-import QtWebEngine 1.4
+import QtQuick
+import QtTest
+import QtWebEngine
Item {
id: container
diff --git a/tests/auto/quick/qmltests/data/tst_fullScreenRequest.qml b/tests/auto/quick/qmltests/data/tst_fullScreenRequest.qml
index 2d9247b2..c7996a11 100644
--- a/tests/auto/quick/qmltests/data/tst_fullScreenRequest.qml
+++ b/tests/auto/quick/qmltests/data/tst_fullScreenRequest.qml
@@ -1,6 +1,6 @@
-import QtQuick 2.2
-import QtTest 1.0
-import QtWebEngine 1.9
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: view
diff --git a/tests/auto/quick/qmltests/data/tst_geopermission.qml b/tests/auto/quick/qmltests/data/tst_geopermission.qml
index 9f613abf..d16e94d8 100644
--- a/tests/auto/quick/qmltests/data/tst_geopermission.qml
+++ b/tests/auto/quick/qmltests/data/tst_geopermission.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.2
-import QtTest 1.0
-import QtWebEngine 1.1
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -44,7 +44,7 @@ TestWebEngineView {
signalName: "featurePermissionRequested"
}
- onFeaturePermissionRequested: {
+ onFeaturePermissionRequested: function(securityOrigin, feature) {
if (feature === WebEngineView.Geolocation) {
geoPermissionRequested = true
if (deniedGeolocation) {
diff --git a/tests/auto/quick/qmltests/data/tst_getUserMedia.qml b/tests/auto/quick/qmltests/data/tst_getUserMedia.qml
index 4cfbbf09..fe2d9101 100644
--- a/tests/auto/quick/qmltests/data/tst_getUserMedia.qml
+++ b/tests/auto/quick/qmltests/data/tst_getUserMedia.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.2
-import QtTest 1.0
-import QtWebEngine 1.6
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -143,7 +143,7 @@ TestWebEngineView {
property variant requestedFeature
property variant requestedSecurityOrigin
- onFeaturePermissionRequested: {
+ onFeaturePermissionRequested: function(securityOrigin, feature) {
requestedFeature = feature
requestedSecurityOrigin = securityOrigin
}
diff --git a/tests/auto/quick/qmltests/data/tst_inputMethod.qml b/tests/auto/quick/qmltests/data/tst_inputMethod.qml
index 16b7a06d..0b7135bb 100644
--- a/tests/auto/quick/qmltests/data/tst_inputMethod.qml
+++ b/tests/auto/quick/qmltests/data/tst_inputMethod.qml
@@ -30,7 +30,7 @@ import QtQuick
import QtTest
import QtWebEngine
import Test.util
-import "../../qmltests/data" 1.0
+import "../../qmltests/data"
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml b/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml
index 136863c4..7c594d92 100644
--- a/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml
+++ b/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.4
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml b/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml
index e0a8c0a4..f37cdf4b 100644
--- a/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml
+++ b/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_linkHovered.qml b/tests/auto/quick/qmltests/data/tst_linkHovered.qml
index d21d7443..a1343cbe 100644
--- a/tests/auto/quick/qmltests/data/tst_linkHovered.qml
+++ b/tests/auto/quick/qmltests/data/tst_linkHovered.qml
@@ -29,7 +29,7 @@
import QtQuick
import QtTest
import QtWebEngine
-import "../../qmltests/data" 1.0
+import "../../qmltests/data"
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_loadFail.qml b/tests/auto/quick/qmltests/data/tst_loadFail.qml
index 58d6b9e3..73a3833e 100644
--- a/tests/auto/quick/qmltests/data/tst_loadFail.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadFail.qml
@@ -26,10 +26,10 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
-import "../../qmltests/data" 1.0
+import QtQuick
+import QtTest
+import QtWebEngine
+import "../../qmltests/data"
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_loadHtml.qml b/tests/auto/quick/qmltests/data/tst_loadHtml.qml
index 6ed9a431..c4ed9ed3 100644
--- a/tests/auto/quick/qmltests/data/tst_loadHtml.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadHtml.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_loadProgress.qml b/tests/auto/quick/qmltests/data/tst_loadProgress.qml
index 7bfe1d9e..e4aa2d88 100644
--- a/tests/auto/quick/qmltests/data/tst_loadProgress.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadProgress.qml
@@ -26,11 +26,11 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
-import Test.Shared 1.0 as Shared
+import Test.Shared as Shared
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml b/tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml
index 81a0f090..9d8de0a5 100644
--- a/tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.3
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
Item {
width: 300
diff --git a/tests/auto/quick/qmltests/data/tst_loadUrl.qml b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
index 3a2341fc..c331fab6 100644
--- a/tests/auto/quick/qmltests/data/tst_loadUrl.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_mouseClick.qml b/tests/auto/quick/qmltests/data/tst_mouseClick.qml
index 647c8457..d75298a6 100644
--- a/tests/auto/quick/qmltests/data/tst_mouseClick.qml
+++ b/tests/auto/quick/qmltests/data/tst_mouseClick.qml
@@ -30,7 +30,7 @@ import QtQuick
import QtTest
import QtWebEngine
import Test.util
-import "../../qmltests/data" 1.0
+import "../../qmltests/data"
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_mouseMove.qml b/tests/auto/quick/qmltests/data/tst_mouseMove.qml
index adfa3941..6afab7aa 100644
--- a/tests/auto/quick/qmltests/data/tst_mouseMove.qml
+++ b/tests/auto/quick/qmltests/data/tst_mouseMove.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.4
+import QtQuick
+import QtTest
+import QtWebEngine
Rectangle {
id: root
diff --git a/tests/auto/quick/qmltests/data/tst_navigationHistory.qml b/tests/auto/quick/qmltests/data/tst_navigationHistory.qml
index d5073bef..c7edb05b 100644
--- a/tests/auto/quick/qmltests/data/tst_navigationHistory.qml
+++ b/tests/auto/quick/qmltests/data/tst_navigationHistory.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.15
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_navigationRequested.qml b/tests/auto/quick/qmltests/data/tst_navigationRequested.qml
index 462dc829..b3e247c4 100644
--- a/tests/auto/quick/qmltests/data/tst_navigationRequested.qml
+++ b/tests/auto/quick/qmltests/data/tst_navigationRequested.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -94,19 +94,17 @@ TestWebEngineView {
// Test if we get notified about main frame and iframe loads
compare(navigationSpy.count, 0)
webEngineView.url = Qt.resolvedUrl("test-iframe.html")
- navigationSpy.wait()
+ verify(webEngineView.waitForLoadSucceeded())
compare(attributes.mainUrl, Qt.resolvedUrl("test-iframe.html"))
- navigationSpy.wait()
compare(attributes.iframeUrl, Qt.resolvedUrl("test1.html"))
compare(navigationSpy.count, 2)
- verify(webEngineView.waitForLoadSucceeded())
// Test if we get notified about clicked links
mouseClick(webEngineView, 100, 100)
- tryCompare(navigationSpy, "count", 3)
+ verify(webEngineView.waitForLoadSucceeded())
compare(attributes.mainUrl, Qt.resolvedUrl("test1.html"))
verify(attributes.linkClickedNavigationRequested)
- verify(webEngineView.waitForLoadSucceeded())
+ compare(navigationSpy.count, 3)
}
function test_ignoreLinkClickedRequest() {
@@ -117,26 +115,28 @@ TestWebEngineView {
shouldIgnoreLinkClicks = true
mouseClick(webEngineView, 100, 100)
- tryCompare(navigationSpy, "count", 3)
- compare(attributes.mainUrl, Qt.resolvedUrl("test1.html"))
- verify(attributes.linkClickedNavigationRequested)
- verify(attributes.linkClickedNavigationIgnored)
// We ignored the main frame request, so we should
// get notified that the load has been stopped.
verify(webEngineView.waitForLoadStopped())
verify(!webEngineView.loading)
+
+ compare(navigationSpy.count, 3)
+ compare(attributes.mainUrl, Qt.resolvedUrl("test1.html"))
+ verify(attributes.linkClickedNavigationRequested)
+ verify(attributes.linkClickedNavigationIgnored)
}
function test_ignoreSubFrameRequest() {
// Test if we can ignore sub frame requests
shouldIgnoreSubFrameRequests = true
webEngineView.url = Qt.resolvedUrl("test-iframe.html")
- tryCompare(navigationSpy, "count", 2)
- compare(attributes.mainUrl, Qt.resolvedUrl("test-iframe.html"))
- compare(attributes.iframeUrl, Qt.resolvedUrl("test1.html"))
// We ignored the sub frame request, so
// the main frame load should still succeed.
verify(webEngineView.waitForLoadSucceeded())
+
+ compare(navigationSpy.count, 2)
+ compare(attributes.mainUrl, Qt.resolvedUrl("test-iframe.html"))
+ compare(attributes.iframeUrl, Qt.resolvedUrl("test1.html"))
}
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_newViewRequest.qml b/tests/auto/quick/qmltests/data/tst_newViewRequest.qml
index ac402674..6e1ebc92 100644
--- a/tests/auto/quick/qmltests/data/tst_newViewRequest.qml
+++ b/tests/auto/quick/qmltests/data/tst_newViewRequest.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.5
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
@@ -49,10 +49,10 @@ TestWebEngineView {
SignalSpy {
id: newViewRequestedSpy
target: webEngineView
- signalName: "newViewRequested"
+ signalName: "newWindowRequested"
}
- onNewViewRequested: function(request) {
+ onNewWindowRequested: function(request) {
newViewRequest = {
"destination": request.destination,
"userInitiated": request.userInitiated,
@@ -60,7 +60,7 @@ TestWebEngineView {
};
dialog = Qt.createQmlObject(
- "import QtQuick.Window 2.0\n" +
+ "import QtQuick.Window\n" +
"Window {\n" +
" width: 100; height: 100\n" +
" visible: true; flags: Qt.Dialog\n" +
@@ -78,7 +78,7 @@ TestWebEngineView {
TestCase {
id: testCase
- name: "NewViewRequest"
+ name: "NewWindowRequest"
when: windowShown
function init() {
@@ -96,7 +96,7 @@ TestWebEngineView {
dialog.destroy();
}
- function test_loadNewViewRequest_data() {
+ function test_loadNewWindowRequest_data() {
return [
{ tag: "dialog", viewType: "dialog" },
{ tag: "invalid", viewType: "null" },
@@ -105,7 +105,7 @@ TestWebEngineView {
];
}
- function test_loadNewViewRequest(row) {
+ function test_loadNewWindowRequest(row) {
viewType = row.viewType;
var url = 'data:text/html,%3Chtml%3E%3Cbody%3ETest+Page%3C%2Fbody%3E%3C%2Fhtml%3E';
@@ -118,11 +118,11 @@ TestWebEngineView {
verify(webEngineView.waitForLoadSucceeded());
tryCompare(newViewRequestedSpy, "count", 1);
- compare(newViewRequest.destination, WebEngineNewViewRequest.InNewTab);
+ compare(newViewRequest.destination, WebEngineNewWindowRequest.InNewTab);
verify(!newViewRequest.userInitiated);
if (viewType === "dialog") {
- verify(dialog.webEngineView.waitForLoadSucceeded());
+ tryVerify(dialog.webEngineView.loadSucceeded)
compare(dialog.webEngineView.url, "");
dialog.destroy();
}
@@ -139,11 +139,11 @@ TestWebEngineView {
verify(webEngineView.waitForLoadSucceeded());
tryCompare(newViewRequestedSpy, "count", 1);
- compare(newViewRequest.destination, WebEngineNewViewRequest.InNewDialog);
+ compare(newViewRequest.destination, WebEngineNewWindowRequest.InNewDialog);
compare(newViewRequest.requestedUrl, url);
verify(!newViewRequest.userInitiated);
if (viewType === "dialog") {
- verify(dialog.webEngineView.waitForLoadSucceeded());
+ tryVerify(dialog.webEngineView.loadSucceeded)
dialog.destroy();
}
newViewRequestedSpy.clear();
@@ -163,10 +163,10 @@ TestWebEngineView {
tryCompare(newViewRequestedSpy, "count", 1);
compare(newViewRequest.requestedUrl, url);
- compare(newViewRequest.destination, WebEngineNewViewRequest.InNewDialog);
+ compare(newViewRequest.destination, WebEngineNewWindowRequest.InNewDialog);
verify(newViewRequest.userInitiated);
if (viewType === "dialog") {
- verify(dialog.webEngineView.waitForLoadSucceeded());
+ tryVerify(dialog.webEngineView.loadSucceeded)
dialog.destroy();
}
newViewRequestedSpy.clear();
@@ -180,7 +180,7 @@ TestWebEngineView {
mouseClick(webEngineView, center.x, center.y, Qt.LeftButton, Qt.ControlModifier);
tryCompare(newViewRequestedSpy, "count", 1);
compare(newViewRequest.requestedUrl, Qt.resolvedUrl("test1.html"));
- compare(newViewRequest.destination, WebEngineNewViewRequest.InNewBackgroundTab);
+ compare(newViewRequest.destination, WebEngineNewWindowRequest.InNewBackgroundTab);
verify(newViewRequest.userInitiated);
if (viewType === "" || viewType === "null") {
compare(loadRequestArray[0].status, WebEngineView.LoadStartedStatus);
diff --git a/tests/auto/quick/qmltests/data/tst_notification.qml b/tests/auto/quick/qmltests/data/tst_notification.qml
index 6f66256f..46a21ff4 100644
--- a/tests/auto/quick/qmltests/data/tst_notification.qml
+++ b/tests/auto/quick/qmltests/data/tst_notification.qml
@@ -26,10 +26,10 @@
**
****************************************************************************/
-import QtQuick 2.2
-import QtTest 1.0
-import QtWebEngine 1.9
-import Test.Shared 1.0 as Shared
+import QtQuick
+import QtTest
+import QtWebEngine
+import Test.Shared as Shared
TestWebEngineView {
id: view
@@ -48,7 +48,7 @@ TestWebEngineView {
signalName: 'featurePermissionRequested'
}
- onFeaturePermissionRequested: {
+ onFeaturePermissionRequested: function(securityOrigin, feature) {
if (feature === WebEngineView.Notifications) {
view.permissionRequested = true
view.securityOrigin = securityOrigin
diff --git a/tests/auto/quick/qmltests/data/tst_properties.qml b/tests/auto/quick/qmltests/data/tst_properties.qml
index 89f8af9b..7ae21897 100644
--- a/tests/auto/quick/qmltests/data/tst_properties.qml
+++ b/tests/auto/quick/qmltests/data/tst_properties.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_runJavaScript.qml b/tests/auto/quick/qmltests/data/tst_runJavaScript.qml
index beeebc04..949e50bb 100644
--- a/tests/auto/quick/qmltests/data/tst_runJavaScript.qml
+++ b/tests/auto/quick/qmltests/data/tst_runJavaScript.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_scrollPosition.qml b/tests/auto/quick/qmltests/data/tst_scrollPosition.qml
index 24b352dd..22fa92b8 100644
--- a/tests/auto/quick/qmltests/data/tst_scrollPosition.qml
+++ b/tests/auto/quick/qmltests/data/tst_scrollPosition.qml
@@ -26,10 +26,10 @@
**
****************************************************************************/
-import QtQuick 2.2
-import QtQuick.Window 2.0
-import QtTest 1.0
-import QtWebEngine 1.3
+import QtQuick
+import QtQuick.Window
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_settings.qml b/tests/auto/quick/qmltests/data/tst_settings.qml
index b286a1da..07ce77a0 100644
--- a/tests/auto/quick/qmltests/data/tst_settings.qml
+++ b/tests/auto/quick/qmltests/data/tst_settings.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_titleChanged.qml b/tests/auto/quick/qmltests/data/tst_titleChanged.qml
index 7dda5ce3..d73664b0 100644
--- a/tests/auto/quick/qmltests/data/tst_titleChanged.qml
+++ b/tests/auto/quick/qmltests/data/tst_titleChanged.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml b/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml
index 5e163fc6..c84d5da2 100644
--- a/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml
+++ b/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
Item {
id: parentItem
@@ -37,8 +37,12 @@ Item {
property var pressEvents: []
property var releaseEvents: []
- Keys.onPressed: pressEvents.push(event.key)
- Keys.onReleased: releaseEvents.push(event.key)
+ Keys.onPressed: function(event) {
+ pressEvents.push(event.key)
+ }
+ Keys.onReleased: function(event) {
+ releaseEvents.push(event.key)
+ }
TestWebEngineView {
id: webEngineView
diff --git a/tests/auto/quick/qmltests/data/tst_userScripts.qml b/tests/auto/quick/qmltests/data/tst_userScripts.qml
index 4d0bd28b..0f1042f8 100644
--- a/tests/auto/quick/qmltests/data/tst_userScripts.qml
+++ b/tests/auto/quick/qmltests/data/tst_userScripts.qml
@@ -26,9 +26,9 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
Item {
@@ -77,7 +77,7 @@ Item {
width: 400
height: 300
- onNavigationRequested: {
+ onNavigationRequested: function(request) {
var urlString = request.url.toString();
if (urlString.indexOf("test1.html") !== -1)
userScripts.collection = [ changeDocumentTitleScript() ];
diff --git a/tests/auto/quick/qmltests/data/tst_viewSource.qml b/tests/auto/quick/qmltests/data/tst_viewSource.qml
index 8097758f..d6377cda 100644
--- a/tests/auto/quick/qmltests/data/tst_viewSource.qml
+++ b/tests/auto/quick/qmltests/data/tst_viewSource.qml
@@ -46,7 +46,7 @@ TestWebEngineView {
SignalSpy {
id: newViewRequestedSpy
target: webEngineView
- signalName: "newViewRequested"
+ signalName: "newWindowRequested"
}
SignalSpy {
@@ -55,13 +55,13 @@ TestWebEngineView {
signalName: "titleChanged"
}
- onNewViewRequested: {
+ onNewWindowRequested: function(request) {
viewRequest = {
"destination": request.destination,
"userInitiated": request.userInitiated
};
- webEngineView.acceptAsNewView(request);
+ webEngineView.acceptAsNewWindow(request);
}
TestCase {
@@ -93,7 +93,7 @@ TestWebEngineView {
// The first titleChanged signal is emitted by adoptWebContents()
tryVerify(function() { return titleChangedSpy.count >= 2; });
- compare(viewRequest.destination, WebEngineNewViewRequest.InNewTab);
+ compare(viewRequest.destination, WebEngineNewWindowRequest.InNewTab);
verify(viewRequest.userInitiated);
verify(!webEngineView.action(WebEngineView.ViewSource).enabled);
@@ -122,7 +122,7 @@ TestWebEngineView {
// The first titleChanged signal is emitted by adoptWebContents()
tryVerify(function() { return titleChangedSpy.count >= 2; });
- compare(viewRequest.destination, WebEngineNewViewRequest.InNewTab);
+ compare(viewRequest.destination, WebEngineNewWindowRequest.InNewTab);
verify(viewRequest.userInitiated);
tryCompare(webEngineView, "url", "view-source:" + url.replace("user:passwd@", ""));
diff --git a/tests/auto/quick/qmltests/data/tst_webchannel.qml b/tests/auto/quick/qmltests/data/tst_webchannel.qml
index 3ca3ccce..70edc1bc 100644
--- a/tests/auto/quick/qmltests/data/tst_webchannel.qml
+++ b/tests/auto/quick/qmltests/data/tst_webchannel.qml
@@ -25,11 +25,11 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
+import QtQuick
+import QtTest
+import QtWebEngine
-import QtWebChannel 1.0
+import QtWebChannel
Item {
id: test
diff --git a/tests/auto/quick/qmltests/mock-delegates/TestParams/FilePickerParams.qml b/tests/auto/quick/qmltests/mock-delegates/TestParams/FilePickerParams.qml
index 02b0da1d..48f94df6 100644
--- a/tests/auto/quick/qmltests/mock-delegates/TestParams/FilePickerParams.qml
+++ b/tests/auto/quick/qmltests/mock-delegates/TestParams/FilePickerParams.qml
@@ -27,7 +27,7 @@
****************************************************************************/
pragma Singleton
-import QtQuick 2.0
+import QtQuick
QtObject {
property var selectedFilesUrl: [];
diff --git a/tests/auto/quick/qmltests/mock-delegates/TestParams/JSDialogParams.qml b/tests/auto/quick/qmltests/mock-delegates/TestParams/JSDialogParams.qml
index 70696803..b24214a2 100644
--- a/tests/auto/quick/qmltests/mock-delegates/TestParams/JSDialogParams.qml
+++ b/tests/auto/quick/qmltests/mock-delegates/TestParams/JSDialogParams.qml
@@ -26,7 +26,7 @@
**
****************************************************************************/
pragma Singleton
-import QtQml 2.0
+import QtQml
QtObject {
property string dialogMessage: "";
diff --git a/tests/auto/quick/qmltests/qmltests.pro b/tests/auto/quick/qmltests/qmltests.pro
deleted file mode 100644
index e5d4b26a..00000000
--- a/tests/auto/quick/qmltests/qmltests.pro
+++ /dev/null
@@ -1,134 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/webenginequick/qtwebenginequick-config.pri) # workaround for QTBUG-68093
-QT_FOR_CONFIG += webenginequick-private
-
-include(../tests.pri)
-
-QT += qmltest
-DEFINES += QUICK_TEST_SOURCE_DIR=\\\"$$re_escape($$OUT_PWD$${QMAKE_DIR_SEP}webengine.qmltests)\\\"
-IMPORTPATH += $$PWD/data
-
-QML_TESTS = \
- $$PWD/data/tst_action.qml \
- $$PWD/data/tst_activeFocusOnPress.qml \
- $$PWD/data/tst_audioMuted.qml \
- $$PWD/data/tst_contextMenu.qml \
- $$PWD/data/tst_desktopBehaviorLoadHtml.qml \
- $$PWD/data/tst_download.qml \
- $$PWD/data/tst_favicon.qml \
- $$PWD/data/tst_faviconDatabase.qml \
- $$PWD/data/tst_findText.qml \
- $$PWD/data/tst_focusOnNavigation.qml \
- $$PWD/data/tst_fullScreenRequest.qml \
- $$PWD/data/tst_geopermission.qml \
- $$PWD/data/tst_getUserMedia.qml \
- $$PWD/data/tst_inputMethod.qml \
- $$PWD/data/tst_javaScriptDialogs.qml
- $$PWD/data/tst_keyboardEvents.qml \
- $$PWD/data/tst_keyboardModifierMapping.qml \
- $$PWD/data/tst_linkHovered.qml \
- $$PWD/data/tst_loadFail.qml \
- $$PWD/data/tst_loadHtml.qml \
- $$PWD/data/tst_loadProgress.qml \
- $$PWD/data/tst_loadRecursionCrash.qml \
- $$PWD/data/tst_loadUrl.qml \
- $$PWD/data/tst_mouseClick.qml \
- $$PWD/data/tst_mouseMove.qml \
- $$PWD/data/tst_navigationHistory.qml \
- $$PWD/data/tst_navigationRequested.qml \
- $$PWD/data/tst_newViewRequest.qml \
- $$PWD/data/tst_notification.qml \
- $$PWD/data/tst_profile.qml \
- $$PWD/data/tst_properties.qml \
- $$PWD/data/tst_runJavaScript.qml \
- $$PWD/data/tst_scrollPosition.qml \
- $$PWD/data/tst_settings.qml \
- $$PWD/data/tst_titleChanged.qml \
- $$PWD/data/tst_unhandledKeyEventPropagation.qml \
- $$PWD/data/tst_userScripts.qml \
- $$PWD/data/tst_viewSource.qml
-
-qtConfig(webengine-webchannel) {
- QML_TESTS += $$PWD/data/tst_webchannel.qml
-}
-
-qtConfig(ssl) {
- include(../../shared/https.pri)
- QML_TESTS += $$PWD/data/tst_certificateError.qml
-} else {
- include(../../shared/http.pri)
-}
-
-qtHaveModule(quickcontrols) {
- QML_TESTS += \
- $$PWD/data/tst_filePicker.qml
-}
-
-OTHER_FILES += \
- $$PWD/data/TestWebEngineView.qml \
- $$PWD/data/accepttypes.html \
- $$PWD/data/alert.html \
- $$PWD/data/confirm.html \
- $$PWD/data/confirmclose.html \
- $$PWD/data/append-document-title.js \
- $$PWD/data/big-user-script.js \
- $$PWD/data/change-document-title.js \
- $$PWD/data/download.zip \
- $$PWD/data/directoryupload.html \
- $$PWD/data/favicon.html \
- $$PWD/data/favicon2.html \
- $$PWD/data/favicon-candidates-gray.html \
- $$PWD/data/favicon-misc.html \
- $$PWD/data/favicon-multi.html \
- $$PWD/data/favicon-multi-gray.html \
- $$PWD/data/favicon-single.html \
- $$PWD/data/favicon-shortcut.html \
- $$PWD/data/favicon-touch.html \
- $$PWD/data/favicon-unavailable.html \
- $$PWD/data/forms.html \
- $$PWD/data/geolocation.html \
- $$PWD/data/javascript.html \
- $$PWD/data/link.html \
- $$PWD/data/localStorage.html \
- $$PWD/data/multifileupload.html \
- $$PWD/data/redirect.html \
- $$PWD/data/script-with-metadata.js \
- $$PWD/data/singlefileupload.html \
- $$PWD/data/test1.html \
- $$PWD/data/test2.html \
- $$PWD/data/test3.html \
- $$PWD/data/test4.html \
- $$PWD/data/test-iframe.html \
- $$PWD/data/keyboardModifierMapping.html \
- $$PWD/data/keyboardEvents.html \
- $$PWD/data/titleupdate.js \
- $$PWD/data/icons/favicon.png \
- $$PWD/data/icons/gray128.png \
- $$PWD/data/icons/gray16.png \
- $$PWD/data/icons/gray255.png \
- $$PWD/data/icons/gray32.png \
- $$PWD/data/icons/gray64.png \
- $$PWD/data/icons/grayicons.ico \
- $$PWD/data/icons/qt144.png \
- $$PWD/data/icons/qt32.ico \
- $$PWD/data/icons/qtmulti.ico \
- $$PWD/data/icons/small-favicon.png \
- $$PWD/mock-delegates/TestParams/FilePickerParams.qml \
- $$PWD/mock-delegates/TestParams/JSDialogParams.qml \
- $$PWD/mock-delegates/TestParams/qmldir \
- $$PWD/mock-delegates/QtWebEngine/ControlsDelegates/AlertDialog.qml \
- $$PWD/mock-delegates/QtWebEngine/ControlsDelegates/ConfirmDialog.qml \
- $$PWD/mock-delegates/QtWebEngine/ControlsDelegates/FilePicker.qml \
- $$PWD/mock-delegates/QtWebEngine/ControlsDelegates/Menu.qml \
- $$PWD/mock-delegates/QtWebEngine/ControlsDelegates/MenuItem.qml \
- $$PWD/mock-delegates/QtWebEngine/ControlsDelegates/PromptDialog.qml
-
-OTHER_FILES += $$QML_TESTS
-
-!build_pass:!isEmpty(QML_TESTS) {
- for (file, QML_TESTS): QML_TESTS_CONTENT += "$${file}"
- TEST_FILE = $$OUT_PWD/webengine.qmltests
- write_file($$TEST_FILE, QML_TESTS_CONTENT)
-}
-
-load(qt_build_paths)
-
diff --git a/tests/auto/quick/qmltests/tst_qmltests.cpp b/tests/auto/quick/qmltests/tst_qmltests.cpp
index 78c16710..00c6478e 100644
--- a/tests/auto/quick/qmltests/tst_qmltests.cpp
+++ b/tests/auto/quick/qmltests/tst_qmltests.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
@@ -236,7 +236,7 @@ private:
QSpontaneKeyEvent::setSpontaneous(&me);
if (!qApp->notify(window, &me))
- QTest::qWarn("Mouse click event not accepted by receiving window");
+ qWarning("Mouse click event not accepted by receiving window");
}
};
diff --git a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro
deleted file mode 100644
index 09297303..00000000
--- a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-include(../tests.pri)
-
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
-QT_PRIVATE += core-private webenginequick-private webenginecore-private
-
-HEADERS += ../shared/util.h
diff --git a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp
index d7515702..7b993d00 100644
--- a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp
+++ b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp
@@ -63,8 +63,8 @@ void tst_QQuickWebEngineDefaultSurfaceFormat::initEngineAndViewComponent() {
m_engine = new QQmlEngine(this);
QQuickWebEngineProfile::defaultProfile()->setOffTheRecord(true);
m_component.reset(new QQmlComponent(m_engine, this));
- m_component->setData(QByteArrayLiteral("import QtQuick 2.0\n"
- "import QtWebEngine 1.2\n"
+ m_component->setData(QByteArrayLiteral("import QtQuick\n"
+ "import QtWebEngine\n"
"WebEngineView {}")
, QUrl());
}
diff --git a/tests/auto/quick/qquickwebengineview/CMakeLists.txt b/tests/auto/quick/qquickwebengineview/CMakeLists.txt
index 90cbb7a3..b0488048 100644
--- a/tests/auto/quick/qquickwebengineview/CMakeLists.txt
+++ b/tests/auto/quick/qquickwebengineview/CMakeLists.txt
@@ -5,7 +5,6 @@ qt_internal_add_test(tst_qquickwebengineview
tst_qquickwebengineview.cpp
LIBRARIES
Qt::WebEngineCorePrivate
- Qt::WebEngineWidgets
Qt::WebEngineQuick
Qt::GuiPrivate
Qt::WebEngineQuickPrivate
diff --git a/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro b/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro
deleted file mode 100644
index ba373710..00000000
--- a/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-include(../tests.pri)
-
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
-QT_PRIVATE += core_private gui-private webenginequick-private webenginecore-private
-
-HEADERS += ../shared/util.h
diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
index ac339741..347f370f 100644
--- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
+++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
@@ -38,10 +38,10 @@
#include <QtQml/QQmlEngine>
#include <QtTest/QtTest>
#include <QtWebEngineQuick/QQuickWebEngineProfile>
-#include <QtWebEngineQuick/QQuickWebEngineScriptCollection>
#include <QtGui/private/qinputmethod_p.h>
-#include <QtWebEngineQuick/private/qquickwebengineview_p.h>
+#include <QtWebEngineQuick/private/qquickwebenginescriptcollection_p.h>
#include <QtWebEngineQuick/private/qquickwebenginesettings_p.h>
+#include <QtWebEngineQuick/private/qquickwebengineview_p.h>
#include <QtWebEngineCore/private/qtwebenginecore-config_p.h>
#include <qpa/qplatforminputcontext.h>
#include <QtTest/private/qemulationdetector_p.h>
@@ -118,8 +118,8 @@ tst_QQuickWebEngineView::tst_QQuickWebEngineView()
static QQmlEngine *engine = new QQmlEngine(this);
m_component.reset(new QQmlComponent(engine, this));
- m_component->setData(QByteArrayLiteral("import QtQuick 2.0\n"
- "import QtWebEngine 1.2\n"
+ m_component->setData(QByteArrayLiteral("import QtQuick\n"
+ "import QtWebEngine\n"
"WebEngineView {}")
, QUrl());
}
diff --git a/tests/auto/quick/qquickwebengineviewgraphics/CMakeLists.txt b/tests/auto/quick/qquickwebengineviewgraphics/CMakeLists.txt
index c7e6bc92..6bc0bc86 100644
--- a/tests/auto/quick/qquickwebengineviewgraphics/CMakeLists.txt
+++ b/tests/auto/quick/qquickwebengineviewgraphics/CMakeLists.txt
@@ -4,7 +4,6 @@ qt_internal_add_test(tst_qquickwebengineviewgraphics
tst_qquickwebengineviewgraphics.cpp
LIBRARIES
Qt::CorePrivate
- Qt::WebEngineWidgets
Qt::WebEngineQuickPrivate
Qt::Test
Test::Util
diff --git a/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro b/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro
deleted file mode 100644
index be6296f5..00000000
--- a/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-include(../tests.pri)
-CONFIG -= testcase # remove, once this passes in the CI
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
-QT_PRIVATE += webenginequick-private gui-private webenginecore-private
diff --git a/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp b/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp
index 855b0165..cfd05815 100644
--- a/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp
+++ b/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp
@@ -147,7 +147,7 @@ void tst_QQuickWebEngineViewGraphics::reparentToOtherWindow()
void tst_QQuickWebEngineViewGraphics::setHtml(const QString &html)
{
QString htmlData = QUrl::toPercentEncoding(html);
- QString qmlData = QUrl::toPercentEncoding(QStringLiteral("import QtQuick 2.0; import QtWebEngine 1.2; WebEngineView { width: 150; height: 150 }"));
+ QString qmlData = QUrl::toPercentEncoding(QStringLiteral("import QtQuick; import QtWebEngine; WebEngineView { width: 150; height: 150 }"));
m_view->setSource(QUrl(QStringLiteral("data:text/plain,%1").arg(qmlData)));
m_view->create();
diff --git a/tests/auto/quick/qtbug-70248/qtbug-70248.pro b/tests/auto/quick/qtbug-70248/qtbug-70248.pro
deleted file mode 100644
index 7223dcfa..00000000
--- a/tests/auto/quick/qtbug-70248/qtbug-70248.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-include(../tests.pri)
-QT += webenginequick webenginequick-private
-
-RESOURCES += \
- test.qrc
diff --git a/tests/auto/quick/qtbug-70248/test.qml b/tests/auto/quick/qtbug-70248/test.qml
index 35962aff..5870f593 100644
--- a/tests/auto/quick/qtbug-70248/test.qml
+++ b/tests/auto/quick/qtbug-70248/test.qml
@@ -1,6 +1,6 @@
-import QtQuick 2.9
-import QtQuick.Window 2.2
-import QtWebEngine 1.3
+import QtQuick
+import QtQuick.Window
+import QtWebEngine
Window {
visible: true
diff --git a/tests/auto/quick/qtbug-70248/test.qrc b/tests/auto/quick/qtbug-70248/test.qrc
deleted file mode 100644
index 83fea5eb..00000000
--- a/tests/auto/quick/qtbug-70248/test.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>test.qml</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro
deleted file mode 100644
index 13e4d78c..00000000
--- a/tests/auto/quick/quick.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/webenginequick/qtwebenginequick-config.pri) # workaround for QTBUG-68093
-QT_FOR_CONFIG += webenginequick-private
-
-TEMPLATE = subdirs
-
-SUBDIRS += \
- dialogs \
- inspectorserver \
- qmltests \
- publicapi \
- qquickwebenginedefaultsurfaceformat \
- qquickwebengineviewgraphics \
- qquickwebengineview \
- qtbug-70248
-
-boot2qt: SUBDIRS -= inspectorserver qquickwebengineview qmltests
diff --git a/tests/auto/quick/tests.pri b/tests/auto/quick/tests.pri
deleted file mode 100644
index 8cf4c0af..00000000
--- a/tests/auto/quick/tests.pri
+++ /dev/null
@@ -1,20 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/webenginequick/qtwebenginequick-config.pri) # workaround for QTBUG-68093
-QT_FOR_CONFIG += webenginequick-private
-
-TEMPLATE = app
-
-CONFIG += testcase
-
-VPATH += $$_PRO_FILE_PWD_
-TARGET = tst_$$TARGET
-
-SOURCES += $${TARGET}.cpp
-INCLUDEPATH += \
- $$PWD \
- ../shared
-
-QT += testlib network quick webenginequick
-
-# This define is used by some tests to look up resources in the source tree
-DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD/\\\"
-include(../embed_info_plist.pri)
diff --git a/tests/auto/quick/uidelegates/tst_uidelegates.cpp b/tests/auto/quick/uidelegates/tst_uidelegates.cpp
index 95f083f1..4c2fa3b3 100644
--- a/tests/auto/quick/uidelegates/tst_uidelegates.cpp
+++ b/tests/auto/quick/uidelegates/tst_uidelegates.cpp
@@ -143,7 +143,6 @@ void tst_UIDelegates::javaScriptDialog()
void tst_UIDelegates::fileDialog()
{
- QSKIP("There is no FilePicker Control in Quick Controls 2.");
m_window->show();
QTRY_VERIFY(qApp->focusObject());
QQuickWebEngineView *view = webEngineView();
@@ -152,11 +151,10 @@ void tst_UIDelegates::fileDialog()
"<input type='file' id='filePicker'/>"
"</body></html>");
QVERIFY(waitForLoadSucceeded(view));
- QString filePickerStr = QStringLiteral("filePicker");
- QPoint filePickerCenter = elementCenter(view, filePickerStr);
+ QPoint filePickerCenter = elementCenter(view, QStringLiteral("filePicker"));
QTest::mouseClick(view->window(), Qt::LeftButton, {}, filePickerCenter);
- QTRY_VERIFY(view->findChild<QObject *>(filePickerStr));
+ QTRY_VERIFY(view->findChild<QObject *>(QStringLiteral("fileDialog")));
}
void tst_UIDelegates::contextMenu()
@@ -198,7 +196,6 @@ void tst_UIDelegates::tooltip()
void tst_UIDelegates::colorDialog()
{
- QSKIP("There is no ColorPicker Control in Quick Controls 2.");
m_window->show();
QTRY_VERIFY(qApp->focusObject());
QQuickWebEngineView *view = webEngineView();