Commit d96f8495 authored by Allan Sandfeld Jensen's avatar Allan Sandfeld Jensen
Browse files

Stabilize tst_javaScriptDialogs similateUserGesture


It was only reading window.mousePressReceived once, which can sometimes
be before the click is processed.

Change-Id: Ia0a7067a202afa563696708e6df5aa9445335eb8
Reviewed-by: default avatarPeter Varga <pvarga@inf.u-szeged.hu>
parent 2e065369
No related merge requests found
Showing with 10 additions and 8 deletions
......@@ -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() {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment