aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-06-15 15:48:40 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-06-22 09:10:18 +0200
commit8a3f8595569a920cf2fa811704dec97ae31be15d (patch)
tree84496eca2ae5330492ae54c7cf08531471127e3f /tests/auto/quick
parent64fb25a2acada6d9f0897b7e8db4583de4d8d2be (diff)
Revert "Decode directory separators in source URLs"
This reverts commit 7ec30c51b287159377761338fe6d3b48706d74ee. We don't want to half-decode directory separators on assignment. This just introduces inconsistency down the line. [ChangeLog][QtQml][Important Behavior Changes] Percent-encoded directory separators in URLs are not automatically decoded on assignment to url properties anymore. This was obviously not a good idea to begin with. Fixes: QTBUG-81244 Change-Id: I1938abbe8aada88beff0d628397674255e8b2472 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/quick')
-rw-r--r--tests/auto/quick/qquickloader/tst_qquickloader.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/auto/quick/qquickloader/tst_qquickloader.cpp b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
index 552393491d..a204be8d59 100644
--- a/tests/auto/quick/qquickloader/tst_qquickloader.cpp
+++ b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
@@ -214,11 +214,16 @@ void tst_QQuickLoader::sourceOrComponent_data()
QTest::addColumn<QUrl>("sourceUrl");
QTest::addColumn<QString>("errorString");
+ auto encodedTestFileUrl = [&](const char *file)
+ {
+ return dataDirectoryUrl().resolved(QUrl(file));
+ };
+
QTest::newRow("source") << "source" << "source: 'Rect120x60.qml'\n" << testFileUrl("Rect120x60.qml") << "";
QTest::newRow("source with subdir") << "source" << "source: 'subdir/Test.qml'\n" << testFileUrl("subdir/Test.qml") << "";
- QTest::newRow("source with encoded subdir literal") << "source" << "source: 'subdir%2fTest.qml'\n" << testFileUrl("subdir/Test.qml") << "";
- QTest::newRow("source with encoded subdir optimized binding") << "source" << "source: 'subdir' + '%2fTest.qml'\n" << testFileUrl("subdir/Test.qml") << "";
- QTest::newRow("source with encoded subdir binding") << "source" << "source: encodeURIComponent('subdir/Test.qml')\n" << testFileUrl("subdir/Test.qml") << "";
+ QTest::newRow("source with encoded subdir literal") << "source" << "source: 'subdir%2fTest.qml'\n" << encodedTestFileUrl("subdir%2FTest.qml") << "";
+ QTest::newRow("source with encoded subdir optimized binding") << "source" << "source: 'subdir' + '%2fTest.qml'\n" << encodedTestFileUrl("subdir%2FTest.qml") << "";
+ QTest::newRow("source with encoded subdir binding") << "source" << "source: encodeURIComponent('subdir/Test.qml')\n" << encodedTestFileUrl("subdir%2FTest.qml") << "";
QTest::newRow("sourceComponent") << "component" << "Component { id: comp; Rectangle { width: 100; height: 50 } }\n sourceComponent: comp\n" << QUrl() << "";
QTest::newRow("invalid source") << "source" << "source: 'IDontExist.qml'\n" << testFileUrl("IDontExist.qml")
<< QString(testFileUrl("IDontExist.qml").toString() + ": No such file or directory");