diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml')
-rw-r--r-- | tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml new file mode 100644 index 00000000..fd1c4247 --- /dev/null +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml @@ -0,0 +1,28 @@ +import QtQuick 1.0 + +QtObject { + property bool dataOK: false + property bool test: false + + Component.onCompleted: { + var x = new XMLHttpRequest; + x.open("GET", "testdocument.html"); + x.setRequestHeader("Accept-Language","en-US"); + + // Test to the end + x.onreadystatechange = function() { + if (x.readyState == XMLHttpRequest.DONE) { + dataOK = (x.responseText == "QML Rocks!\n"); + } + } + + x.send(); + + try { + x.send() + } catch (e) { + if (e.code == DOMException.INVALID_STATE_ERR) + test = true; + } + } +} |