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

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

Issue 11269008: Cache backend for devices with flash storage (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: test Created 8 years, 1 month 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/segment.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "net/disk_cache/flash/flash_cache_test_base.h"
6
7 #include "base/file_path.h"
8 #include "base/scoped_temp_dir.h"
9 #include "base/time.h"
10 #include "net/disk_cache/flash/format.h"
11 #include "net/disk_cache/flash/storage.h"
12
13 namespace {
14
15 const int32 kSegmentCount = 10;
16 const FilePath::StringType kCachePath = FILE_PATH_LITERAL("cache");
17
18 } // namespace
19
20 FlashCacheTest::FlashCacheTest() : num_segments_in_storage_(kSegmentCount) {
21 int seed = static_cast<int>(base::Time::Now().ToInternalValue());
22 srand(seed);
23 }
24
25 FlashCacheTest::~FlashCacheTest() {
26 }
27
28 void FlashCacheTest::SetUp() {
29 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
30 const FilePath path(temp_dir_.path().Append(kCachePath));
31
32 int32 storage_size = num_segments_in_storage_ * disk_cache::kFlashSegmentSize;
33 storage_.reset(new disk_cache::Storage(path, storage_size));
34 ASSERT_TRUE(storage_->Init());
35 }
36
37 void FlashCacheTest::TearDown() {
38 storage_.reset();
39 }
OLDNEW
« no previous file with comments | « net/disk_cache/flash/flash_cache_test_base.h ('k') | net/disk_cache/flash/segment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698