summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-05-19 17:48:22 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-05-19 17:48:22 +0200
commit85e7fa7f9a002e7c0708af7a99d165a23753ecf4 (patch)
treec6c1ab0973a595e26f3f29f9b88a5602ed1138d9 /tests
parentb2e11595e167fd51095720af286eb21447f80d20 (diff)
parent8f7e7cfb75f821c802ed4189530f675608507ba8 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: src/core/render_widget_host_view_qt.cpp Change-Id: I86113b13bb2d8419e9e9a485197f02b2c7399cd4
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qmltests/data/tst_filePicker.qml21
-rw-r--r--tests/auto/widgets/loadsignals/tst_loadsignals.cpp4
2 files changed, 20 insertions, 5 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_filePicker.qml b/tests/auto/quick/qmltests/data/tst_filePicker.qml
index 4313c8d9e..5b963c7bf 100644
--- a/tests/auto/quick/qmltests/data/tst_filePicker.qml
+++ b/tests/auto/quick/qmltests/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() {
@@ -227,15 +242,15 @@ TestWebEngineView {
{ tag: "file://applib/products/a%2Db/ abc%5F9/4148.920a/media/test.txt", input: "file://applib/products/a%2Db/ abc%5F9/4148.920a/media/test.txt", expected: "test.txt"},
{ tag: "file://applib/products/a-b/abc_1/t.est/test.txt", input: "file://applib/products/a-b/abc_1/t.est/test.txt", expected: "test.txt"},
{ tag: "file:\\\\applib\\products\\a-b\\abc_1\\t:est\\test.txt", input: "file:\\\\applib\\products\\a-b\\abc_1\\t:est\\test.txt", expected: "test.txt"},
- { tag: "file:C:/test.txt", input: "file:C:/test.txt", expected: "test.tx"},
- { tag: "file:/C:/test.txt", input: "file:/C:/test.txt", expected: "test.tx"},
+ { tag: "file:C:/test.txt", input: "file:C:/test.txt", expected: "test.txt"},
+ { tag: "file:/C:/test.txt", input: "file:/C:/test.txt", expected: "test.txt"},
{ tag: "file://C:/test.txt", input: "file://C:/test.txt", expected: "Failed to Upload"},
{ tag: "file:///C:test.txt", input: "file:///C:test.txt", expected: "Failed to Upload"},
{ tag: "file:///C:/test.txt", input: "file:///C:/test.txt", expected: "test.txt"},
{ tag: "file:///C:\\test.txt", input: "file:///C:\\test.txt", expected: "test.txt"},
{ tag: "file:\\//C:/test.txt", input: "file:\\//C:/test.txt", expected: "test.txt"},
{ tag: "file:\\\\/C:\\test.txt", input: "file:\\\\/C:\\test.txt", expected: "test.txt"},
- { tag: "\\\\?\\C:/test.txt", input: "\\\\?\\C:/test.txt", expected: "test.tx"},
+ { tag: "\\\\?\\C:/test.txt", input: "\\\\?\\C:/test.txt", expected: "test.txt"},
];
}
diff --git a/tests/auto/widgets/loadsignals/tst_loadsignals.cpp b/tests/auto/widgets/loadsignals/tst_loadsignals.cpp
index a0fa97e02..fe01bede4 100644
--- a/tests/auto/widgets/loadsignals/tst_loadsignals.cpp
+++ b/tests/auto/widgets/loadsignals/tst_loadsignals.cpp
@@ -135,8 +135,8 @@ void tst_LoadSignals::init()
void tst_LoadSignals::clickLink(QPoint linkPos)
{
// Simulate left-clicking on link.
- QTRY_VERIFY(view.focusWidget());
- QWidget *renderWidget = view.focusWidget();
+ QTRY_VERIFY(view.focusProxy());
+ QWidget *renderWidget = view.focusProxy();
QTest::mouseClick(renderWidget, Qt::LeftButton, {}, linkPos);
}