summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-01-22 10:55:57 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-01-25 15:41:53 +0100
commitcde72003881c6b5680ac8ac0fe6d6971bb43e0d5 (patch)
treefcb50002765c1cb179dd6f62054380c3fed85e80 /tests/auto/quick/qmltests
parent3fb215dab139fd7b61473ce3fe1058b87a6b4fe3 (diff)
parent75d061bbc68875c08b3dc243e464e32a80da71df (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Including update to 87-based Change-Id: I36b6054e00de97ab055d0bc800cff08d0408fac6
Diffstat (limited to 'tests/auto/quick/qmltests')
-rw-r--r--tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml b/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml
index 658071005..a521ea0d6 100644
--- a/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml
+++ b/tests/auto/quick/qmltests/data/tst_javaScriptDialogs.qml
@@ -112,6 +112,13 @@ TestWebEngineView {
simulateUserGesture()
webEngineView.triggerWebAction(WebEngineView.RequestClose);
verify(webEngineView.waitForWindowCloseRequested());
+
+ // Navigate away from page with onbeforeunload handler,
+ // otherwise it would trigger an extra dialog request when
+ // navigating in the subsequent test.
+ webEngineView.url = Qt.resolvedUrl("about:blank");
+ verify(webEngineView.waitForLoadSucceeded());
+ compare(JSDialogParams.dialogCount, 2)
}
function test_rejectClose() {
@@ -123,6 +130,14 @@ TestWebEngineView {
simulateUserGesture()
webEngineView.triggerWebAction(WebEngineView.RequestClose);
verify(webEngineView.testSupport.waitForWindowCloseRejected());
+
+ // Navigate away from page with onbeforeunload handler,
+ // otherwise it would trigger an extra dialog request when
+ // navigating in the subsequent test.
+ JSDialogParams.shouldAcceptDialog = true;
+ webEngineView.url = Qt.resolvedUrl("about:blank");
+ verify(webEngineView.waitForLoadSucceeded());
+ compare(JSDialogParams.dialogCount, 2)
}
function test_prompt() {