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

Unified Diff: net/disk_cache/disk_cache_test_util.cc

Issue 10824336: Run the disk cache tests in scoped temporary directories instead of a fixed directory so that they … (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
Index: net/disk_cache/disk_cache_test_util.cc
===================================================================
--- net/disk_cache/disk_cache_test_util.cc (revision 151735)
+++ net/disk_cache/disk_cache_test_util.cc (working copy)
@@ -16,20 +16,6 @@
using base::Time;
using base::TimeDelta;
-namespace {
-
-FilePath BuildCachePath(const std::string& name) {
- FilePath path;
- PathService::Get(base::DIR_TEMP, &path); // Ignore return value;
- path = path.AppendASCII(name);
- if (!file_util::PathExists(path))
- file_util::CreateDirectory(path);
-
- return path;
-}
-
-} // namespace.
-
std::string GenerateKey(bool same_length) {
char key[200];
CacheTestFillBuffer(key, sizeof(key), same_length);
@@ -55,10 +41,6 @@
buffer[0] = 'g';
}
-FilePath GetCacheFilePath() {
- return BuildCachePath("cache_test");
-}
-
bool CreateCacheTestFile(const FilePath& name) {
int flags = base::PLATFORM_FILE_CREATE_ALWAYS |
base::PLATFORM_FILE_READ |
@@ -91,21 +73,6 @@
return cache->SelfCheck() >= 0;
}
-ScopedTestCache::ScopedTestCache(const FilePath& path) : path_(path) {
- bool result = DeleteCache(path_);
- DCHECK(result);
-}
-
-ScopedTestCache::ScopedTestCache(const std::string& name)
- : path_(BuildCachePath(name)) {
- bool result = DeleteCache(path_);
- DCHECK(result);
-}
-
-ScopedTestCache::~ScopedTestCache() {
- file_util::Delete(path(), true);
-}
-
// -----------------------------------------------------------------------
MessageLoopHelper::MessageLoopHelper()

Powered by Google App Engine
This is Rietveld 408576698