diff options
Diffstat (limited to 'tests/auto/declarative/xmlhttprequest/data')
4 files changed, 69 insertions, 0 deletions
diff --git a/tests/auto/declarative/xmlhttprequest/data/redirectError.qml b/tests/auto/declarative/xmlhttprequest/data/redirectError.qml new file mode 100644 index 0000000..6b345cc --- /dev/null +++ b/tests/auto/declarative/xmlhttprequest/data/redirectError.qml @@ -0,0 +1,23 @@ +import Qt 4.6 + +QtObject { + property string url + + property bool dataOK: false + property bool done: false + + Component.onCompleted: { + var x = new XMLHttpRequest; + x.open("GET", url); + + x.onreadystatechange = function() { + if (x.readyState == XMLHttpRequest.DONE) { + done = true; + dataOK = x.status == 404; + } + } + + x.send(); + } +} + diff --git a/tests/auto/declarative/xmlhttprequest/data/redirectRecur.qml b/tests/auto/declarative/xmlhttprequest/data/redirectRecur.qml new file mode 100644 index 0000000..c0321dc --- /dev/null +++ b/tests/auto/declarative/xmlhttprequest/data/redirectRecur.qml @@ -0,0 +1,23 @@ +import Qt 4.6 + +QtObject { + property string url + + property bool dataOK: false + property bool done: false + + Component.onCompleted: { + var x = new XMLHttpRequest; + x.open("GET", url); + + x.onreadystatechange = function() { + if (x.readyState == XMLHttpRequest.DONE) { + done = true; + dataOK = x.status == 302; + } + } + + x.send(); + } +} + diff --git a/tests/auto/declarative/xmlhttprequest/data/redirects.qml b/tests/auto/declarative/xmlhttprequest/data/redirects.qml new file mode 100644 index 0000000..f6fabdb --- /dev/null +++ b/tests/auto/declarative/xmlhttprequest/data/redirects.qml @@ -0,0 +1,22 @@ +import Qt 4.6 + +QtObject { + property string url + + property bool dataOK: false + property bool done: false + + Component.onCompleted: { + var x = new XMLHttpRequest; + x.open("GET", url); + + x.onreadystatechange = function() { + if (x.readyState == XMLHttpRequest.DONE) { + done = true; + dataOK = x.responseText == "Redirected\n"; + } + } + + x.send(); + } +} diff --git a/tests/auto/declarative/xmlhttprequest/data/redirecttarget.html b/tests/auto/declarative/xmlhttprequest/data/redirecttarget.html new file mode 100644 index 0000000..95f35e0 --- /dev/null +++ b/tests/auto/declarative/xmlhttprequest/data/redirecttarget.html @@ -0,0 +1 @@ +Redirected |