diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-08-26 09:31:27 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-08-26 09:31:27 (GMT) |
commit | 69354f37173b7bfcf7ea0f37175a34b8766afcbb (patch) | |
tree | d5d35fbb1c5b93470b6b1aa03c359ac09695055f /tests/auto/qnetworkreply | |
parent | 065610d14fda00057724a46e2649db6bb98aca58 (diff) | |
parent | e5aa5a9d7e97b975316b8cc18554743cccf06474 (diff) | |
download | Qt-69354f37173b7bfcf7ea0f37175a34b8766afcbb.zip Qt-69354f37173b7bfcf7ea0f37175a34b8766afcbb.tar.gz Qt-69354f37173b7bfcf7ea0f37175a34b8766afcbb.tar.bz2 |
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts:
bin/syncqt
src/opengl/qgl.cpp
tools/configure/configureapp.cpp
Diffstat (limited to 'tests/auto/qnetworkreply')
-rw-r--r-- | tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 01d7783..306b5f8 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -289,6 +289,8 @@ private Q_SLOTS: void symbianOpenCDataUrlCrash(); + void qtbug12908compressedHttpReply(); + // NOTE: This test must be last! void parentingRepliesToTheApp(); }; @@ -4274,6 +4276,30 @@ void tst_QNetworkReply::symbianOpenCDataUrlCrash() QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), qint64(598)); } +// TODO: +// Prepare a gzip that has one chunk that expands to the size mentioned in the bugreport. +// Then have a custom HTTP server that waits after this chunk so the returning gets +// triggered. +void tst_QNetworkReply::qtbug12908compressedHttpReply() +{ + QString header("HTTP/1.0 200 OK\r\nContent-Encoding: gzip\r\nContent-Length: 63\r\n\r\n"); + + // dd if=/dev/zero of=qtbug-12908 bs=16384 count=1 && gzip qtbug-12908 && base64 -w 0 qtbug-12908.gz + QString encodedFile("H4sICDdDaUwAA3F0YnVnLTEyOTA4AO3BMQEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAIC3AYbSVKsAQAAA"); + QByteArray decodedFile = QByteArray::fromBase64(encodedFile.toAscii()); + + MiniHttpServer server(header.toAscii() + decodedFile); + server.doClose = true; + + QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); + QNetworkReplyPtr reply = manager.get(request); + + connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(!QTestEventLoop::instance().timeout()); + + QCOMPARE(reply->error(), QNetworkReply::NoError); +} // NOTE: This test must be last testcase in tst_qnetworkreply! |