~loic.molinari/+junk/qtdeclarative-shadereffectsource-changes

« back to all changes in this revision

Viewing changes to tests/auto/qml/qqmlxmlhttprequest/data/defaultState.qml

  • Committer: Loïc Molinari
  • Date: 2012-04-21 17:59:51 UTC
  • Revision ID: loic.molinari@canonical.com-20120421175951-bqx68caaf5zrp76l
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.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