summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-09-01 18:36:14 +0200
committerThiago Macieira <thiago.macieira@nokia.com>2009-09-01 18:36:14 +0200
commite4804c5d3d2e80cc7f57936591374d29478dbb2a (patch)
tree76a85948ed5db925fda81028169e8dcde23b52b4 /tests
parentfc4c4071d6e5704e84a5cca4ae22548bedb7b19d (diff)
parentb2e91ecd641b9c891ea823cfc647f729af6228e8 (diff)
Merge branch '4.5' into 4.6
Conflicts: src/network/access/qnetworkaccessbackend.cpp src/network/access/qnetworkreplyimpl.cpp tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
index fa36845f20..19fa502d61 100644
--- a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
+++ b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
@@ -69,6 +69,8 @@ private slots:
void cacheControl_data();
void cacheControl();
+ void deleteCache();
+
private:
void check();
};
@@ -84,8 +86,8 @@ public:
#ifdef Q_OS_SYMBIAN
QString location = QLatin1String("./cache/");
#else
- QString location = QDesktopServices::storageLocation(QDesktopServices::DataLocation)
- + QLatin1String("/cache/");
+ QString location = QDesktopServices::storageLocation(QDesktopServices::CacheLocation)
+ + QLatin1String("/qnetworkdiskcache/");
#endif
setCacheDirectory(location);
clear();
@@ -275,6 +277,20 @@ void tst_QAbstractNetworkCache::check()
QCOMPARE(diskCache->gotData, fetchFromCache);
}
+void tst_QAbstractNetworkCache::deleteCache()
+{
+ QNetworkAccessManager manager;
+ NetworkDiskCache *diskCache = new NetworkDiskCache(&manager);
+ manager.setCache(diskCache);
+
+ QString url = "httpcachetest_cachecontrol.cgi?max-age=1000";
+ QNetworkRequest request(QUrl(TESTFILE + url));
+ QNetworkReply *reply = manager.get(request);
+ QSignalSpy downloaded1(reply, SIGNAL(finished()));
+ manager.setCache(0);
+ QTRY_COMPARE(downloaded1.count(), 1);
+}
+
QTEST_MAIN(tst_QAbstractNetworkCache)
#include "tst_qabstractnetworkcache.moc"