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

Unified Diff: net/disk_cache/disk_cache_test_util.cc

Issue 127083002: **STILLBAKING** Decouple disk cache tests from backends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: upstream rebase Created 6 years, 10 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') | net/disk_cache/entry_sync_tests.h » ('j') | 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 2b23ee4d8bfad701e5d9f5141168afcf8b193579..9d36c13b8061c1ae4288190aef41e1a8cd6c12c5 100644
--- a/net/disk_cache/disk_cache_test_util.cc
+++ b/net/disk_cache/disk_cache_test_util.cc
@@ -46,12 +46,11 @@ bool CreateCacheTestFile(const base::FilePath& name) {
base::PLATFORM_FILE_READ |
base::PLATFORM_FILE_WRITE;
- scoped_refptr<disk_cache::File> file(new disk_cache::File(
- base::CreatePlatformFile(name, flags, NULL, NULL)));
- if (!file->IsValid())
+ base::PlatformFile file = base::CreatePlatformFile(name, flags, NULL, NULL);
+ if (file == base::kInvalidPlatformFileValue)
return false;
- file->SetLength(4 * 1024 * 1024);
+ base::TruncatePlatformFile(file, 4 * 1024 * 1024);
return true;
}
@@ -60,20 +59,6 @@ bool DeleteCache(const base::FilePath& path) {
return true;
}
-bool CheckCacheIntegrity(const base::FilePath& path, bool new_eviction,
- uint32 mask) {
- scoped_ptr<disk_cache::BackendImpl> cache(new disk_cache::BackendImpl(
- path, mask, base::MessageLoopProxy::current().get(), NULL));
- if (!cache.get())
- return false;
- if (new_eviction)
- cache->SetNewEviction();
- cache->SetFlags(disk_cache::kNoRandom);
- if (cache->SyncInit() != net::OK)
- return false;
- return cache->SelfCheck() >= 0;
-}
-
// -----------------------------------------------------------------------
MessageLoopHelper::MessageLoopHelper()
« no previous file with comments | « net/disk_cache/disk_cache_test_util.h ('k') | net/disk_cache/entry_sync_tests.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698