diff options
Diffstat (limited to 'tests/auto/qml/qqmlxmlhttprequest/data/responseURL.qml')
-rw-r--r-- | tests/auto/qml/qqmlxmlhttprequest/data/responseURL.qml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/responseURL.qml b/tests/auto/qml/qqmlxmlhttprequest/data/responseURL.qml new file mode 100644 index 0000000000..3a35dcc882 --- /dev/null +++ b/tests/auto/qml/qqmlxmlhttprequest/data/responseURL.qml @@ -0,0 +1,21 @@ +import QtQuick 2.0 + +QtObject { + property string url + property string expectedURL + + property bool dataOK: false + + Component.onCompleted: { + var x = new XMLHttpRequest; + x.open("GET", url); + + // Test to the end + x.onreadystatechange = function() { + if (x.readyState === XMLHttpRequest.DONE) + dataOK = (x.responseURL === expectedURL); + } + + x.send() + } +} |