summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/backend_unittest.cc
diff options
context:
space:
mode:
authorclamy@chromium.org <clamy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-18 23:33:01 +0000
committerclamy@chromium.org <clamy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-18 23:33:01 +0000
commitb6b0551fa5cb75a65124acf005a85f0fa57a7eaf (patch)
tree041ca127423fdc069af02afeba37f624b85531fb /net/disk_cache/backend_unittest.cc
parentbf1599c4174cc5fc2a85eccd4ba99d08d258436a (diff)
downloadchromium_src-b6b0551fa5cb75a65124acf005a85f0fa57a7eaf.zip
chromium_src-b6b0551fa5cb75a65124acf005a85f0fa57a7eaf.tar.gz
chromium_src-b6b0551fa5cb75a65124acf005a85f0fa57a7eaf.tar.bz2
SimpleCache: merge the first and second stream in one file
This CL merges the two first streams in a single file in order to reduce the disk space consumption of the Simple Cache. BUG=173398 Review URL: https://chromiumcodereview.appspot.com/23983005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223989 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/backend_unittest.cc')
-rw-r--r--net/disk_cache/backend_unittest.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc
index ed07129..ab00178 100644
--- a/net/disk_cache/backend_unittest.cc
+++ b/net/disk_cache/backend_unittest.cc
@@ -3250,7 +3250,7 @@ TEST_F(DiskCacheBackendTest, SimpleCacheOpenMissingFile) {
// Delete one of the files in the entry.
base::FilePath to_delete_file = cache_path_.AppendASCII(
- disk_cache::simple_util::GetFilenameFromKeyAndIndex(key, 0));
+ disk_cache::simple_util::GetFilenameFromKeyAndFileIndex(key, 0));
EXPECT_TRUE(base::PathExists(to_delete_file));
EXPECT_TRUE(disk_cache::DeleteCacheFile(to_delete_file));
@@ -3259,9 +3259,8 @@ TEST_F(DiskCacheBackendTest, SimpleCacheOpenMissingFile) {
// Confirm the rest of the files are gone.
for (int i = 1; i < disk_cache::kSimpleEntryFileCount; ++i) {
- base::FilePath
- should_be_gone_file(cache_path_.AppendASCII(
- disk_cache::simple_util::GetFilenameFromKeyAndIndex(key, i)));
+ base::FilePath should_be_gone_file(cache_path_.AppendASCII(
+ disk_cache::simple_util::GetFilenameFromKeyAndFileIndex(key, i)));
EXPECT_FALSE(base::PathExists(should_be_gone_file));
}
}
@@ -3286,9 +3285,9 @@ TEST_F(DiskCacheBackendTest, SimpleCacheOpenBadFile) {
entry->Close();
entry = NULL;
- // Write an invalid header on stream 1.
+ // Write an invalid header for stream 0 and stream 1.
base::FilePath entry_file1_path = cache_path_.AppendASCII(
- disk_cache::simple_util::GetFilenameFromKeyAndIndex(key, 1));
+ disk_cache::simple_util::GetFilenameFromKeyAndFileIndex(key, 0));
disk_cache::SimpleFileHeader header;
header.initial_magic_number = GG_UINT64_C(0xbadf00d);