diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml')
-rw-r--r-- | tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml new file mode 100644 index 0000000000..c98555cd2f --- /dev/null +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml @@ -0,0 +1,27 @@ +import QtQuick 1.0 + +QtObject { + property string reqType + property string url + + property bool dataOK: false + + Component.onCompleted: { + var x = new XMLHttpRequest; + x.open(reqType, url); + x.setRequestHeader("Accept-Language","en-US"); + + // Test to the end + x.onreadystatechange = function() { + if (x.readyState == XMLHttpRequest.DONE) { + if (reqType == "HEAD") + dataOK = (x.responseText == ""); + else + dataOK = (x.responseText == "QML Rocks!\n"); + } + } + + x.send("Data To Ignore"); + } +} + |