diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-03-17 09:32:34 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-03-17 09:52:19 +0100 |
commit | fb0cb17cb55c9ed44b7fcbc92efcc244e96c9b36 (patch) | |
tree | 2ba609d4c6416036d3cb5f345a6c1125e0f105d6 /tests/auto/qml/qqmlxmlhttprequest/data | |
parent | 4dc68ba888c7dbb7bd16455991f6d5814df13cba (diff) | |
parent | 84155a8e1a6250d3e4b0949a42464eee5dfef537 (diff) |
Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: I6033aba359ac551f450ad517d20a0986bf4655f6
Diffstat (limited to 'tests/auto/qml/qqmlxmlhttprequest/data')
-rw-r--r-- | tests/auto/qml/qqmlxmlhttprequest/data/qml_logo.png | bin | 0 -> 27151 bytes | |||
-rw-r--r-- | tests/auto/qml/qqmlxmlhttprequest/data/receiveBinaryData.qml | 27 | ||||
-rw-r--r-- | tests/auto/qml/qqmlxmlhttprequest/data/receive_binary_data.expect | 7 | ||||
-rw-r--r-- | tests/auto/qml/qqmlxmlhttprequest/data/receive_binary_data.reply | 3 |
4 files changed, 37 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/qml_logo.png b/tests/auto/qml/qqmlxmlhttprequest/data/qml_logo.png Binary files differnew file mode 100644 index 0000000000..681aef8aa2 --- /dev/null +++ b/tests/auto/qml/qqmlxmlhttprequest/data/qml_logo.png diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/receiveBinaryData.qml b/tests/auto/qml/qqmlxmlhttprequest/data/receiveBinaryData.qml new file mode 100644 index 0000000000..234d759284 --- /dev/null +++ b/tests/auto/qml/qqmlxmlhttprequest/data/receiveBinaryData.qml @@ -0,0 +1,27 @@ +import QtQuick 2.0 + +QtObject { + property string url + property int readSize: 0 + + Component.onCompleted: { + + var request = new XMLHttpRequest(); + request.open("GET", url); + request.responseType = "arraybuffer"; + + request.onreadystatechange = function() { + if (request.readyState == XMLHttpRequest.DONE) { + var arrayBuffer = request.response; + if (arrayBuffer) { + var byteArray = new Uint8Array(arrayBuffer); + readSize = byteArray.byteLength; + } + } + } + + request.send(null); + + } +} + diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/receive_binary_data.expect b/tests/auto/qml/qqmlxmlhttprequest/data/receive_binary_data.expect new file mode 100644 index 0000000000..79a61383e3 --- /dev/null +++ b/tests/auto/qml/qqmlxmlhttprequest/data/receive_binary_data.expect @@ -0,0 +1,7 @@ +GET /gml_logo.png HTTP/1.1 +Accept-Language: en-US,* +Content-Type: image/png +Connection: Keep-Alive +Accept-Encoding: gzip, deflate +User-Agent: Mozilla/5.0 +Host: 127.0.0.1:14445 diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/receive_binary_data.reply b/tests/auto/qml/qqmlxmlhttprequest/data/receive_binary_data.reply new file mode 100644 index 0000000000..44ba138213 --- /dev/null +++ b/tests/auto/qml/qqmlxmlhttprequest/data/receive_binary_data.reply @@ -0,0 +1,3 @@ +HTTP/1.1 200 OK +Connection: close +Content-Type: image/png |