Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativexmlhttprequest / data / invalidMethodUsage.qml
1 import QtQuick 1.0 
2
3 QtObject {
4     property bool onreadystatechange: false
5     property bool readyState: false
6     property bool status: false
7     property bool statusText: false
8     property bool responseText: false
9     property bool responseXML: false
10
11     property bool open: false
12     property bool setRequestHeader: false
13     property bool send: false
14     property bool abort: false
15     property bool getResponseHeader: false
16     property bool getAllResponseHeaders: false
17
18     Component.onCompleted: {
19         var o = 10;
20
21         try {
22             XMLHttpRequest.prototype.onreadystatechange
23         } catch (e) {
24             if (!(e instanceof ReferenceError))
25                 return;
26
27             if (e.message != "Not an XMLHttpRequest object")
28                 return;
29
30             onreadystatechange = true;
31         }
32         try {
33             XMLHttpRequest.prototype.readyState
34         } catch (e) {
35             if (!(e instanceof ReferenceError))
36                 return;
37
38             if (e.message != "Not an XMLHttpRequest object")
39                 return;
40
41             readyState = true;
42         }
43         try {
44             XMLHttpRequest.prototype.status
45         } catch (e) {
46             if (!(e instanceof ReferenceError))
47                 return;
48
49             if (e.message != "Not an XMLHttpRequest object")
50                 return;
51
52             status = true;
53         }
54         try {
55             XMLHttpRequest.prototype.statusText
56         } catch (e) {
57             if (!(e instanceof ReferenceError))
58                 return;
59
60             if (e.message != "Not an XMLHttpRequest object")
61                 return;
62
63             statusText = true;
64         }
65         try {
66             XMLHttpRequest.prototype.responseText
67         } catch (e) {
68             if (!(e instanceof ReferenceError))
69                 return;
70
71             if (e.message != "Not an XMLHttpRequest object")
72                 return;
73
74             responseText = true;
75         }
76         try {
77             XMLHttpRequest.prototype.responseXML
78         } catch (e) {
79             if (!(e instanceof ReferenceError))
80                 return;
81
82             if (e.message != "Not an XMLHttpRequest object")
83                 return;
84
85             responseXML = true;
86         }
87
88         try {
89             XMLHttpRequest.prototype.open.call(o);
90         } catch (e) {
91             if (!(e instanceof ReferenceError))
92                 return;
93
94             if (e.message != "Not an XMLHttpRequest object")
95                 return;
96
97             open = true;
98         }
99
100         try {
101             XMLHttpRequest.prototype.setRequestHeader.call(o);
102         } catch (e) {
103             if (!(e instanceof ReferenceError))
104                 return;
105
106             if (e.message != "Not an XMLHttpRequest object")
107                 return;
108
109             setRequestHeader = true;
110         }
111
112         try {
113             XMLHttpRequest.prototype.send.call(o);
114         } catch (e) {
115             if (!(e instanceof ReferenceError))
116                 return;
117
118             if (e.message != "Not an XMLHttpRequest object")
119                 return;
120
121             send = true;
122         }
123
124         try {
125             XMLHttpRequest.prototype.abort.call(o);
126         } catch (e) {
127             if (!(e instanceof ReferenceError))
128                 return;
129
130             if (e.message != "Not an XMLHttpRequest object")
131                 return;
132
133             abort = true;
134         }
135
136         try {
137             XMLHttpRequest.prototype.getResponseHeader.call(o);
138         } catch (e) {
139             if (!(e instanceof ReferenceError))
140                 return;
141
142             if (e.message != "Not an XMLHttpRequest object")
143                 return;
144
145             getResponseHeader = true;
146         }
147
148         try {
149             XMLHttpRequest.prototype.getAllResponseHeaders.call(o);
150         } catch (e) {
151             if (!(e instanceof ReferenceError))
152                 return;
153
154             if (e.message != "Not an XMLHttpRequest object")
155                 return;
156
157             getAllResponseHeaders = true;
158         }
159     }
160 }