diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-11-10 02:10:57 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-11-10 02:10:57 (GMT) |
commit | cdabdb79808b3788519fa3bde0d240f2b11a4b34 (patch) | |
tree | e296059c6332d73ae2c55caf7dd2026316a6dc54 /tests/auto/declarative/xmlhttprequest/data/send_alreadySent.qml | |
parent | fc5fd47fc7e7d87d17386e23690af4fec80dae05 (diff) | |
download | Qt-cdabdb79808b3788519fa3bde0d240f2b11a4b34.zip Qt-cdabdb79808b3788519fa3bde0d240f2b11a4b34.tar.gz Qt-cdabdb79808b3788519fa3bde0d240f2b11a4b34.tar.bz2 |
More XMLHttpRequest tests
Diffstat (limited to 'tests/auto/declarative/xmlhttprequest/data/send_alreadySent.qml')
-rw-r--r-- | tests/auto/declarative/xmlhttprequest/data/send_alreadySent.qml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/declarative/xmlhttprequest/data/send_alreadySent.qml b/tests/auto/declarative/xmlhttprequest/data/send_alreadySent.qml new file mode 100644 index 0000000..4598169 --- /dev/null +++ b/tests/auto/declarative/xmlhttprequest/data/send_alreadySent.qml @@ -0,0 +1,27 @@ +import Qt 4.6 + +Object { + property bool dataOK: false + property bool test: false + + Component.onCompleted: { + var x = new XMLHttpRequest; + x.open("GET", "testdocument.html"); + + // 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; + } + } +} |