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/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp | |
parent | b9fd262ee0040cbddb1a87d15335372054881122 (diff) |
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/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
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()); |