summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests/data/tst_download.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qmltests/data/tst_download.qml')
-rw-r--r--tests/auto/quick/qmltests/data/tst_download.qml14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_download.qml b/tests/auto/quick/qmltests/data/tst_download.qml
index 5eb704cce..c8f783b03 100644
--- a/tests/auto/quick/qmltests/data/tst_download.qml
+++ b/tests/auto/quick/qmltests/data/tst_download.qml
@@ -28,7 +28,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.9
+import QtWebEngine 1.10
import Qt.labs.platform 1.0
TestWebEngineView {
@@ -42,6 +42,8 @@ TestWebEngineView {
property bool cancelDownload: false
property var downloadState: []
property var downloadInterruptReason: null
+ property url downloadUrl: ""
+ property string suggestedFileName: ""
function urlToPath(url) {
var path = url.toString()
@@ -81,6 +83,8 @@ TestWebEngineView {
download.path = "testfile.zip"
download.accept()
}
+ downloadUrl = download.url
+ suggestedFileName = download.suggestedFileName
}
onDownloadFinished: {
receivedBytes = download.receivedBytes;
@@ -106,6 +110,8 @@ TestWebEngineView {
webEngineView.url = Qt.resolvedUrl("download.zip")
downLoadRequestedSpy.wait()
compare(downLoadRequestedSpy.count, 1)
+ compare(downloadUrl, webEngineView.url)
+ compare(suggestedFileName, "download.zip")
compare(downloadState[0], WebEngineDownloadItem.DownloadRequested)
verify(!downloadInterruptReason)
}
@@ -115,6 +121,8 @@ TestWebEngineView {
webEngineView.url = Qt.resolvedUrl("download.zip")
downLoadRequestedSpy.wait()
compare(downLoadRequestedSpy.count, 1)
+ compare(downloadUrl, webEngineView.url)
+ compare(suggestedFileName, "download.zip")
compare(totalBytes, 325)
verify(!downloadInterruptReason)
}
@@ -124,6 +132,8 @@ TestWebEngineView {
webEngineView.url = Qt.resolvedUrl("download.zip")
downLoadRequestedSpy.wait()
compare(downLoadRequestedSpy.count, 1)
+ compare(downloadUrl, webEngineView.url)
+ compare(suggestedFileName, "download.zip")
compare(downloadState[0], WebEngineDownloadItem.DownloadRequested)
tryCompare(downloadState, "1", WebEngineDownloadItem.DownloadInProgress)
downloadFinishedSpy.wait()
@@ -138,6 +148,8 @@ TestWebEngineView {
webEngineView.url = Qt.resolvedUrl("download.zip")
downLoadRequestedSpy.wait()
compare(downLoadRequestedSpy.count, 1)
+ compare(downloadUrl, webEngineView.url)
+ compare(suggestedFileName, "download.zip")
compare(downloadFinishedSpy.count, 1)
tryCompare(downloadState, "1", WebEngineDownloadItem.DownloadCancelled)
tryCompare(webEngineView, "downloadInterruptReason", WebEngineDownloadItem.UserCanceled)