summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2018-03-05 14:11:45 +0100
committerPeter Varga <pvarga@inf.u-szeged.hu>2018-03-14 14:36:26 +0000
commit3b0b2e040f596105a56f83bfc0adc9f1df1bd009 (patch)
tree20b028a61714fb563a6075dec6db57a87706d63c /tests
parentfde0040d5bba1ded3e36f56c7ca3c8f16380b413 (diff)
Stabilize WebEngineViewLoadUrl::test_stopStatus
After stopping the load the active URL should be the url of the previous successful load. Test active URL properly to make the test independent from the previously executed test. Change-Id: I53800fe28a722a5f3554b1ff2d4fc31cb8638dfd Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadUrl.qml20
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_loadUrl.qml b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
index d48ab277c..d1b6d6099 100644
--- a/tests/auto/quick/qmltests/data/tst_loadUrl.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
@@ -260,25 +260,33 @@ TestWebEngineView {
function test_stopStatus() {
var loadRequest = null;
+ var initialUrl = Qt.resolvedUrl("test1.html");
+ var stoppedUrl = Qt.resolvedUrl("test2.html");
+ // Warm up phase
+ webEngineView.url = initialUrl;
+ verify(webEngineView.waitForLoadSucceeded());
+ webEngineView.loadStatus = null;
+ loadRequestArray = [];
+
+ // Stop load
var handleLoadStarted = function(loadRequest) {
if (loadRequest.status === WebEngineView.LoadStartedStatus)
webEngineView.stop();
}
webEngineView.loadingChanged.connect(handleLoadStarted);
- var url = Qt.resolvedUrl("test1.html");
- webEngineView.url = url;
+ webEngineView.url = stoppedUrl;
tryCompare(loadRequestArray, "length", 2);
webEngineView.loadingChanged.disconnect(handleLoadStarted);
loadRequest = loadRequestArray[0];
compare(loadRequest.status, WebEngineView.LoadStartedStatus);
- compare(loadRequest.url, url);
- compare(loadRequest.activeUrl, url);
+ compare(loadRequest.url, stoppedUrl);
+ compare(loadRequest.activeUrl, stoppedUrl);
loadRequest = loadRequestArray[1];
compare(loadRequest.status, WebEngineView.LoadStoppedStatus);
- compare(loadRequest.url, url);
- compare(loadRequest.activeUrl, url);
+ compare(loadRequest.url, stoppedUrl);
+ compare(loadRequest.activeUrl, initialUrl);
webEngineView.clear();
}