diff options
| -rw-r--r-- | src/core/api/Qt6WebEngineCoreMacros.cmake | 7 | ||||
| -rw-r--r-- | tests/auto/quick/qmltests/data/tst_datalist.qml | 10 | ||||
| -rw-r--r-- | tests/auto/widgets/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp | 9 |
4 files changed, 29 insertions, 1 deletions
diff --git a/src/core/api/Qt6WebEngineCoreMacros.cmake b/src/core/api/Qt6WebEngineCoreMacros.cmake index 8bb731548..ed58aa8e7 100644 --- a/src/core/api/Qt6WebEngineCoreMacros.cmake +++ b/src/core/api/Qt6WebEngineCoreMacros.cmake @@ -14,6 +14,13 @@ function(qt6_add_webengine_dictionary) cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + if(NOT TARGET ${QT_CMAKE_EXPORT_NAMESPACE}::qwebengine_convert_dict) + message(WARNING + "qwebengine_convert_dict is not available. Skipping qt6_add_webengine_dictionary." + ) + return() + endif() + if (NOT ARGS_SOURCE OR NOT EXISTS "${ARGS_SOURCE}" OR NOT IS_ABSOLUTE "${ARGS_SOURCE}") message(FATAL_ERROR "Function qt_add_webengine_dictionary requires an absolute path to SOURCE dictionary.") endif() diff --git a/tests/auto/quick/qmltests/data/tst_datalist.qml b/tests/auto/quick/qmltests/data/tst_datalist.qml index 9e4d766ef..94b0dc8d5 100644 --- a/tests/auto/quick/qmltests/data/tst_datalist.qml +++ b/tests/auto/quick/qmltests/data/tst_datalist.qml @@ -65,6 +65,12 @@ TestWebEngineView { name: "WebEngineDatalist" when: windowShown + // The 100 ms autofill throttle in AutofillAgent::ShouldThrottleAskForValuesToFill() requires + // a delay between AutofillAgent::ShowSuggestions() triggering events. + function skipAutofillThrottle() { + wait(100); + } + function test_showAndHide() { webEngineView.loadHtml(webEngineView.html); verify(webEngineView.waitForLoadSucceeded()); @@ -106,6 +112,7 @@ TestWebEngineView { tryVerify(function() { return listView() == null; }); // The first Key Down opens the popup. + skipAutofillThrottle(); keyClick(Qt.Key_Down); tryVerify(function() { return listView() != null; }); @@ -167,16 +174,19 @@ TestWebEngineView { verify(!listView()); // Filter suggestions. + skipAutofillThrottle(); keyClick(Qt.Key_F); tryVerify(function() { return listView() != null; }); compare(listView().count, 2); verify(!listView().currentItem); compare(listView().itemAtIndex(0).text, "Firefox"); compare(listView().itemAtIndex(1).text, "Safari"); + skipAutofillThrottle(); keyClick(Qt.Key_I); tryVerify(function() { return listView().count == 1; }); verify(!listView().currentItem); compare(listView().itemAtIndex(0).text, "Firefox"); + skipAutofillThrottle(); keyClick(Qt.Key_L); // Mismatch should close popup. tryVerify(function() { return listView() == null; }); diff --git a/tests/auto/widgets/CMakeLists.txt b/tests/auto/widgets/CMakeLists.txt index 2195dd5e6..f6a50cc03 100644 --- a/tests/auto/widgets/CMakeLists.txt +++ b/tests/auto/widgets/CMakeLists.txt @@ -29,7 +29,9 @@ endif() if(QT_FEATURE_webengine_printing_and_pdf) add_subdirectory(printing) endif() -if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING AND NOT QT_FEATURE_webengine_native_spellchecker) +if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING + AND NOT QT_FEATURE_webengine_native_spellchecker + AND TARGET ${QT_CMAKE_EXPORT_NAMESPACE}::qwebengine_convert_dict) add_subdirectory(spellchecking) endif() if(QT_FEATURE_webengine_extensions) diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp index bf92dbe4e..3e618f6ec 100644 --- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp +++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp @@ -68,6 +68,10 @@ do { \ QCOMPARE((__expr), __expected); \ } while (0) +// The 100 ms autofill throttle in AutofillAgent::ShouldThrottleAskForValuesToFill() requires +// a delay between AutofillAgent::ShowSuggestions() triggering events. +#define SKIP_AUTOFILL_THROTTLE() QTest::qWait(100); + QT_BEGIN_NAMESPACE namespace QTest { int Q_TESTLIB_EXPORT defaultMouseDelay(); @@ -4013,6 +4017,7 @@ void tst_QWebEngineView::datalist() QTRY_VERIFY(!listView()); // The first Key Down opens the popup. + SKIP_AUTOFILL_THROTTLE() QTest::keyClick(view.windowHandle(), Qt::Key_Down); QTRY_VERIFY(listView()); @@ -4039,6 +4044,7 @@ void tst_QWebEngineView::datalist() ->data(listView()->currentIndex()) .toString(), QStringLiteral("Chrome")); + SKIP_AUTOFILL_THROTTLE() QTest::keyClick(view.windowHandle(), Qt::Key_Enter); QTRY_COMPARE( evaluateJavaScriptSync(view.page(), "document.getElementById('browserInput').value") @@ -4052,6 +4058,7 @@ void tst_QWebEngineView::datalist() QVERIFY(!listView()); // Filter suggestions. + SKIP_AUTOFILL_THROTTLE() QTest::keyClick(view.windowHandle(), Qt::Key_F); QTRY_VERIFY(listView()); QCOMPARE(listView()->model()->rowCount(), 2); @@ -4064,6 +4071,7 @@ void tst_QWebEngineView::datalist() ->data(listView()->model()->index(1, 0)) .toString(), QStringLiteral("Safari")); + SKIP_AUTOFILL_THROTTLE() QTest::keyClick(view.windowHandle(), Qt::Key_I); QTRY_COMPARE(listView()->model()->rowCount(), 1); QCOMPARE(listView()->currentIndex(), QModelIndex()); @@ -4071,6 +4079,7 @@ void tst_QWebEngineView::datalist() ->data(listView()->model()->index(0, 0)) .toString(), QStringLiteral("Firefox")); + SKIP_AUTOFILL_THROTTLE() QTest::keyClick(view.windowHandle(), Qt::Key_L); // Mismatch should close popup. QTRY_VERIFY(!listView()); |
