summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/quick/qmltests/data/tst_datalist.qml10
-rw-r--r--tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp9
2 files changed, 19 insertions, 0 deletions
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/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());