summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests2/data/tst_filePicker.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qmltests2/data/tst_filePicker.qml')
-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() {