From 18595c7fec423d165a80a8e5d300883a8160eec4 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Fri, 28 Apr 2017 08:33:54 +0200 Subject: Stabilize keyboardEvents auto tests The typeAheadTimeout is set to 1sec in Blink. Wait a bit more when selecting the next option in a HTML select element in auto tests. Change-Id: Ia3d9fde05b4d6cde9186aaa701ca48354ca74b4d Reviewed-by: Allan Sandfeld Jensen --- tests/auto/quick/qmltests/data/tst_keyboardEvents.qml | 2 +- tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml b/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml index 677727632..2536f319b 100644 --- a/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml +++ b/tests/auto/quick/qmltests/data/tst_keyboardEvents.qml @@ -143,7 +143,7 @@ TestWebEngineView { keyPress(Qt.Key_B); compareElementValue("combobox", "b"); // Must wait with the second key press to simulate selection of another element - wait(1000); + wait(1100); // blink::typeAheadTimeout + 0.1s keyPress(Qt.Key_C); compareElementValue("combobox", "c"); diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp index ce88ace16..32a518ad8 100644 --- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp +++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp @@ -1109,7 +1109,7 @@ void tst_QWebEngineView::keyboardEvents() QTest::keyPress(view.focusProxy(), Qt::Key_B); QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('combobox').value").toString(), QStringLiteral("b")); // Must wait with the second key press to simulate selection of another element - QTest::keyPress(view.focusProxy(), Qt::Key_C, Qt::NoModifier, 1000); + QTest::keyPress(view.focusProxy(), Qt::Key_C, Qt::NoModifier, 1100 /* blink::typeAheadTimeout + 0.1s */); QTRY_COMPARE(evaluateJavaScriptSync(view.page(), "document.getElementById('combobox').value").toString(), QStringLiteral("c")); // Test the Enter key by loading a page with a hyperlink -- cgit v1.2.3 From d1997972350c67b8e6dad46824424466aca79d37 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Wed, 26 Apr 2017 13:37:12 +0200 Subject: Fix typo in tst_newViewRequest.qml Change-Id: I3e22f09b0847cb7c5edc50ad12c73b62c4525072 Reviewed-by: Viktor Engelmann Reviewed-by: Valentin Fokin Reviewed-by: Allan Sandfeld Jensen --- tests/auto/quick/qmltests/data/tst_newViewRequest.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/auto/quick/qmltests/data/tst_newViewRequest.qml b/tests/auto/quick/qmltests/data/tst_newViewRequest.qml index 754a9e018..7a04d5f5b 100644 --- a/tests/auto/quick/qmltests/data/tst_newViewRequest.qml +++ b/tests/auto/quick/qmltests/data/tst_newViewRequest.qml @@ -93,7 +93,7 @@ TestWebEngineView { compare(newViewRequest.destination, WebEngineView.NewViewInTab); verify(!newViewRequest.userInitiated); - verify(dialog.webEngineView.waitForLoadSucceeded); + verify(dialog.webEngineView.waitForLoadSucceeded()); compare(dialog.webEngineView.url, ""); newViewRequestedSpy.clear(); dialog.destroy(); @@ -109,7 +109,7 @@ TestWebEngineView { compare(newViewRequest.destination, WebEngineView.NewViewInDialog); verify(!newViewRequest.userInitiated); - verify(dialog.webEngineView.waitForLoadSucceeded); + verify(dialog.webEngineView.waitForLoadSucceeded()); newViewRequestedSpy.clear(); dialog.destroy(); @@ -128,7 +128,7 @@ TestWebEngineView { compare(newViewRequest.destination, WebEngineView.NewViewInDialog); verify(newViewRequest.userInitiated); - verify(dialog.webEngineView.waitForLoadSucceeded); + verify(dialog.webEngineView.waitForLoadSucceeded()); newViewRequestedSpy.clear(); dialog.destroy(); } -- cgit v1.2.3