diff options
Diffstat (limited to 'tests/auto/quick')
16 files changed, 53 insertions, 8 deletions
diff --git a/tests/auto/quick/CMakeLists.txt b/tests/auto/quick/CMakeLists.txt index 48a83e7de..d2cf7c3b3 100644 --- a/tests/auto/quick/CMakeLists.txt +++ b/tests/auto/quick/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + add_subdirectory(dialogs) add_subdirectory(publicapi) add_subdirectory(qquickwebenginedefaultsurfaceformat) diff --git a/tests/auto/quick/dialogs/CMakeLists.txt b/tests/auto/quick/dialogs/CMakeLists.txt index b7f088f0d..4d8dc853b 100644 --- a/tests/auto/quick/dialogs/CMakeLists.txt +++ b/tests/auto/quick/dialogs/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + include(../../httpserver/httpserver.cmake) include(../../util/util.cmake) diff --git a/tests/auto/quick/inspectorserver/BLACKLIST b/tests/auto/quick/inspectorserver/BLACKLIST index 318dae7a5..076dd5f10 100644 --- a/tests/auto/quick/inspectorserver/BLACKLIST +++ b/tests/auto/quick/inspectorserver/BLACKLIST @@ -1,2 +1,2 @@ [openRemoteDebuggingSession] -* +macos diff --git a/tests/auto/quick/inspectorserver/CMakeLists.txt b/tests/auto/quick/inspectorserver/CMakeLists.txt index e2c3bb2ab..d890581b8 100644 --- a/tests/auto/quick/inspectorserver/CMakeLists.txt +++ b/tests/auto/quick/inspectorserver/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + qt_internal_add_test(tst_inspectorserver SOURCES tst_inspectorserver.cpp diff --git a/tests/auto/quick/publicapi/CMakeLists.txt b/tests/auto/quick/publicapi/CMakeLists.txt index 4fa18e0b3..e345a076a 100644 --- a/tests/auto/quick/publicapi/CMakeLists.txt +++ b/tests/auto/quick/publicapi/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + qt_internal_add_test(tst_publicapi SOURCES tst_publicapi.cpp diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp index 371969b2a..0cd031940 100644 --- a/tests/auto/quick/publicapi/tst_publicapi.cpp +++ b/tests/auto/quick/publicapi/tst_publicapi.cpp @@ -363,6 +363,8 @@ static const QStringList expectedAPI = QStringList() << "QQuickWebEngineProfile.persistentCookiesPolicyChanged() --> void" << "QQuickWebEngineProfile.persistentStoragePath --> QString" << "QQuickWebEngineProfile.persistentStoragePathChanged() --> void" + << "QQuickWebEngineProfile.isPushServiceEnabled --> bool" + << "QQuickWebEngineProfile.pushServiceEnabledChanged() --> void" << "QQuickWebEngineProfile.spellCheckEnabled --> bool" << "QQuickWebEngineProfile.spellCheckEnabledChanged() --> void" << "QQuickWebEngineProfile.spellCheckLanguages --> QStringList" diff --git a/tests/auto/quick/qmltests/CMakeLists.txt b/tests/auto/quick/qmltests/CMakeLists.txt index c7ebe8b11..542e44706 100644 --- a/tests/auto/quick/qmltests/CMakeLists.txt +++ b/tests/auto/quick/qmltests/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + include(../../httpserver/httpserver.cmake) include(../../util/util.cmake) diff --git a/tests/auto/quick/qmltests/data/tst_faviconDatabase.qml b/tests/auto/quick/qmltests/data/tst_faviconDatabase.qml index 774708af0..284390619 100644 --- a/tests/auto/quick/qmltests/data/tst_faviconDatabase.qml +++ b/tests/auto/quick/qmltests/data/tst_faviconDatabase.qml @@ -85,6 +85,9 @@ TestWebEngineView { function test_iconDatabase(row) { + if (Screen.devicePixelRatio !== 1.0) + skip("This test is not supported on High DPI screens."); + webEngineView.profile = row.profile; compare(iconChangedSpy.count, 0); @@ -129,6 +132,9 @@ TestWebEngineView { function test_iconDatabaseMultiView() { + if (Screen.devicePixelRatio !== 1.0) + skip("This test is not supported on High DPI screens."); + var pixel; var faviconImage = Qt.createQmlObject(" diff --git a/tests/auto/quick/qmltests/data/tst_newViewRequest.qml b/tests/auto/quick/qmltests/data/tst_newViewRequest.qml index a47862565..6d4bdbb41 100644 --- a/tests/auto/quick/qmltests/data/tst_newViewRequest.qml +++ b/tests/auto/quick/qmltests/data/tst_newViewRequest.qml @@ -98,7 +98,7 @@ TestWebEngineView { if (viewType === "dialog") { tryVerify(dialog.webEngineView.loadSucceeded) - compare(dialog.webEngineView.url, ""); + compare(dialog.webEngineView.url, Qt.url("about:blank")); dialog.destroy(); } // https://chromium-review.googlesource.com/c/chromium/src/+/1300395 diff --git a/tests/auto/quick/qmltests/data/tst_scrollPosition.qml b/tests/auto/quick/qmltests/data/tst_scrollPosition.qml index e9c72ab7d..cc7d15e4c 100644 --- a/tests/auto/quick/qmltests/data/tst_scrollPosition.qml +++ b/tests/auto/quick/qmltests/data/tst_scrollPosition.qml @@ -2,7 +2,6 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import QtQuick -import QtQuick.Window import QtTest import QtWebEngine @@ -36,7 +35,7 @@ TestWebEngineView { tryCompare(scrollPositionSpy, "count", 1); compare(webEngineView.scrollPosition.x, 0); - compare(webEngineView.scrollPosition.y, 600 * Screen.devicePixelRatio); + compare(webEngineView.scrollPosition.y, 600); } function test_scrollPositionAfterReload() { @@ -49,13 +48,13 @@ TestWebEngineView { // Wait for proper scroll position change otherwise we cannot expect // the new y position after reload. tryCompare(webEngineView.scrollPosition, "x", 0); - tryCompare(webEngineView.scrollPosition, "y", 600 * Screen.devicePixelRatio); + tryCompare(webEngineView.scrollPosition, "y", 600); webEngineView.reload(); verify(webEngineView.waitForLoadSucceeded()); tryCompare(webEngineView.scrollPosition, "x", 0); - tryCompare(webEngineView.scrollPosition, "y", 600 * Screen.devicePixelRatio); + tryCompare(webEngineView.scrollPosition, "y", 600); } } } diff --git a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/CMakeLists.txt b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/CMakeLists.txt index 07b184b89..9856ed513 100644 --- a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/CMakeLists.txt +++ b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + include(../../util/util.cmake) qt_internal_add_test(tst_qquickwebenginedefaultsurfaceformat diff --git a/tests/auto/quick/qquickwebengineview/CMakeLists.txt b/tests/auto/quick/qquickwebengineview/CMakeLists.txt index b0488048f..307ea36c9 100644 --- a/tests/auto/quick/qquickwebengineview/CMakeLists.txt +++ b/tests/auto/quick/qquickwebengineview/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + include(../../util/util.cmake) qt_internal_add_test(tst_qquickwebengineview diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp index fe9f42053..5ae032061 100644 --- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp +++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp @@ -69,8 +69,10 @@ private Q_SLOTS: void javascriptClipboard_data(); void javascriptClipboard(); void setProfile(); - void focusChild(); +#if QT_CONFIG(accessibility) void focusChild_data(); + void focusChild(); +#endif void htmlSelectPopup(); private: @@ -1117,7 +1119,7 @@ void tst_QQuickWebEngineView::javascriptClipboard() // - return value of queryCommandEnabled and // - return value of execCommand // - comparing the clipboard / input field - QGuiApplication::clipboard()->clear(); + QGuiApplication::clipboard()->setText(QString()); QCOMPARE(evaluateJavaScriptSync(view, "document.queryCommandEnabled('copy')").toBool(), copyResult); QCOMPARE(evaluateJavaScriptSync(view, "document.execCommand('copy')").toBool(), copyResult); @@ -1180,6 +1182,7 @@ void tst_QQuickWebEngineView::setProfile() { QTRY_COMPARE(webEngineView()->url() ,urlFromTestPath("html/basic_page2.html")); } +#if QT_CONFIG(accessibility) void tst_QQuickWebEngineView::focusChild_data() { QTest::addColumn<QString>("interfaceName"); @@ -1242,6 +1245,7 @@ void tst_QQuickWebEngineView::focusChild() // <html> -> <body> -> <input> QCOMPARE(traverseToWebDocumentAccessibleInterface(iface)->child(0)->child(0), iface->focusChild()); } +#endif // QT_CONFIG(accessibility) void tst_QQuickWebEngineView::htmlSelectPopup() { @@ -1270,8 +1274,12 @@ void tst_QQuickWebEngineView::htmlSelectPopup() QCOMPARE(evaluateJavaScriptSync(&view, "document.getElementById('select').value").toString(), QStringLiteral("O2")); } +#if QT_CONFIG(accessibility) static QByteArrayList params = QByteArrayList() << "--force-renderer-accessibility"; +#else +static QByteArrayList params; +#endif W_QTEST_MAIN(tst_QQuickWebEngineView, params) #include "tst_qquickwebengineview.moc" diff --git a/tests/auto/quick/qquickwebengineviewgraphics/CMakeLists.txt b/tests/auto/quick/qquickwebengineviewgraphics/CMakeLists.txt index 6bc0bc866..f22408d15 100644 --- a/tests/auto/quick/qquickwebengineviewgraphics/CMakeLists.txt +++ b/tests/auto/quick/qquickwebengineviewgraphics/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + include(../../util/util.cmake) qt_internal_add_test(tst_qquickwebengineviewgraphics SOURCES diff --git a/tests/auto/quick/qtbug-70248/CMakeLists.txt b/tests/auto/quick/qtbug-70248/CMakeLists.txt index b1df50211..b177c5309 100644 --- a/tests/auto/quick/qtbug-70248/CMakeLists.txt +++ b/tests/auto/quick/qtbug-70248/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + qt_internal_add_test(tst_qtbug-70248 SOURCES tst_qtbug-70248.cpp diff --git a/tests/auto/quick/uidelegates/CMakeLists.txt b/tests/auto/quick/uidelegates/CMakeLists.txt index d8699ccfc..bdf041e04 100644 --- a/tests/auto/quick/uidelegates/CMakeLists.txt +++ b/tests/auto/quick/uidelegates/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + include(../../httpserver/httpserver.cmake) include(../../util/util.cmake) |
