diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-16 18:53:12 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-16 18:53:12 +0000 |
commit | 39eee12e58ed3ffe2986888acacaa7fcc746a53f (patch) | |
tree | 24bdf9b16fd33e11a614360f61013226e28b5d44 /net/disk_cache/disk_cache_test_util.cc | |
parent | 611cad45a3bc67189d273eaba0171b96f7bdbd97 (diff) | |
download | chromium_src-39eee12e58ed3ffe2986888acacaa7fcc746a53f.zip chromium_src-39eee12e58ed3ffe2986888acacaa7fcc746a53f.tar.gz chromium_src-39eee12e58ed3ffe2986888acacaa7fcc746a53f.tar.bz2 |
Make sure that net_perftest doesn't leave temporary files.
BUG=8580
Review URL: http://codereview.chromium.org/48003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11753 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/disk_cache_test_util.cc')
-rw-r--r-- | net/disk_cache/disk_cache_test_util.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/disk_cache/disk_cache_test_util.cc b/net/disk_cache/disk_cache_test_util.cc index 9a15209..555b2e5 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; |