aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlxmlhttprequest/data/callbackException.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlxmlhttprequest/data/callbackException.qml')
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/data/callbackException.qml25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/callbackException.qml b/tests/auto/qml/qqmlxmlhttprequest/data/callbackException.qml
new file mode 100644
index 0000000000..ee1043f97f
--- /dev/null
+++ b/tests/auto/qml/qqmlxmlhttprequest/data/callbackException.qml
@@ -0,0 +1,25 @@
+import QtQuick 2.0
+
+QtObject {
+ id: obj
+ property string url
+ property string which
+ property bool threw: false
+
+ onWhichChanged: {
+ var x = new XMLHttpRequest;
+
+ x.onreadystatechange = function() {
+ if (x.readyState == which) {
+ obj.threw = true
+ throw(new Error("Exception from Callback"))
+ }
+ }
+
+ x.open("GET", url);
+ x.setRequestHeader("Test-header", "TestValue");
+ x.send();
+ }
+}
+
+