From 3b0b2e040f596105a56f83bfc0adc9f1df1bd009 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Mon, 5 Mar 2018 14:11:45 +0100 Subject: Stabilize WebEngineViewLoadUrl::test_stopStatus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Allan Sandfeld Jensen --- tests/auto/quick/qmltests/data/tst_loadUrl.qml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'tests') 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(); } -- cgit v1.2.3