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

Unified Diff: net/disk_cache/disk_cache_test_util.cc

Issue 2891022: Disk cache: Read the index and data_0 files in a single... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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 52189)
+++ net/disk_cache/disk_cache_test_util.cc (working copy)
@@ -77,6 +77,20 @@
return true;
}
+bool CopyTestCache(const std::string& name) {
+ FilePath path;
+ PathService::Get(base::DIR_SOURCE_ROOT, &path);
+ path = path.AppendASCII("net");
+ path = path.AppendASCII("data");
+ path = path.AppendASCII("cache_tests");
+ path = path.AppendASCII(name);
+
+ FilePath dest = GetCacheFilePath();
+ if (!DeleteCache(dest))
+ return false;
+ return file_util::CopyDirectory(path, dest, false);
+}
+
bool CheckCacheIntegrity(const FilePath& path, bool new_eviction) {
scoped_ptr<disk_cache::BackendImpl> cache(new disk_cache::BackendImpl(
path, base::MessageLoopProxy::CreateForCurrentThread()));
« net/disk_cache/disk_cache_test_util.h ('K') | « 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