summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/xmlhttprequest/data/setRequestHeader_illegalName.qml
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-11-09 09:28:31 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-11-09 09:28:31 (GMT)
commit89fa7ae6d922ff5b62fca65eab95f35845c069eb (patch)
treeeddd885fe5a5e606afe60b2f4b2794d601c9a756 /tests/auto/declarative/xmlhttprequest/data/setRequestHeader_illegalName.qml
parentd3b1232df8fc8b238d1be8301e58c14e7102cce3 (diff)
downloadQt-89fa7ae6d922ff5b62fca65eab95f35845c069eb.zip
Qt-89fa7ae6d922ff5b62fca65eab95f35845c069eb.tar.gz
Qt-89fa7ae6d922ff5b62fca65eab95f35845c069eb.tar.bz2
XMLHttpRequest tests
Diffstat (limited to 'tests/auto/declarative/xmlhttprequest/data/setRequestHeader_illegalName.qml')
-rw-r--r--tests/auto/declarative/xmlhttprequest/data/setRequestHeader_illegalName.qml55
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/auto/declarative/xmlhttprequest/data/setRequestHeader_illegalName.qml b/tests/auto/declarative/xmlhttprequest/data/setRequestHeader_illegalName.qml
new file mode 100644
index 0000000..cf5ebcc
--- /dev/null
+++ b/tests/auto/declarative/xmlhttprequest/data/setRequestHeader_illegalName.qml
@@ -0,0 +1,55 @@
+import Qt 4.6
+
+Object {
+ property string url
+ property string header
+
+ property bool readyState: false
+ property bool openedState: false
+
+ property bool status: false
+ property bool statusText: false
+ property bool responseText: false
+ property bool responseXML: false
+
+ property bool dataOK: false
+
+ Component.onCompleted: {
+ var x = new XMLHttpRequest;
+
+ if (x.readyState == XMLHttpRequest.UNSENT)
+ readyState = true;
+
+ x.open("GET", url);
+
+ if (x.readyState == XMLHttpRequest.OPENED)
+ openedState = true;
+
+ try {
+ var a = x.status;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ status = true;
+ }
+ try {
+ var a = x.statusText;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ statusText = true;
+ }
+ responseText = (x.responseText == "");
+ responseXML = (x.responseXML == null);
+
+ // Test to the end
+ x.onreadystatechange = function() {
+ if (x.readyState == XMLHttpRequest.DONE) {
+ dataOK = (x.responseText == "QML Rocks!\n");
+ }
+ }
+
+
+ x.send()
+ }
+}
+
+