aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlxmlhttprequest/data/file_request.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlxmlhttprequest/data/file_request.qml')
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/data/file_request.qml32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/file_request.qml b/tests/auto/qml/qqmlxmlhttprequest/data/file_request.qml
new file mode 100644
index 0000000000..51020c185e
--- /dev/null
+++ b/tests/auto/qml/qqmlxmlhttprequest/data/file_request.qml
@@ -0,0 +1,32 @@
+import QtQuick 2.0
+
+QtObject {
+ // Inputs
+
+ id: root
+
+ property string writeURL
+ property string readURL
+ // Outputs
+ property bool writeDone: false
+ property variant readResult
+
+ Component.onCompleted: {
+ // PUT
+ var xhrWrite = new XMLHttpRequest;
+ xhrWrite.open("PUT", writeURL);
+ xhrWrite.onreadystatechange = function() {
+ if (xhrWrite.readyState === XMLHttpRequest.DONE)
+ writeDone = true;
+ };
+ xhrWrite.send("Test-String");
+ // GET
+ var xhrRead = new XMLHttpRequest;
+ xhrRead.open("GET", readURL);
+ xhrRead.onreadystatechange = function() {
+ if (xhrRead.readyState === XMLHttpRequest.DONE)
+ readResult = xhrRead.responseText;
+ };
+ xhrRead.send();
+ }
+}