summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qmltests/data/tst_download.qml12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_download.qml b/tests/auto/quick/qmltests/data/tst_download.qml
index ffd7041e3..415318ed7 100644
--- a/tests/auto/quick/qmltests/data/tst_download.qml
+++ b/tests/auto/quick/qmltests/data/tst_download.qml
@@ -66,23 +66,26 @@ TestWebEngineView {
signalName: "downloadFinished"
}
+ Connections {
+ id: downloadItemConnections
+ onStateChanged: downloadState.push(target.state)
+ }
+
WebEngineProfile {
id: testDownloadProfile
onDownloadRequested: {
downloadState.push(download.state)
+ downloadItemConnections.target = download
if (cancelDownload) {
download.cancel()
- downloadState.push(download.state)
} else {
totalBytes = download.totalBytes
download.path = "testfile.zip"
download.accept()
- downloadState.push(download.state)
}
}
onDownloadFinished: {
- downloadState.push(download.state)
receivedBytes = download.receivedBytes;
}
}
@@ -96,6 +99,7 @@ TestWebEngineView {
totalBytes = 0
receivedBytes = 0
cancelDownload = false
+ downloadItemConnections.target = null
downloadState = []
}
@@ -133,7 +137,7 @@ TestWebEngineView {
downLoadRequestedSpy.wait()
compare(downLoadRequestedSpy.count, 1)
compare(downloadFinishedSpy.count, 1)
- compare(downloadState[2], WebEngineDownloadItem.DownloadCancelled)
+ compare(downloadState[1], WebEngineDownloadItem.DownloadCancelled)
}
}
}