summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/examples/tst_examples.cpp5
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/http/exists.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/http/exists1.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/http/exists2.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/http/exists3.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/http/exists4.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/data/http/exists5.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro6
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp30
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_PUT.expect2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml1
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp6
42 files changed, 65 insertions, 29 deletions
diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp
index dfcc9c0..abb2b93 100644
--- a/tests/auto/declarative/examples/tst_examples.cpp
+++ b/tests/auto/declarative/examples/tst_examples.cpp
@@ -293,8 +293,11 @@ void tst_examples::examples()
sync.waitForFinished();
- for (int ii = 0; ii < tests.count(); ++ii)
+ for (int ii = 0; ii < tests.count(); ++ii) {
+ if (tests.at(ii).result != Example::Pass)
+ qWarning() << tests.at(ii).file << ":failed";
QVERIFY(tests.at(ii).result == Example::Pass);
+ }
#else
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists.png
new file mode 100644
index 0000000..399bd0b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists1.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists1.png
new file mode 100644
index 0000000..399bd0b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists1.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists2.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists2.png
new file mode 100644
index 0000000..399bd0b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists2.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists3.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists3.png
new file mode 100644
index 0000000..399bd0b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists3.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists4.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists4.png
new file mode 100644
index 0000000..399bd0b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists4.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists5.png b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists5.png
new file mode 100644
index 0000000..399bd0b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepixmapcache/data/http/exists5.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro
index b5b033a..4b247fc 100644
--- a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro
+++ b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro
@@ -5,6 +5,12 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativepixmapcache.cpp
+INCLUDEPATH += ../shared/
+HEADERS += ../shared/testhttpserver.h
+SOURCES += ../shared/testhttpserver.cpp
+
+DEFINES += SRCDIR=\\\"$$PWD\\\"
+
# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage
# LIBS += -lgcov
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp
index 223f54f..f2ccf80 100644
--- a/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp
+++ b/tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp
@@ -43,6 +43,8 @@
#include <private/qdeclarativepixmapcache_p.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QNetworkReply>
+#include "testhttpserver.h"
+#include "../../../shared/util.h"
// These don't let normal people run tests!
//#include "../network-settings.h"
@@ -52,8 +54,10 @@ class tst_qdeclarativepixmapcache : public QObject
Q_OBJECT
public:
tst_qdeclarativepixmapcache() :
- thisfile(QUrl::fromLocalFile(__FILE__))
+ thisfile(QUrl::fromLocalFile(__FILE__)),
+ server(14452)
{
+ server.serveDirectory(SRCDIR "/data/http");
}
private slots:
@@ -65,6 +69,7 @@ private slots:
private:
QDeclarativeEngine engine;
QUrl thisfile;
+ TestHTTPServer server;
};
@@ -110,8 +115,8 @@ void tst_qdeclarativepixmapcache::single_data()
// File URLs are optimized
QTest::newRow("local") << thisfile.resolved(QUrl("data/exists.png")) << localfile_optimized << true << false;
QTest::newRow("local") << thisfile.resolved(QUrl("data/notexists.png")) << localfile_optimized << false << false;
- QTest::newRow("remote") << QUrl("http://qt.nokia.com/logo.png") << false << true << false;
- QTest::newRow("remote") << QUrl("http://qt.nokia.com/thereisnologo.png") << false << false << true;
+ QTest::newRow("remote") << QUrl("http://127.0.0.1:14452/exists.png") << false << true << false;
+ QTest::newRow("remote") << QUrl("http://127.0.0.1:14452/notexists.png") << false << false << true;
}
void tst_qdeclarativepixmapcache::single()
@@ -122,7 +127,7 @@ void tst_qdeclarativepixmapcache::single()
QFETCH(bool, neterror);
if (neterror) {
- QString expected = "\"Error downloading " + target.toString() + " - server replied: Not Found\" ";
+ QString expected = "\"Error downloading " + target.toString() + " - server replied: Not found\" ";
QTest::ignoreMessage(QtWarningMsg, expected.toLatin1());
} else if (!exists) {
QString expected = "Cannot open QUrl( \"" + target.toString() + "\" ) ";
@@ -183,32 +188,32 @@ void tst_qdeclarativepixmapcache::parallel_data()
;
QTest::newRow("remote")
- << QUrl("http://qt.nokia.com/images/template/checkbox-on.png")
- << QUrl("http://qt.nokia.com/images/products/qt-logo/image_tile")
+ << QUrl("http://127.0.0.1:14452/exists2.png")
+ << QUrl("http://127.0.0.1:14452/exists3.png")
<< 0
<< -1
<< 2
;
QTest::newRow("remoteagain")
- << QUrl("http://qt.nokia.com/images/template/checkbox-on.png")
- << QUrl("http://qt.nokia.com/images/products/qt-logo/image_tile")
+ << QUrl("http://127.0.0.1:14452/exists2.png")
+ << QUrl("http://127.0.0.1:14452/exists3.png")
<< 2
<< -1
<< 0
;
QTest::newRow("remotecopy")
- << QUrl("http://qt.nokia.com/images/template/checkbox-off.png")
- << QUrl("http://qt.nokia.com/images/template/checkbox-off.png")
+ << QUrl("http://127.0.0.1:14452/exists4.png")
+ << QUrl("http://127.0.0.1:14452/exists4.png")
<< 0
<< -1
<< 1
;
QTest::newRow("remotecopycancel")
- << QUrl("http://qt.nokia.com/rounded_block_bg.png")
- << QUrl("http://qt.nokia.com/rounded_block_bg.png")
+ << QUrl("http://127.0.0.1:14452/exists5.png")
+ << QUrl("http://127.0.0.1:14452/exists5.png")
<< 0
<< 0
<< 1
@@ -233,6 +238,7 @@ void tst_qdeclarativepixmapcache::parallel()
QPixmap pixmap;
QDeclarativePixmapReply::Status status = QDeclarativePixmapCache::get(target, &pixmap);
QDeclarativePixmapReply *reply = 0;
+ QVERIFY(status != QDeclarativePixmapReply::Error);
if (status != QDeclarativePixmapReply::Error && status != QDeclarativePixmapReply::Ready)
reply = QDeclarativePixmapCache::request(&engine, target);
replies.append(reply);
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect
index f43e043..4d21122 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect
@@ -1,9 +1,9 @@
PUT /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
Content-Type: text/plain;charset=UTF-8
Content-Length: 9
Connection: Keep-Alive
Accept-Encoding: gzip
-Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml
index d7b9266..729793e 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml
@@ -13,6 +13,7 @@ QtObject {
var x = new XMLHttpRequest;
x.open("GET", urlDummy);
x.setRequestHeader("Test-header", "TestValue");
+ x.setRequestHeader("Accept-Language", "en-US");
x.send();
x.onreadystatechange = function() {
@@ -35,6 +36,7 @@ QtObject {
}
}
x.open("PUT", url);
+ x.setRequestHeader("Accept-Language", "en-US");
x.send("Test Data");
}
}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml
index 72a45e7..33ca020 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml
@@ -21,10 +21,12 @@ QtObject {
readyState = true;
x.open("PUT", url);
+ x.setRequestHeader("Accept-Language", "en-US");
x.abort();
x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
if (x.readyState == XMLHttpRequest.OPENED)
openedState = true;
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml
index aa78cde..c0957ed 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml
@@ -21,6 +21,7 @@ QtObject {
readyState = true;
x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
if (x.readyState == XMLHttpRequest.OPENED)
openedState = true;
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml
index 8d67fad..9096999 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml
@@ -31,6 +31,7 @@ QtObject {
readyState = true;
x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
if (x.readyState == XMLHttpRequest.OPENED)
openedState = true;
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect
index a740c79..c6cad70 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect
@@ -1,7 +1,7 @@
GET /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
Connection: Keep-Alive
Accept-Encoding: gzip
-Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml
index 2f949e1..7a65e25 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml
@@ -37,6 +37,7 @@ QtObject {
readyState = true;
x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
if (x.readyState == XMLHttpRequest.OPENED)
openedState = true;
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml
index c06bae3..72fb9d7 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml
@@ -20,6 +20,7 @@ QtObject {
readyState = true;
x.open("GET", url);
+ x.setRequestHeader("Accept-Language","en-US");
if (x.readyState == XMLHttpRequest.OPENED)
openedState = true;
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect
index a740c79..c6cad70 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect
@@ -1,7 +1,7 @@
GET /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
Connection: Keep-Alive
Accept-Encoding: gzip
-Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml
index 19e37fa..b07f8e7 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml
@@ -20,6 +20,7 @@ QtObject {
readyState = true;
x.open("GET", url, true, "username", "password");
+ x.setRequestHeader("Accept-Language","en-US");
if (x.readyState == XMLHttpRequest.OPENED)
openedState = true;
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml
index 4bb3a7a..9fa4847 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml
@@ -22,6 +22,7 @@ QtObject {
unsent = (x.responseText == "");
x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
opened = (x.responseText == "");
@@ -39,6 +40,7 @@ QtObject {
dataOK = (x.responseText == expectedText);
x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
reset = (x.responseText == "");
}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml
index 0bad7df..a9ef3e8 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml
@@ -7,6 +7,7 @@ QtObject {
Component.onCompleted: {
var x = new XMLHttpRequest;
x.open("GET", "testdocument.html");
+ x.setRequestHeader("Accept-Language","en-US");
// Test to the end
x.onreadystatechange = function() {
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect
index 81dd4a0..2effbdc 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect
@@ -1,9 +1,9 @@
POST /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
Content-Type: text/plain;charset=UTF-8
Content-Length: 12
Connection: Keep-Alive
Accept-Encoding: gzip
-Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml
index 03543a9..171e0b1 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml
@@ -8,6 +8,7 @@ QtObject {
Component.onCompleted: {
var x = new XMLHttpRequest;
x.open("POST", url);
+ x.setRequestHeader("Accept-Language","en-US");
// Test to the end
x.onreadystatechange = function() {
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml
index 79a27b6..09b742b 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml
@@ -9,6 +9,7 @@ QtObject {
var x = new XMLHttpRequest;
x.open("POST", url);
x.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
+ x.setRequestHeader("Accept-Language","en-US");
// Test to the end
x.onreadystatechange = function() {
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml
index e048769..8786917 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml
@@ -9,6 +9,7 @@ QtObject {
var x = new XMLHttpRequest;
x.open("POST", url);
x.setRequestHeader("Content-Type", "text/plain;charset=latin1");
+ x.setRequestHeader("Accept-Language","en-US");
// Test to the end
x.onreadystatechange = function() {
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect
index 8fcf3ac..8336860 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect
@@ -1,9 +1,9 @@
POST /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
Content-Type: charset=UTF-8;text/plain
Content-Length: 12
Connection: Keep-Alive
Accept-Encoding: gzip
-Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml
index 7ab0b27..6789480 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml
@@ -9,6 +9,7 @@ QtObject {
var x = new XMLHttpRequest;
x.open("POST", url);
x.setRequestHeader("Content-Type", "charset=UTF-8;text/plain");
+ x.setRequestHeader("Accept-Language","en-US");
// Test to the end
x.onreadystatechange = function() {
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml
index 29bf2c2..08d999d 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml
@@ -9,6 +9,7 @@ QtObject {
var x = new XMLHttpRequest;
x.open("POST", url);
x.setRequestHeader("Content-Type", "charset=latin1;text/plain");
+ x.setRequestHeader("Accept-Language","en-US");
// Test to the end
x.onreadystatechange = function() {
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect
index 97e6fac..4f10bbc 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect
@@ -1,9 +1,9 @@
PUT /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
Content-Type: text/plain;charset=UTF-8
Content-Length: 12
Connection: Keep-Alive
Accept-Encoding: gzip
-Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml
index 135f45c..e047fc8 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml
@@ -8,6 +8,7 @@ QtObject {
Component.onCompleted: {
var x = new XMLHttpRequest;
x.open("PUT", url);
+ x.setRequestHeader("Accept-Language","en-US");
// Test to the end
x.onreadystatechange = function() {
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml
index 4a09527..ba0db25 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml
@@ -9,6 +9,7 @@ QtObject {
var x = new XMLHttpRequest;
x.open("POST", url);
x.setRequestHeader("Content-Type", "text/plain");
+ x.setRequestHeader("Accept-Language","en-US");
// Test to the end
x.onreadystatechange = function() {
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml
index dd5fa46..ddf520e 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml
@@ -9,6 +9,7 @@ QtObject {
Component.onCompleted: {
var x = new XMLHttpRequest;
x.open(reqType, url);
+ x.setRequestHeader("Accept-Language","en-US");
// Test to the end
x.onreadystatechange = function() {
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect
index a740c79..c6cad70 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect
@@ -1,7 +1,7 @@
GET /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
Connection: Keep-Alive
Accept-Encoding: gzip
-Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_PUT.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_PUT.expect
index 991bd59..74a9798 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_PUT.expect
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_PUT.expect
@@ -1,7 +1,7 @@
HEAD /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
Connection: Keep-Alive
Accept-Encoding: gzip
-Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect
index 4600f2a..7b8e260 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect
@@ -1,9 +1,9 @@
GET /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
TEST-HEADER: value
TEST-HEADER2: value,value2
Connection: Keep-Alive
Accept-Encoding: gzip
-Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml
index b0723aa..61eea33 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml
@@ -9,6 +9,7 @@ QtObject {
var x = new XMLHttpRequest;
x.open("GET", url);
+ x.setRequestHeader("Accept-Language","en-US");
x.setRequestHeader("Test-header", "value");
x.setRequestHeader("Test-header2", "value");
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml
index bf31eca..b22b239 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml
@@ -21,6 +21,7 @@ QtObject {
readyState = true;
x.open("GET", url);
+ x.setRequestHeader("Accept-Language","en-US");
x.setRequestHeader(header, "Value");
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml
index c2bbc6e..666c791 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml
@@ -10,6 +10,7 @@ QtObject {
var x = new XMLHttpRequest;
x.open("GET", url);
+ x.setRequestHeader("Accept-Language","en-US");
// Test to the end
x.onreadystatechange = function() {
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect
index a740c79..c6cad70 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect
@@ -1,7 +1,7 @@
GET /testdocument.html HTTP/1.1
+ACCEPT-LANGUAGE: en-US
Connection: Keep-Alive
Accept-Encoding: gzip
-Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml
index 04202c4..c903e12 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml
@@ -27,6 +27,7 @@ QtObject {
}
x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
try {
var a = x.status;
@@ -54,6 +55,7 @@ QtObject {
}
x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
try {
var a = x.status;
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml
index 8becc3b..a3b98be 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml
@@ -27,6 +27,7 @@ QtObject {
}
x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
try {
var a = x.statusText;
@@ -54,6 +55,7 @@ QtObject {
}
x.open("GET", url);
+ x.setRequestHeader("Accept-Language", "en-US");
try {
var a = x.statusText;
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp b/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp
index 13ed959..1d26f2c 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp
@@ -55,12 +55,6 @@ public:
tst_qdeclarativexmlhttprequest() {}
private slots:
- void initTestCase() {
- if (QLocale::system().name().replace(QChar::fromAscii('_'),QChar::fromAscii('-')) != QLatin1String("en-US")) {
- qWarning() << "Test will fail unless LANG is en_US";
- }
- }
-
void domExceptionCodes();
void callbackException();
void callbackException_data();