From 804ceab7882f1a5968271ae6b3ac31ffaff07b61 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 6 Oct 2016 15:44:43 +0200
Subject: [PATCH] Speculative fix of tst_unhandledKeyEventPropagation.qml quick
 auto test

This fix implements an attempt to remove wait from the test.

Task-number: QTBUG-56180
Change-Id: I2bfeb14ebc9451a1237178aa3c97bd1b27e9485c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 tests/auto/quick/qmltests/BLACKLIST                       | 3 ---
 .../qmltests/data/tst_unhandledKeyEventPropagation.qml    | 8 +++-----
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/tests/auto/quick/qmltests/BLACKLIST b/tests/auto/quick/qmltests/BLACKLIST
index 63d31c875..390e91988 100644
--- a/tests/auto/quick/qmltests/BLACKLIST
+++ b/tests/auto/quick/qmltests/BLACKLIST
@@ -16,9 +16,6 @@ windows
 [WebEngineViewSettings::test_javascriptDisabled]
 windows
 
-[WebEngineViewUnhandledKeyEventPropagation::test_keyboardModifierMapping]
-windows
-
 [WebEngineViewSource::test_viewSourceURL]
 windows
 
diff --git a/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml b/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml
index 87ef16aa2..906dc1658 100644
--- a/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml
+++ b/tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml
@@ -68,12 +68,10 @@ Item {
             keyPress(Qt.Key_Left)
             keyRelease(Qt.Key_Left)
 
-            for (var i = 0; i < 20 && parentItem.releaseEvents.length < 3; i++)
-                wait(100)
-
-            compare(parentItem.pressEvents.length, 1)
+            tryCompare(parentItem.pressEvents, "length", 1)
             compare(parentItem.pressEvents[0], Qt.Key_Left)
-            compare(parentItem.releaseEvents.length, 3)
+
+            tryCompare(parentItem.releaseEvents, "length", 3)
             compare(parentItem.releaseEvents[0], Qt.Key_A)
             compare(parentItem.releaseEvents[1], Qt.Key_Left)
             compare(parentItem.releaseEvents[2], Qt.Key_Left)
-- 
GitLab