Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativexmlhttprequest / data / defaultState.qml
1 import QtQuick 1.0
2
3 QtObject {
4     property int readyState
5     property bool statusIsException: false
6     property bool statusTextIsException: false
7     property string responseText
8     property bool responseXMLIsNull
9
10     Component.onCompleted: {
11         var xhr = new XMLHttpRequest();
12
13         readyState = xhr.readyState;
14         try {
15             status = xhr.status;
16         } catch (error) {
17             if (error.code == DOMException.INVALID_STATE_ERR)
18                 statusIsException = true;
19         }
20         try {
21             statusText = xhr.statusText;
22         } catch (error) {
23             if (error.code == DOMException.INVALID_STATE_ERR)
24                 statusTextIsException = true;
25         }
26         responseText = xhr.responseText;
27         responseXMLIsNull = (xhr.responseXML == null);
28     }
29 }
30