aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlengine/data
diff options
context:
space:
mode:
authorAlan Alpert <aalpert@blackberry.com>2013-07-18 06:02:37 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-11 12:18:15 +0100
commit054e50babc340f1d8b6c037fca143f90dbd0c1f2 (patch)
treed15e6d1a746d28138bdf479024a51c94cb5fa8a2 /tests/auto/qml/qqmlengine/data
parent98c47db70a72a8afbd86afd355dadb1ce9113361 (diff)
Intercept qmldir files with the url interceptor
There's another code path which loads qmldir files directly, and it did not use the interceptor when available. Note that this, like other interceptors, does not affect baseUrl and so any other qmldir file still must have paths relative from the initial URL. Change-Id: I620943c36d488d22fbaf1793514075d31ab76e3e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmlengine/data')
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/imports/Test.2/qmldir1
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/module/intercepted/Intercepted.qml9
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/module/intercepted/comment1
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/module/intercepted/qmldir1
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/module/urlInterceptor.qml3
5 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlengine/data/interception/imports/Test.2/qmldir b/tests/auto/qml/qqmlengine/data/interception/imports/Test.2/qmldir
new file mode 100644
index 0000000000..971812c162
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/imports/Test.2/qmldir
@@ -0,0 +1 @@
+This qmldir file is intentionally invalid, as the URL interception should prevent it being accessed.
diff --git a/tests/auto/qml/qqmlengine/data/interception/module/intercepted/Intercepted.qml b/tests/auto/qml/qqmlengine/data/interception/module/intercepted/Intercepted.qml
new file mode 100644
index 0000000000..5416ef5dcc
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/module/intercepted/Intercepted.qml
@@ -0,0 +1,9 @@
+import QtQml 2.0
+
+QtObject {
+ property url filePath: "doesNotExist.file"
+ property url resolvedUrl: Qt.resolvedUrl("doesNotExist.file");
+ property url absoluteUrl: Qt.resolvedUrl("file:///doesNotExist.file");
+ property string childString: "intercepted"
+ property string scriptString: "intercepted"
+}
diff --git a/tests/auto/qml/qqmlengine/data/interception/module/intercepted/comment b/tests/auto/qml/qqmlengine/data/interception/module/intercepted/comment
new file mode 100644
index 0000000000..b10233e48d
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/module/intercepted/comment
@@ -0,0 +1 @@
+Note that the paths are relative the the qmldir file in the actual module path, not the intercepted qmldir file
diff --git a/tests/auto/qml/qqmlengine/data/interception/module/intercepted/qmldir b/tests/auto/qml/qqmlengine/data/interception/module/intercepted/qmldir
new file mode 100644
index 0000000000..c5457b232a
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/module/intercepted/qmldir
@@ -0,0 +1 @@
+TestObject 2.0 ../../module/intercepted/Intercepted.qml
diff --git a/tests/auto/qml/qqmlengine/data/interception/module/urlInterceptor.qml b/tests/auto/qml/qqmlengine/data/interception/module/urlInterceptor.qml
new file mode 100644
index 0000000000..b79a783582
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/module/urlInterceptor.qml
@@ -0,0 +1,3 @@
+import Test 2.0 //This import will be intercepted to make this file valid
+
+TestObject {}