summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlxmlhttprequest/data/defaultState.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qmlxmlhttprequest/data/defaultState.qml')
-rw-r--r--tests/auto/declarative/qmlxmlhttprequest/data/defaultState.qml30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlxmlhttprequest/data/defaultState.qml b/tests/auto/declarative/qmlxmlhttprequest/data/defaultState.qml
new file mode 100644
index 0000000..4dcf6f9
--- /dev/null
+++ b/tests/auto/declarative/qmlxmlhttprequest/data/defaultState.qml
@@ -0,0 +1,30 @@
+import Qt 4.6
+
+QtObject {
+ property int readyState
+ property bool statusIsException: false
+ property bool statusTextIsException: false
+ property string responseText
+ property bool responseXMLIsNull
+
+ Component.onCompleted: {
+ var xhr = new XMLHttpRequest();
+
+ readyState = xhr.readyState;
+ try {
+ status = xhr.status;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ statusIsException = true;
+ }
+ try {
+ statusText = xhr.statusText;
+ } catch (error) {
+ if (error.code == DOMException.INVALID_STATE_ERR)
+ statusTextIsException = true;
+ }
+ responseText = xhr.responseText;
+ responseXMLIsNull = (xhr.responseXML == null);
+ }
+}
+