| Index: net/disk_cache/block_files_unittest.cc
|
| ===================================================================
|
| --- net/disk_cache/block_files_unittest.cc (revision 52189)
|
| +++ net/disk_cache/block_files_unittest.cc (working copy)
|
| @@ -203,4 +203,26 @@
|
| EXPECT_TRUE(NULL == files.GetFile(addr));
|
| }
|
|
|
| +// Tests that we generate the correct file stats.
|
| +TEST_F(DiskCacheTest, BlockFiles_Stats) {
|
| + ASSERT_TRUE(CopyTestCache("remove_load1"));
|
| + FilePath path = GetCacheFilePath();
|
| +
|
| + BlockFiles files(path);
|
| + ASSERT_TRUE(files.Init(false));
|
| + int used, load;
|
| +
|
| + files.GetFileStats(0, &used, &load);
|
| + EXPECT_EQ(101, used);
|
| + EXPECT_EQ(9, load);
|
| +
|
| + files.GetFileStats(1, &used, &load);
|
| + EXPECT_EQ(203, used);
|
| + EXPECT_EQ(19, load);
|
| +
|
| + files.GetFileStats(2, &used, &load);
|
| + EXPECT_EQ(0, used);
|
| + EXPECT_EQ(0, load);
|
| +}
|
| +
|
| } // namespace disk_cache
|
|
|