summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests
diff options
context:
space:
mode:
authorKirill Burtsev <kirill.burtsev@qt.io>2021-04-30 21:30:16 +0200
committerKirill Burtsev <kirill.burtsev@qt.io>2021-05-06 09:07:13 +0200
commit4d4fc9cd120376f30ce0630b1e8c7bf174d44fae (patch)
tree30424dfd873ff93ea3ff4f1fdf5791440c4fd69a /tests/auto/quick/qmltests
parent88c9dc6801a583956e2eb5063544303b6f12f95d (diff)
Fix inconsistent number of load signals and their order
This change tries to match how chromium treats one single load. Before the pair of loadStarted/loadFinished methods for api classes was called on delegate's DidStartNavigation/DidFinishNavigation, which might be many within one single logical load. This is true for multiple usecases (like multiple redirects on load, immediate form submit on DOM load, page's subresource load, or just an error page load on failure). Tracking these methods and deciding when to emit signals based on states are error-prone and complicates logic for no benefits. Also it somewhat lies about when real load is done, which is only started and finished on outer methods DidStartLoading/DidStopLoading, which are conveniently called only once for all mentioned usecases. So, this change uses these methods to issue signals for load start/finish, and only makes exception for error page, which is needed for quick's private test support. Fixes: QTBUG-65223 Fixes: QTBUG-76802 Fixes: QTBUG-87089 Fixes: QTBUG-90342 Fixes: QTBUG-91773 Fixes: QTBUG-92063 Change-Id: I9cc99b639030fedd8cf6a9dc04d0869d6be6357d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'tests/auto/quick/qmltests')
-rw-r--r--tests/auto/quick/qmltests/data/test4.html1
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadUrl.qml17
2 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/quick/qmltests/data/test4.html b/tests/auto/quick/qmltests/data/test4.html
index c9b395ee5..cf5708994 100644
--- a/tests/auto/quick/qmltests/data/test4.html
+++ b/tests/auto/quick/qmltests/data/test4.html
@@ -24,6 +24,7 @@
}
</script>
<div id="content">
+ <p><a id='anchor' href='#anchor'>anchor</a>
<p>bla00
<p>bla01
<p>bla02
diff --git a/tests/auto/quick/qmltests/data/tst_loadUrl.qml b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
index 47dbbc087..8f589cc52 100644
--- a/tests/auto/quick/qmltests/data/tst_loadUrl.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
@@ -298,20 +298,19 @@ TestWebEngineView {
compare(loadRequestArray[0].status, WebEngineView.LoadStartedStatus);
compare(loadRequestArray[1].status, WebEngineView.LoadSucceededStatus);
- // In-page navigation.
- webEngineView.url = Qt.resolvedUrl("test4.html#content");
- // In-page navigation doesn't trigger load succeeded, wait for load progress instead.
- tryCompare(loadRequestArray, "length", 3);
- tryCompare(webEngineView, "loadProgress", 100);
- compare(loadRequestArray[2].status, WebEngineView.LoadStartedStatus);
+ // In-page navigation shouldn't trigger load
+ let anchorUrl = Qt.resolvedUrl("test4.html#anchor");
+ let c = webEngineView.getElementCenter('anchor')
+ mouseClick(webEngineView, c.x, c.y)
+ tryCompare(webEngineView, 'url', anchorUrl)
// Load after in-page navigation.
webEngineView.url = Qt.resolvedUrl("test4.html");
verify(webEngineView.waitForLoadSucceeded());
compare(webEngineView.loadProgress, 100);
- compare(loadRequestArray.length, 5);
- compare(loadRequestArray[3].status, WebEngineView.LoadStartedStatus);
- compare(loadRequestArray[4].status, WebEngineView.LoadSucceededStatus);
+ compare(loadRequestArray.length, 4);
+ compare(loadRequestArray[2].status, WebEngineView.LoadStartedStatus);
+ compare(loadRequestArray[3].status, WebEngineView.LoadSucceededStatus);
webEngineView.clear();
}