summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml')
-rw-r--r--tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml b/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml
index 44836d67c..07236c3be 100644
--- a/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml
+++ b/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml
@@ -83,6 +83,15 @@ TestWebEngineView {
compare(webEngineView.title, "REJECTED")
}
+ function readMousePressRecieved() {
+ var mousePressReceived;
+ runJavaScript("window.mousePressReceived", function(result) {
+ mousePressReceived = result;
+ });
+
+ _waitFor(function() { return mousePressReceived != undefined; });
+ return mousePressReceived;
+ }
function simulateUserGesture() {
// A user gesture after page load is required since Chromium 60 to allow showing
@@ -90,14 +99,7 @@ TestWebEngineView {
// See https://www.chromestatus.com/feature/5082396709879808
mouseClick(webEngineView, 10, 10, Qt.LeftButton)
- var mousePressReceived;
- runJavaScript("window.mousePressReceived", function(result) {
- mousePressReceived = result;
- });
-
- tryVerify(function() {
- return mousePressReceived != undefined
- }, 5000);
+ tryVerify(readMousePressRecieved)
}
function test_confirmClose() {