Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: net/disk_cache/disk_cache_test_util.cc

Issue 48003: Make sure that net_perftest doesn't leave temporary files. (Closed)
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/disk_cache_test_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/disk_cache_test_util.cc
diff --git a/net/disk_cache/disk_cache_test_util.cc b/net/disk_cache/disk_cache_test_util.cc
index 9a15209eb4cf7acf618dadc09c8d8021ad276a8d..555b2e58eaa91b9af70b8bf70a08aa95ecee54ac 100644
--- a/net/disk_cache/disk_cache_test_util.cc
+++ b/net/disk_cache/disk_cache_test_util.cc
@@ -4,6 +4,7 @@
#include "net/disk_cache/disk_cache_test_util.h"
+#include "base/logging.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "net/disk_cache/backend_impl.h"
@@ -77,6 +78,15 @@ bool CheckCacheIntegrity(const std::wstring& path) {
return cache->SelfCheck() >= 0;
}
+ScopedTestCache::ScopedTestCache() : path_(GetCachePath()) {
+ bool result = DeleteCache(path_.c_str());
+ DCHECK(result);
+}
+
+ScopedTestCache::~ScopedTestCache() {
+ file_util::Delete(path(), true);
+}
+
// -----------------------------------------------------------------------
int g_cache_tests_max_id = 0;
« no previous file with comments | « net/disk_cache/disk_cache_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698