diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp index e338075..ee49210 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(); }; @@ -269,6 +271,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" |