summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests/data
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2018-03-05 13:45:23 +0100
committerKai Koehne <kai.koehne@qt.io>2018-03-08 14:40:36 +0000
commit58b0b8d52222018c814b5e1c0d0d8cf648bca835 (patch)
treeeccaa3c58a997f719109d3176b1847a49e72082e /tests/auto/quick/qmltests/data
parent104adb064e0a639f3e4b6eb12c978ddc515ded26 (diff)
Stabilize WebEngineViewLoadHtml::test_loadProgressAfterLoadHtml
The previous test will set the webEngineView.loadProgress to 100 due to a successful load. Therefore, the test can't expect 0 loadProgress at the beginning. Count the loadProgress changes instead of checking the initial value. Change-Id: I8f4727d5b8c7ebf1b7c640e44a9eb3ca5a7fef44 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/quick/qmltests/data')
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadHtml.qml10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_loadHtml.qml b/tests/auto/quick/qmltests/data/tst_loadHtml.qml
index 73b6139e2..ed1de41fd 100644
--- a/tests/auto/quick/qmltests/data/tst_loadHtml.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadHtml.qml
@@ -46,10 +46,18 @@ TestWebEngineView {
when: windowShown
function test_loadProgressAfterLoadHtml() {
- compare(webEngineView.loadProgress, 0)
+ var loadProgressChangedCount = 0;
+
+ var handleLoadProgressChanged = function() {
+ loadProgressChangedCount++;
+ }
+
+ webEngineView.loadProgressChanged.connect(handleLoadProgressChanged);
webEngineView.loadHtml("<html><head><title>Test page 1</title></head><body>Hello.</body></html>")
verify(webEngineView.waitForLoadSucceeded())
compare(webEngineView.loadProgress, 100)
+ verify(loadProgressChangedCount);
+ webEngineView.loadProgressChanged.disconnect(handleLoadProgressChanged);
}
function test_dataURLFragment() {