aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlxmlhttprequest/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlxmlhttprequest/data')
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/data/send_data.10.expect10
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/data/send_data.2.reply3
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/data/send_data.8.expect7
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/data/send_data.8.qml24
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/data/send_data.9.expect7
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/data/send_data.9.qml24
6 files changed, 75 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/send_data.10.expect b/tests/auto/qml/qqmlxmlhttprequest/data/send_data.10.expect
new file mode 100644
index 0000000000..b099ed205e
--- /dev/null
+++ b/tests/auto/qml/qqmlxmlhttprequest/data/send_data.10.expect
@@ -0,0 +1,10 @@
+OPTIONS /testdocument.html HTTP/1.1
+Accept-Language: en-US,*
+Content-Type: text/plain;charset=UTF-8
+Content-Length: 12
+Connection: Keep-Alive
+Accept-Encoding: gzip, deflate
+User-Agent: Mozilla/5.0
+Host: 127.0.0.1:14445
+
+My Sent Data \ No newline at end of file
diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/send_data.2.reply b/tests/auto/qml/qqmlxmlhttprequest/data/send_data.2.reply
new file mode 100644
index 0000000000..b4f5ecd429
--- /dev/null
+++ b/tests/auto/qml/qqmlxmlhttprequest/data/send_data.2.reply
@@ -0,0 +1,3 @@
+HTTP/1.1 200 OK
+Allow: GET,HEAD,POST,OPTIONS,TRACE
+Content-Length: 0
diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/send_data.8.expect b/tests/auto/qml/qqmlxmlhttprequest/data/send_data.8.expect
new file mode 100644
index 0000000000..8462c40ba1
--- /dev/null
+++ b/tests/auto/qml/qqmlxmlhttprequest/data/send_data.8.expect
@@ -0,0 +1,7 @@
+OPTIONS / HTTP/1.1
+Content-Length: 0
+Connection: Keep-Alive
+Accept-Encoding: gzip, deflate
+Accept-Language: en-US,*
+User-Agent: Mozilla/5.0
+Host: 127.0.0.1:14445
diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/send_data.8.qml b/tests/auto/qml/qqmlxmlhttprequest/data/send_data.8.qml
new file mode 100644
index 0000000000..bda5871a18
--- /dev/null
+++ b/tests/auto/qml/qqmlxmlhttprequest/data/send_data.8.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+
+QtObject {
+ property string url
+
+ property bool dataOK: false
+ property bool headerOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.open("OPTIONS", url);
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
+ headerOK = (x.getResponseHeader("Allow") == "GET,HEAD,POST,OPTIONS,TRACE");
+ } else if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "");
+ }
+ }
+
+ x.send();
+ }
+}
diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/send_data.9.expect b/tests/auto/qml/qqmlxmlhttprequest/data/send_data.9.expect
new file mode 100644
index 0000000000..02af8c99b8
--- /dev/null
+++ b/tests/auto/qml/qqmlxmlhttprequest/data/send_data.9.expect
@@ -0,0 +1,7 @@
+OPTIONS /testdocument.html HTTP/1.1
+Content-Length: 0
+Connection: Keep-Alive
+Accept-Encoding: gzip, deflate
+Accept-Language: en-US,*
+User-Agent: Mozilla/5.0
+Host: 127.0.0.1:14445
diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/send_data.9.qml b/tests/auto/qml/qqmlxmlhttprequest/data/send_data.9.qml
new file mode 100644
index 0000000000..834916f96c
--- /dev/null
+++ b/tests/auto/qml/qqmlxmlhttprequest/data/send_data.9.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+
+QtObject {
+ property string url
+
+ property bool dataOK: false
+ property bool headerOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+ x.open("OPTIONS", url);
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
+ headerOK = (x.getResponseHeader("Allow") == "GET,HEAD,POST,OPTIONS,TRACE");
+ } else if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "");
+ }
+ }
+
+ x.send("My Sent Data");
+ }
+}