summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests
diff options
context:
space:
mode:
authorTamas Zakor <ztamas@inf.u-szeged.hu>2019-07-26 12:24:08 +0200
committerTamas Zakor <ztamas@inf.u-szeged.hu>2019-07-28 16:50:26 +0200
commit33a2c9aed3ee621c91853570087b500c830792e0 (patch)
tree910459a583c23e7f659b3b3901195b06e3512544 /tests/auto/quick/qmltests
parentebafa45d80963fad7a8fb81e69fc7733d06b73d2 (diff)
Fix quick download directory auto test on Windows
Change-Id: Ib4668e5a21d9062ea3b1b760aec319aa9c7fdbd8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/quick/qmltests')
-rw-r--r--tests/auto/quick/qmltests/data/tst_download.qml21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_download.qml b/tests/auto/quick/qmltests/data/tst_download.qml
index ff57c76c7..c38018ffd 100644
--- a/tests/auto/quick/qmltests/data/tst_download.qml
+++ b/tests/auto/quick/qmltests/data/tst_download.qml
@@ -53,7 +53,10 @@ TestWebEngineView {
function urlToPath(url) {
var path = url.toString()
- path = path.replace(/^(file:\/{2})/,"")
+ if (Qt.platform.os !== "windows")
+ path = path.replace(/^(file:\/{2})/, "")
+ else
+ path = path.replace(/^(file:\/{3})/, "")
return path
}
@@ -90,14 +93,9 @@ TestWebEngineView {
download.cancel()
} else {
totalBytes = download.totalBytes
- download.downloadDirectory = testDownloadProfile.downloadPath
- download.downloadFileName = "testfile.zip"
- if (downloadDirectory.length != 0)
- download.downloadDirectory = testDownloadProfile.downloadPath + downloadDirectory
-
- if (downloadFileName.length != 0)
- download.downloadFileName = downloadFileName
+ download.downloadDirectory = downloadDirectory.length != 0 ? testDownloadProfile.downloadPath + downloadDirectory : testDownloadProfile.downloadPath
+ download.downloadFileName = downloadFileName.length != 0 ? downloadFileName : "testfile.zip"
download.accept()
}
@@ -125,6 +123,9 @@ TestWebEngineView {
downloadDirectoryChanged = 0
downloadFileNameChanged = 0
downloadPathChanged = 0
+ downloadDirectory = ""
+ downloadFileName = ""
+ downloadedPath = ""
}
function test_downloadRequest() {
@@ -203,8 +204,8 @@ TestWebEngineView {
tryCompare(downloadState, "1", WebEngineDownloadItem.DownloadInProgress);
compare(downloadedPath, testDownloadProfile.downloadPath + downloadDirectory + downloadFileName);
compare(downloadDirectoryChanged, 1);
- compare(downloadFileNameChanged, 3);
- compare(downloadPathChanged, 4);
+ compare(downloadFileNameChanged, 1);
+ compare(downloadPathChanged, 2);
downloadFinishedSpy.wait();
compare(totalBytes, receivedBytes);
tryCompare(downloadState, "2", WebEngineDownloadItem.DownloadCompleted);