diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-02-02 12:49:27 +1000 |
---|---|---|
committer | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-02-02 06:29:02 +0100 |
commit | c88dbd8f6d247352dc13b78576950dc888dd2d97 (patch) | |
tree | c0573020c14806c5f0f794e3c83cec9b462ea55b /tests | |
parent | b9fd262ee0040cbddb1a87d15335372054881122 (diff) | |
download | qtquick1-c88dbd8f6d247352dc13b78576950dc888dd2d97.tar.gz |
Fix QDeclarativeXmlHttpRequest test failures.
Add deflate to accepted encodings in line with added support in
QNetworkAccessManager, ensure instances of TestHTTPServer are
destroyed if a test fails so they don't interfere with subsequent
tests, and don't return any data for a HEAD request.
Change-Id: If3d01dc1fa955282f9ab9423abb5baf69a6df2ff
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
Diffstat (limited to 'tests')
11 files changed, 17 insertions, 18 deletions
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect index 4d211225..3ed1f7f3 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect @@ -3,7 +3,7 @@ ACCEPT-LANGUAGE: en-US Content-Type: text/plain;charset=UTF-8 Content-Length: 9 Connection: Keep-Alive -Accept-Encoding: gzip +Accept-Encoding: gzip, deflate User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect index c6cad706..4d940c29 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-Encoding: gzip, deflate User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect index c6cad706..4d940c29 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-Encoding: gzip, deflate User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect index 2effbdcc..98dbbdcb 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect @@ -3,7 +3,7 @@ ACCEPT-LANGUAGE: en-US Content-Type: text/plain;charset=UTF-8 Content-Length: 12 Connection: Keep-Alive -Accept-Encoding: gzip +Accept-Encoding: gzip, deflate User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect index 83368607..5f71adfe 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect @@ -3,7 +3,7 @@ ACCEPT-LANGUAGE: en-US Content-Type: charset=UTF-8;text/plain Content-Length: 12 Connection: Keep-Alive -Accept-Encoding: gzip +Accept-Encoding: gzip, deflate User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect index 4f10bbc6..144283aa 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect @@ -3,7 +3,7 @@ ACCEPT-LANGUAGE: en-US Content-Type: text/plain;charset=UTF-8 Content-Length: 12 Connection: Keep-Alive -Accept-Encoding: gzip +Accept-Encoding: gzip, deflate User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect index c6cad706..4d940c29 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-Encoding: gzip, deflate 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_HEAD.expect index 74a97981..cf13b54f 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_PUT.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_HEAD.expect @@ -1,7 +1,7 @@ HEAD /testdocument.html HTTP/1.1 ACCEPT-LANGUAGE: en-US Connection: Keep-Alive -Accept-Encoding: gzip +Accept-Encoding: gzip, deflate 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 7b8e260f..cd134437 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect @@ -3,7 +3,7 @@ ACCEPT-LANGUAGE: en-US TEST-HEADER: value TEST-HEADER2: value,value2 Connection: Keep-Alive -Accept-Encoding: gzip +Accept-Encoding: gzip, deflate User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect index c6cad706..4d940c29 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-Encoding: gzip, deflate User-Agent: Mozilla/5.0 Host: 127.0.0.1:14445 diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp b/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp index 3fbda081..111c3c9c 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp @@ -257,9 +257,9 @@ void tst_qdeclarativexmlhttprequest::open() QFETCH(QString, url); QFETCH(bool, remote); - TestHTTPServer *server = 0; + QScopedPointer<TestHTTPServer> server; if (remote) { - server = new TestHTTPServer(SERVER_PORT); + server.reset(new TestHTTPServer(SERVER_PORT)); QVERIFY(server->isValid()); QVERIFY(server->wait(TEST_FILE("open_network.expect"), TEST_FILE("open_network.reply"), @@ -281,7 +281,6 @@ void tst_qdeclarativexmlhttprequest::open() QTRY_VERIFY(object->property("dataOK").toBool() == true); - delete server; delete object; } @@ -502,8 +501,8 @@ void tst_qdeclarativexmlhttprequest::send_ignoreData() { TestHTTPServer server(SERVER_PORT); QVERIFY(server.isValid()); - QVERIFY(server.wait(TEST_FILE("send_ignoreData_GET.expect"), - TEST_FILE("send_ignoreData.reply"), + QVERIFY(server.wait(TEST_FILE("send_ignoreData_GET.expect"), + TEST_FILE("send_ignoreData.reply"), TEST_FILE("testdocument.html"))); QDeclarativeComponent component(&engine, TEST_FILE("send_ignoreData.qml")); @@ -521,9 +520,9 @@ void tst_qdeclarativexmlhttprequest::send_ignoreData() { TestHTTPServer server(SERVER_PORT); QVERIFY(server.isValid()); - QVERIFY(server.wait(TEST_FILE("send_ignoreData_PUT.expect"), - TEST_FILE("send_ignoreData.reply"), - TEST_FILE("testdocument.html"))); + QVERIFY(server.wait(TEST_FILE("send_ignoreData_HEAD.expect"), + TEST_FILE("send_ignoreData.reply"), + QUrl())); QDeclarativeComponent component(&engine, TEST_FILE("send_ignoreData.qml")); QObject *object = component.beginCreate(engine.rootContext()); |