summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorBalazs Egedi <egedib@inf.u-szeged.hu>2021-05-12 14:11:00 +0200
committerBalazs Egedi <egedib@inf.u-szeged.hu>2021-05-13 11:15:04 +0200
commit8b8cc47aa0707e4e19730119230fafd9cf98f0ba (patch)
treef11e88cd41f50b02bef52d12b0be1eb0dc075f16 /tests/auto
parentade5679e6de16bfe7bf4d3c56701947b1396b0a3 (diff)
Set enumaration root directory for File.webkitRelativePath API
Fixes: QTBUG-93304 Change-Id: If2f30aab1c6a6eb81cfbad51318ec31adf5e96b6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/quick/qmltests2/data/tst_filePicker.qml15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/quick/qmltests2/data/tst_filePicker.qml b/tests/auto/quick/qmltests2/data/tst_filePicker.qml
index 26d74e2d3..5b963c7bf 100644
--- a/tests/auto/quick/qmltests2/data/tst_filePicker.qml
+++ b/tests/auto/quick/qmltests2/data/tst_filePicker.qml
@@ -157,6 +157,16 @@ TestWebEngineView {
webEngineView.url = Qt.resolvedUrl("directoryupload.html")
verify(webEngineView.waitForLoadSucceeded())
+ webEngineView.runJavaScript(
+ "let relativePathCount = 0;" +
+ "document.getElementById('upfile').addEventListener('change', function(event) {" +
+ " let files = event.target.files;" +
+ " for (let i = 0; i < files.length; i++) {" +
+ " if (files[i].webkitRelativePath != '')" +
+ " relativePathCount++;" +
+ " }" +
+ "}, false);")
+
FilePickerParams.selectFiles = true
FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("../data"))
@@ -164,6 +174,11 @@ TestWebEngineView {
tryCompare(FilePickerParams, "filePickerOpened", true)
// Check that the title is a file list (eg. "test1.html,test2.html")
tryVerify(function() { return webEngineView.title.match("^([^,]+,)+[^,]+$"); })
+
+ var relativePathCount = 0;
+ runJavaScript("relativePathCount", function(result) { relativePathCount = result; });
+ // The number of files in data directory may vary
+ tryVerify(function() { return relativePathCount > 0; });
}
function test_reject() {