diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml')
-rw-r--r-- | tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml new file mode 100644 index 0000000..9255922 --- /dev/null +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml @@ -0,0 +1,25 @@ +import Qt 4.6 + +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(); + } +} + + |