tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml
changeset 30 5dc02b23752f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml	Tue Jul 06 15:10:48 2010 +0300
@@ -0,0 +1,25 @@
+import Qt 4.7
+
+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();
+    }
+}
+
+