aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlxmlhttprequest/data/defaultState.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlxmlhttprequest/data/defaultState.qml')
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/data/defaultState.qml30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/defaultState.qml b/tests/auto/qml/qqmlxmlhttprequest/data/defaultState.qml
new file mode 100644
index 0000000000..913fe59f99
--- /dev/null
+++ b/tests/auto/qml/qqmlxmlhttprequest/data/defaultState.qml
@@ -0,0 +1,30 @@
+import QtQuick 2.0
+
+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);
+ }
+}
+