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

Unified Diff: net/disk_cache/block_files_unittest.cc

Issue 2891022: Disk cache: Read the index and data_0 files in a single... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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
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

Powered by Google App Engine
This is Rietveld 408576698