diff options
author | Alan Alpert <aalpert@rim.com> | 2013-02-28 17:03:43 -0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-07 19:41:26 +0200 |
commit | 223313479bf8ec80158ba0f6cba4dd5e74d92718 (patch) | |
tree | bc39fb195736657dec6a09106ad9609253074d77 /tests/auto/qml/qqmlengine/data | |
parent | 40d90b50c555a968f1ae540527199042fbcf1a32 (diff) |
Add a URL interceptor to the QML engine
Allows for custom file handling to a greater extent than the
QNetworkAccessManager.
Change-Id: Ifd3946bf33530c40ca2edeeb9f441f712e4941f6
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
Diffstat (limited to 'tests/auto/qml/qqmlengine/data')
21 files changed, 120 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlengine/data/interception/qmldir/Intercepted.qml b/tests/auto/qml/qqmlengine/data/interception/qmldir/Intercepted.qml new file mode 100644 index 0000000000..0331a01ad4 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/qmldir/Intercepted.qml @@ -0,0 +1,5 @@ +import QtQml 2.0 + +QtObject { + property string myStr: "intercepted" +} diff --git a/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted.js b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted.js new file mode 100644 index 0000000000..6f54ebcdc5 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted.js @@ -0,0 +1 @@ +var myStr = "base file" diff --git a/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/Intercepted.qml b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/Intercepted.qml new file mode 100644 index 0000000000..ef5c28f87b --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/Intercepted.qml @@ -0,0 +1,6 @@ +import QtQml 2.0 + +QtObject { + property string myStr: "intercepted" + property Intercepted2 compilationIsTest: Intercepted2{} +} diff --git a/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/Intercepted2.qml b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/Intercepted2.qml new file mode 100644 index 0000000000..0331a01ad4 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/Intercepted2.qml @@ -0,0 +1,5 @@ +import QtQml 2.0 + +QtObject { + property string myStr: "intercepted" +} diff --git a/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/intercepted.js b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/intercepted.js new file mode 100644 index 0000000000..6eeee6e72f --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/intercepted.js @@ -0,0 +1 @@ +var myStr = "intercepted" diff --git a/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/urlInterceptor.qml b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/urlInterceptor.qml new file mode 100644 index 0000000000..bd4aee056a --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/urlInterceptor.qml @@ -0,0 +1,11 @@ +import QtQml 2.0 +import "intercepted.js" as Script + +QtObject { + property url filePath: "FailsTest" + property url resolvedUrl: Qt.resolvedUrl("FailsTest"); + property url absoluteUrl: Qt.resolvedUrl("file:///FailsTest"); + property string childString: child.myStr + property string scriptString: Script.myStr + property Intercepted child: Intercepted {} +} diff --git a/tests/auto/qml/qqmlengine/data/interception/qmldir/urlInterceptor.qml b/tests/auto/qml/qqmlengine/data/interception/qmldir/urlInterceptor.qml new file mode 100644 index 0000000000..22a09e5522 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/qmldir/urlInterceptor.qml @@ -0,0 +1,12 @@ +import QtQml 2.0 +import "." +import "intercepted.js" as Script + +QtObject { + property url filePath: "doesNotExist.file" + property url resolvedUrl: Qt.resolvedUrl("doesNotExist.file"); + property url absoluteUrl: Qt.resolvedUrl("file:///doesNotExist.file"); + property string childString: child.myStr + property string scriptString: Script.myStr + property Intercepted child: Intercepted {} +} diff --git a/tests/auto/qml/qqmlengine/data/interception/strings/Intercepted.qml b/tests/auto/qml/qqmlengine/data/interception/strings/Intercepted.qml new file mode 100644 index 0000000000..449207e0e3 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/strings/Intercepted.qml @@ -0,0 +1,5 @@ +import QtQml 2.0 + +QtObject { + property string myStr: "base file" +} diff --git a/tests/auto/qml/qqmlengine/data/interception/strings/intercepted.js b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted.js new file mode 100644 index 0000000000..6f54ebcdc5 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted.js @@ -0,0 +1 @@ +var myStr = "base file" diff --git a/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/Intercepted.qml b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/Intercepted.qml new file mode 100644 index 0000000000..0331a01ad4 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/Intercepted.qml @@ -0,0 +1,5 @@ +import QtQml 2.0 + +QtObject { + property string myStr: "intercepted" +} diff --git a/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/intercepted.js b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/intercepted.js new file mode 100644 index 0000000000..6eeee6e72f --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/intercepted.js @@ -0,0 +1 @@ +var myStr = "intercepted" diff --git a/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/urlInterceptor.qml b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/urlInterceptor.qml new file mode 100644 index 0000000000..bd4aee056a --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/urlInterceptor.qml @@ -0,0 +1,11 @@ +import QtQml 2.0 +import "intercepted.js" as Script + +QtObject { + property url filePath: "FailsTest" + property url resolvedUrl: Qt.resolvedUrl("FailsTest"); + property url absoluteUrl: Qt.resolvedUrl("file:///FailsTest"); + property string childString: child.myStr + property string scriptString: Script.myStr + property Intercepted child: Intercepted {} +} diff --git a/tests/auto/qml/qqmlengine/data/interception/strings/urlInterceptor.qml b/tests/auto/qml/qqmlengine/data/interception/strings/urlInterceptor.qml new file mode 100644 index 0000000000..be86195bd8 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/strings/urlInterceptor.qml @@ -0,0 +1,11 @@ +import QtQml 2.0 +import "intercepted.js" as Script + +QtObject { + property url filePath: "doesNotExist.file" + property url resolvedUrl: Qt.resolvedUrl("doesNotExist.file"); + property url absoluteUrl: Qt.resolvedUrl("file:///doesNotExist.file"); + property string childString: child.myStr + property string scriptString: Script.myStr + property Intercepted child: Intercepted {} +} diff --git a/tests/auto/qml/qqmlengine/data/interception/types/Intercepted.qml b/tests/auto/qml/qqmlengine/data/interception/types/Intercepted.qml new file mode 100644 index 0000000000..449207e0e3 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/types/Intercepted.qml @@ -0,0 +1,5 @@ +import QtQml 2.0 + +QtObject { + property string myStr: "base file" +} diff --git a/tests/auto/qml/qqmlengine/data/interception/types/Intercepted2.qml b/tests/auto/qml/qqmlengine/data/interception/types/Intercepted2.qml new file mode 100644 index 0000000000..0331a01ad4 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/types/Intercepted2.qml @@ -0,0 +1,5 @@ +import QtQml 2.0 + +QtObject { + property string myStr: "intercepted" +} diff --git a/tests/auto/qml/qqmlengine/data/interception/types/intercepted.js b/tests/auto/qml/qqmlengine/data/interception/types/intercepted.js new file mode 100644 index 0000000000..6f54ebcdc5 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/types/intercepted.js @@ -0,0 +1 @@ +var myStr = "base file" diff --git a/tests/auto/qml/qqmlengine/data/interception/types/intercepted/Intercepted.qml b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/Intercepted.qml new file mode 100644 index 0000000000..ef5c28f87b --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/Intercepted.qml @@ -0,0 +1,6 @@ +import QtQml 2.0 + +QtObject { + property string myStr: "intercepted" + property Intercepted2 compilationIsTest: Intercepted2{} +} diff --git a/tests/auto/qml/qqmlengine/data/interception/types/intercepted/Intercepted2.qml b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/Intercepted2.qml new file mode 100644 index 0000000000..0331a01ad4 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/Intercepted2.qml @@ -0,0 +1,5 @@ +import QtQml 2.0 + +QtObject { + property string myStr: "intercepted" +} diff --git a/tests/auto/qml/qqmlengine/data/interception/types/intercepted/intercepted.js b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/intercepted.js new file mode 100644 index 0000000000..6eeee6e72f --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/intercepted.js @@ -0,0 +1 @@ +var myStr = "intercepted" diff --git a/tests/auto/qml/qqmlengine/data/interception/types/intercepted/urlInterceptor.qml b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/urlInterceptor.qml new file mode 100644 index 0000000000..be86195bd8 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/urlInterceptor.qml @@ -0,0 +1,11 @@ +import QtQml 2.0 +import "intercepted.js" as Script + +QtObject { + property url filePath: "doesNotExist.file" + property url resolvedUrl: Qt.resolvedUrl("doesNotExist.file"); + property url absoluteUrl: Qt.resolvedUrl("file:///doesNotExist.file"); + property string childString: child.myStr + property string scriptString: Script.myStr + property Intercepted child: Intercepted {} +} diff --git a/tests/auto/qml/qqmlengine/data/interception/types/urlInterceptor.qml b/tests/auto/qml/qqmlengine/data/interception/types/urlInterceptor.qml new file mode 100644 index 0000000000..bd4aee056a --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/interception/types/urlInterceptor.qml @@ -0,0 +1,11 @@ +import QtQml 2.0 +import "intercepted.js" as Script + +QtObject { + property url filePath: "FailsTest" + property url resolvedUrl: Qt.resolvedUrl("FailsTest"); + property url absoluteUrl: Qt.resolvedUrl("file:///FailsTest"); + property string childString: child.myStr + property string scriptString: Script.myStr + property Intercepted child: Intercepted {} +} |