summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-08-26 23:34:59 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-08-26 23:34:59 (GMT)
commitbe9968c0ee3943c7cc169b4ad8e36155b06bf620 (patch)
treefd39afb623d7a787a42f71f148ebd051fdd51a14 /tests
parentd477cc1498ccf2204dd0e5cd6676f5c0788a9090 (diff)
parentef4c65fc364a0262389c0497092a0fa5e1f7d4c3 (diff)
downloadQt-be9968c0ee3943c7cc169b4ad8e36155b06bf620.zip
Qt-be9968c0ee3943c7cc169b4ad8e36155b06bf620.tar.gz
Qt-be9968c0ee3943c7cc169b4ad8e36155b06bf620.tar.bz2
Merge branch '4.7' of git://scm.dev.nokia.troll.no/qt/qt into 4.7
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp26
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!