aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlxmlhttprequest/data/invalidMethodUsage.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlxmlhttprequest/data/invalidMethodUsage.qml')
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/data/invalidMethodUsage.qml148
1 files changed, 148 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/invalidMethodUsage.qml b/tests/auto/qml/qqmlxmlhttprequest/data/invalidMethodUsage.qml
new file mode 100644
index 0000000000..5a4093b9f1
--- /dev/null
+++ b/tests/auto/qml/qqmlxmlhttprequest/data/invalidMethodUsage.qml
@@ -0,0 +1,148 @@
+import QtQuick 2.0
+
+QtObject {
+ property bool readyState: false
+ property bool status: false
+ property bool statusText: false
+ property bool responseText: false
+ property bool responseXML: false
+
+ property bool open: false
+ property bool setRequestHeader: false
+ property bool send: false
+ property bool abort: false
+ property bool getResponseHeader: false
+ property bool getAllResponseHeaders: false
+
+ Component.onCompleted: {
+ var o = 10;
+
+ try {
+ XMLHttpRequest.prototype.readyState
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ readyState = true;
+ }
+ try {
+ XMLHttpRequest.prototype.status
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ status = true;
+ }
+ try {
+ XMLHttpRequest.prototype.statusText
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ statusText = true;
+ }
+ try {
+ XMLHttpRequest.prototype.responseText
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ responseText = true;
+ }
+ try {
+ XMLHttpRequest.prototype.responseXML
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ responseXML = true;
+ }
+
+ try {
+ XMLHttpRequest.prototype.open.call(o);
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ open = true;
+ }
+
+ try {
+ XMLHttpRequest.prototype.setRequestHeader.call(o);
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ setRequestHeader = true;
+ }
+
+ try {
+ XMLHttpRequest.prototype.send.call(o);
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ send = true;
+ }
+
+ try {
+ XMLHttpRequest.prototype.abort.call(o);
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ abort = true;
+ }
+
+ try {
+ XMLHttpRequest.prototype.getResponseHeader.call(o);
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ getResponseHeader = true;
+ }
+
+ try {
+ XMLHttpRequest.prototype.getAllResponseHeaders.call(o);
+ } catch (e) {
+ if (!(e instanceof ReferenceError))
+ return;
+
+ if (e.message != "Not an XMLHttpRequest object")
+ return;
+
+ getAllResponseHeaders = true;
+ }
+ }
+}