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

Side by Side Diff: net/disk_cache/flash/flash_cache_test_base.cc

Issue 11532011: Renamed classes for consistency. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: test 2. Created 8 years 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 unified diff | Download patch
« no previous file with comments | « net/disk_cache/flash/flash_cache_test_base.h ('k') | net/disk_cache/flash/format.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/disk_cache/flash/flash_cache_test_base.h" 5 #include "net/disk_cache/flash/flash_cache_test_base.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "net/disk_cache/flash/format.h" 10 #include "net/disk_cache/flash/format.h"
11 #include "net/disk_cache/flash/log_structured_store.h" 11 #include "net/disk_cache/flash/log_store.h"
12 #include "net/disk_cache/flash/storage.h" 12 #include "net/disk_cache/flash/storage.h"
13 13
14 namespace { 14 namespace {
15 15
16 const int32 kSegmentCount = 10; 16 const int32 kSegmentCount = 10;
17 const FilePath::StringType kCachePath = FILE_PATH_LITERAL("cache"); 17 const FilePath::StringType kCachePath = FILE_PATH_LITERAL("cache");
18 18
19 } // namespace 19 } // namespace
20 20
21 FlashCacheTest::FlashCacheTest() : num_segments_in_storage_(kSegmentCount) { 21 FlashCacheTest::FlashCacheTest() : num_segments_in_storage_(kSegmentCount) {
22 int seed = static_cast<int>(base::Time::Now().ToInternalValue()); 22 int seed = static_cast<int>(base::Time::Now().ToInternalValue());
23 srand(seed); 23 srand(seed);
24 } 24 }
25 25
26 FlashCacheTest::~FlashCacheTest() { 26 FlashCacheTest::~FlashCacheTest() {
27 } 27 }
28 28
29 void FlashCacheTest::SetUp() { 29 void FlashCacheTest::SetUp() {
30 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 30 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
31 const FilePath path(temp_dir_.path().Append(kCachePath)); 31 const FilePath path(temp_dir_.path().Append(kCachePath));
32 32
33 int32 storage_size = num_segments_in_storage_ * disk_cache::kFlashSegmentSize; 33 int32 storage_size = num_segments_in_storage_ * disk_cache::kFlashSegmentSize;
34 storage_.reset(new disk_cache::Storage(path, storage_size)); 34 storage_.reset(new disk_cache::Storage(path, storage_size));
35 ASSERT_TRUE(storage_->Init()); 35 ASSERT_TRUE(storage_->Init());
36 36
37 log_structured_store_.reset( 37 log_store_.reset(new disk_cache::LogStore(storage_.get()));
38 new disk_cache::LogStructuredStore(storage_.get())); 38 ASSERT_TRUE(log_store_->Init());
39 ASSERT_TRUE(log_structured_store_->Init());
40 } 39 }
41 40
42 void FlashCacheTest::TearDown() { 41 void FlashCacheTest::TearDown() {
43 ASSERT_TRUE(log_structured_store_->Close()); 42 ASSERT_TRUE(log_store_->Close());
44 log_structured_store_.reset(); 43 log_store_.reset();
45 storage_.reset(); 44 storage_.reset();
46 } 45 }
OLDNEW
« no previous file with comments | « net/disk_cache/flash/flash_cache_test_base.h ('k') | net/disk_cache/flash/format.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698