aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@nokia.com>2012-04-18 14:55:02 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-01 06:06:51 +0200
commit0949071f13e7bcbc16a0f07f496e0b6a23b04edd (patch)
tree26aba383a6484a455874cb9d8b0f561598e51ae3 /tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
parente39908c658c6caa2013bc7356eb904b669af1bfb (diff)
Keep XMLHttpRequest response data after receiving a server error
Fix XMLHttpRequest.responseText being set to empty string whenever a server status code other than '200/OK' is received. XMLHttpRequest specification says that response entity body is to be returned unless the error flag is set, and the flag is set only in case of abort() or network error. This change enables clients to receive additional error information the server may return in the response body. http://www.w3.org/TR/XMLHttpRequest/#the-responsetext-attribute Task-number: QTBUG-21706 Change-Id: I7e44f481494dc7eddea3868d6f92ee45d7ab0c69 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com> Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp')
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
index f8d74c3cde..7a65308b6e 100644
--- a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
+++ b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
@@ -937,8 +937,8 @@ void tst_qqmlxmlhttprequest::responseText_data()
QTest::newRow("OK") << testFileUrl("status.200.reply") << testFileUrl("testdocument.html") << "QML Rocks!\n";
QTest::newRow("empty body") << testFileUrl("status.200.reply") << QUrl() << "";
- QTest::newRow("Not Found") << testFileUrl("status.404.reply") << testFileUrl("testdocument.html") << "";
- QTest::newRow("Bad Request") << testFileUrl("status.404.reply") << testFileUrl("testdocument.html") << "";
+ QTest::newRow("Not Found") << testFileUrl("status.404.reply") << testFileUrl("testdocument.html") << "QML Rocks!\n";
+ QTest::newRow("Bad Request") << testFileUrl("status.400.reply") << testFileUrl("testdocument.html") << "QML Rocks!\n";
}
void tst_qqmlxmlhttprequest::nonUtf8()