diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2018-03-05 11:27:48 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2018-03-08 20:44:19 +0000 |
commit | 1bda20527b2c880e3f88926605ea37f9b67de26e (patch) | |
tree | 09c31c6ce4b196d2697f3a365bfc033454247bdf /tests/auto/quick/qmltests/data/tst_loadUrl.qml | |
parent | abe1c22264c499bcadca2c7d76651e8b44faeb68 (diff) |
Fix loadStarted signal after an in-page navigationv5.11.0-beta2
In-page navigations does not trigger loadFinished thus
m_lastLoadProgress is not reset to -1. Do not ignore loadStarted signal
if m_lastLoadProgress is set to 100 because it can mean a new navigation
after an in-page one.
Task-number: QTBUG-66869
Change-Id: I2b556fe7e3e097c338bdd7ca47e7384722e7eca9
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/quick/qmltests/data/tst_loadUrl.qml')
-rw-r--r-- | tests/auto/quick/qmltests/data/tst_loadUrl.qml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_loadUrl.qml b/tests/auto/quick/qmltests/data/tst_loadUrl.qml index 37ba4da43..d48ab277c 100644 --- a/tests/auto/quick/qmltests/data/tst_loadUrl.qml +++ b/tests/auto/quick/qmltests/data/tst_loadUrl.qml @@ -281,5 +281,31 @@ TestWebEngineView { compare(loadRequest.activeUrl, url); webEngineView.clear(); } + + function test_loadStartedAfterInPageNavigation() { + webEngineView.url = Qt.resolvedUrl("test4.html"); + verify(webEngineView.waitForLoadSucceeded()); + compare(webEngineView.loadProgress, 100); + compare(loadRequestArray.length, 2); + 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(webEngineView, "loadProgress", 100); + compare(loadRequestArray.length, 3); + compare(loadRequestArray[2].status, WebEngineView.LoadStartedStatus); + + // 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); + + webEngineView.clear(); + } } } |