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

Unified Diff: net/disk_cache/flash/flash_cache_test_base.cc

Issue 14265009: FlashCache refactorings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More refactorings. Created 7 years, 8 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/flash/flash_cache_test_base.h ('k') | net/disk_cache/flash/flash_entry_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/flash/flash_cache_test_base.cc
diff --git a/net/disk_cache/flash/flash_cache_test_base.cc b/net/disk_cache/flash/flash_cache_test_base.cc
index b31c49930434d83c19d899f44e8eda0646306282..17ce783cea8a8948d48b9e02d7a4236a10e0e1d9 100644
--- a/net/disk_cache/flash/flash_cache_test_base.cc
+++ b/net/disk_cache/flash/flash_cache_test_base.cc
@@ -11,14 +11,7 @@
#include "net/disk_cache/flash/log_store.h"
#include "net/disk_cache/flash/storage.h"
-namespace {
-
-const int32 kSegmentCount = 10;
-const base::FilePath::StringType kCachePath = FILE_PATH_LITERAL("cache");
-
-} // namespace
-
-FlashCacheTest::FlashCacheTest() : num_segments_in_storage_(kSegmentCount) {
+FlashCacheTest::FlashCacheTest() {
int seed = static_cast<int>(base::Time::Now().ToInternalValue());
srand(seed);
}
@@ -27,19 +20,10 @@ FlashCacheTest::~FlashCacheTest() {
}
void FlashCacheTest::SetUp() {
+ const base::FilePath::StringType kCachePath = FILE_PATH_LITERAL("cache");
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- const base::FilePath path(temp_dir_.path().Append(kCachePath));
-
- int32 storage_size = num_segments_in_storage_ * disk_cache::kFlashSegmentSize;
- storage_.reset(new disk_cache::Storage(path, storage_size));
- ASSERT_TRUE(storage_->Init());
-
- log_store_.reset(new disk_cache::LogStore(storage_.get()));
- ASSERT_TRUE(log_store_->Init());
+ path_ = temp_dir_.path().Append(kCachePath);
}
void FlashCacheTest::TearDown() {
- ASSERT_TRUE(log_store_->Close());
- log_store_.reset();
- storage_.reset();
}
« no previous file with comments | « net/disk_cache/flash/flash_cache_test_base.h ('k') | net/disk_cache/flash/flash_entry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698