diff options
author | Shane Kearns <ext-shane.2.kearns@nokia.com> | 2012-03-05 14:09:04 +0000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-06 18:24:01 +0100 |
commit | 299e7ffd6a8a91f1d4259b91d4a519c1933c5f33 (patch) | |
tree | 9f4d177085ae8d82b652df63d3c099365bf88af8 /tests/auto/network | |
parent | 2cf8e487a5c546382daaa954c23d3926668b0a85 (diff) |
Fix QNetworkReply ioGetFromHttpWithCache test case
Expiration date is calculated from max-age header when a response is
inserted into the cache. Because the test case is prepopulating the
cache outside of QNAM's control, the expiration date was uninitialised,
causing the test to fail.
This is due to a 2 year old change in QNAM, where max age calculation was
removed from cache retrieval, and more recent changes to QDateTime
where secsTo() returns 0 if one of the arguments is invalid.
Change-Id: Ieecd46123dde4ca0fd0be3ae79e70e1528ec02bc
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
Diffstat (limited to 'tests/auto/network')
-rw-r--r-- | tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index d8f9bf32ad..00b3fd1973 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -3385,6 +3385,7 @@ void tst_QNetworkReply::ioGetFromHttpWithCache_data() << QNetworkCacheMetaData::RawHeader("Cache-control", "max-age=0"); // isn't used in cache loading content.first.setRawHeaders(rawHeaders); content.first.setLastModified(past); + content.first.setExpirationDate(past); QTest::newRow("expired,200,prefer-network") << reply200 << "Reloaded" << content << int(QNetworkRequest::PreferNetwork) << QStringList() << false << true; |