diff options
author | Tamas Zakor <ztamas@inf.u-szeged.hu> | 2019-05-09 14:49:56 +0200 |
---|---|---|
committer | Tamas Zakor <ztamas@inf.u-szeged.hu> | 2019-05-16 11:57:07 +0000 |
commit | a4eeb9dbd995d598bd3a639dd450def7c242b383 (patch) | |
tree | 99d1b0fe8fa64be15948b601960c54e5b632783b /tests/auto/quick/qmltests/data | |
parent | 0c2beb49b858f49489fa4f1ecee6bfdd6ce57e68 (diff) |
Add API to get the suggested download file name
[ChangeLog][DownloadItem] Add functions and property
to get the suggested download file name.
Task-number: QTBUG-56978
Change-Id: I902870c6358271322da613a15ccc11639384e404
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_download.qml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_download.qml b/tests/auto/quick/qmltests/data/tst_download.qml index 04838f57d..c8f783b03 100644 --- a/tests/auto/quick/qmltests/data/tst_download.qml +++ b/tests/auto/quick/qmltests/data/tst_download.qml @@ -43,6 +43,7 @@ TestWebEngineView { property var downloadState: [] property var downloadInterruptReason: null property url downloadUrl: "" + property string suggestedFileName: "" function urlToPath(url) { var path = url.toString() @@ -83,6 +84,7 @@ TestWebEngineView { download.accept() } downloadUrl = download.url + suggestedFileName = download.suggestedFileName } onDownloadFinished: { receivedBytes = download.receivedBytes; @@ -109,6 +111,7 @@ TestWebEngineView { downLoadRequestedSpy.wait() compare(downLoadRequestedSpy.count, 1) compare(downloadUrl, webEngineView.url) + compare(suggestedFileName, "download.zip") compare(downloadState[0], WebEngineDownloadItem.DownloadRequested) verify(!downloadInterruptReason) } @@ -119,6 +122,7 @@ TestWebEngineView { downLoadRequestedSpy.wait() compare(downLoadRequestedSpy.count, 1) compare(downloadUrl, webEngineView.url) + compare(suggestedFileName, "download.zip") compare(totalBytes, 325) verify(!downloadInterruptReason) } @@ -129,6 +133,7 @@ TestWebEngineView { 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() @@ -144,6 +149,7 @@ TestWebEngineView { 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) |