summaryrefslogtreecommitdiffstats
path: root/tests/auto/qnetworkreply
diff options
context:
space:
mode:
authorPeter Hartmann <peter.hartmann@nokia.com>2011-05-04 11:50:40 (GMT)
committerPeter Hartmann <peter.hartmann@nokia.com>2011-05-04 12:04:11 (GMT)
commit4237c59dba78d80be165ae8dd1691abfc61503b1 (patch)
tree10e63d77fb43d728c48b04d942c52ec2a11fb78a /tests/auto/qnetworkreply
parent1a75d7cde5bf7fb97abb188300e2a56b5b9963bf (diff)
downloadQt-4237c59dba78d80be165ae8dd1691abfc61503b1.zip
Qt-4237c59dba78d80be165ae8dd1691abfc61503b1.tar.gz
Qt-4237c59dba78d80be165ae8dd1691abfc61503b1.tar.bz2
HTTP auto tests: do not load resources from cache that must be revalidtd
The header field "Cache-Control: must-revalidate" is a strict requirement for loading the resource from the server, and not reading it from the cache without revalidating first. With this patch, PreferCache will load such from the network instead of loading them from the cache, and AlwaysCache will throw a ContentNotFound error. Reviewed-by: Markus Goetz Task-number: QTBUG-18983
Diffstat (limited to 'tests/auto/qnetworkreply')
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index f509cea..bf1feaf 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -3237,16 +3237,16 @@ void tst_QNetworkReply::ioGetFromHttpWithCache_data()
QTest::newRow("must-revalidate,200,prefer-network")
<< reply200 << "Reloaded" << content << int(QNetworkRequest::PreferNetwork) << QStringList() << false << true;
QTest::newRow("must-revalidate,200,prefer-cache")
- << reply200 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << true << false;
+ << reply200 << "Reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << false << true;
QTest::newRow("must-revalidate,200,always-cache")
- << reply200 << "Not-reloaded" << content << int(QNetworkRequest::AlwaysCache) << QStringList() << true << false;
+ << reply200 << "" << content << int(QNetworkRequest::AlwaysCache) << QStringList() << false << false;
QTest::newRow("must-revalidate,304,prefer-network")
<< reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferNetwork) << QStringList() << true << true;
QTest::newRow("must-revalidate,304,prefer-cache")
- << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << true << false;
+ << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << true << true;
QTest::newRow("must-revalidate,304,always-cache")
- << reply304 << "Not-reloaded" << content << int(QNetworkRequest::AlwaysCache) << QStringList() << true << false;
+ << reply304 << "" << content << int(QNetworkRequest::AlwaysCache) << QStringList() << false << false;
//
// Partial content