summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-08-24 07:51:33 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-08-24 07:51:33 (GMT)
commit76680eff3fbbdaace80bdb89f68e678c4c99e492 (patch)
tree96de0b65349401490c4ca961a4d17499ae579cb6
parent180fdc19835d38962ada5e6d76f7c928082b6ebc (diff)
parentd38eb22b9f5b408d67ea0244e45c13d6d0665d8d (diff)
downloadQt-76680eff3fbbdaace80bdb89f68e678c4c99e492.zip
Qt-76680eff3fbbdaace80bdb89f68e678c4c99e492.tar.gz
Qt-76680eff3fbbdaace80bdb89f68e678c4c99e492.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QNAM HTTP: Prepare a compression auto test related to a future bugfix
-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 ca563ef..2ff02d4 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -281,6 +281,8 @@ private Q_SLOTS:
void symbianOpenCDataUrlCrash();
+ void qtbug12908compressedHttpReply();
+
// NOTE: This test must be last!
void parentingRepliesToTheApp();
};
@@ -4171,6 +4173,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!