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

Unified Diff: components/safe_browsing_db/v4_store_unittest.cc

Issue 2447443002: Log the size of each of the stores and complete DB on launch and after each (Closed)
Patch Set: shess@'s review Created 4 years, 2 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: components/safe_browsing_db/v4_store_unittest.cc
diff --git a/components/safe_browsing_db/v4_store_unittest.cc b/components/safe_browsing_db/v4_store_unittest.cc
index c0138b7b379aa1da9a6ea74a7739ae9f05bea6b1..6b727c17121a088dd8559bd822f457dc59325a3f 100644
--- a/components/safe_browsing_db/v4_store_unittest.cc
+++ b/components/safe_browsing_db/v4_store_unittest.cc
@@ -135,6 +135,7 @@ TEST_F(V4StoreTest, TestReadFromNoHashPrefixesFile) {
V4Store store(task_runner_, store_path_);
EXPECT_EQ(READ_SUCCESS, store.ReadFromDisk());
EXPECT_TRUE(store.hash_prefix_map_.empty());
+ EXPECT_EQ(14ul, store.file_size_);
}
TEST_F(V4StoreTest, TestAddUnlumpedHashesWithInvalidAddition) {
@@ -562,6 +563,7 @@ TEST_F(V4StoreTest, TestReadFullResponseWithValidHashPrefixMap) {
ASSERT_EQ(2u, read_store.hash_prefix_map_.size());
EXPECT_EQ("00000abc", read_store.hash_prefix_map_[4]);
EXPECT_EQ("00000abcde", read_store.hash_prefix_map_[5]);
+ EXPECT_EQ(71ul, read_store.file_size_);
}
// This tests fails to read the prefix map from the disk because the file on
@@ -783,6 +785,7 @@ TEST_F(V4StoreTest, TestChecksumErrorOnStartup) {
EXPECT_TRUE(store.expected_checksum_.empty());
EXPECT_EQ(READ_SUCCESS, store.ReadFromDisk());
EXPECT_TRUE(!store.expected_checksum_.empty());
+ EXPECT_EQ(69ul, store.file_size_);
EXPECT_EQ("test_client_state", store.state());
EXPECT_FALSE(store.VerifyChecksum());
@@ -811,6 +814,7 @@ TEST_F(V4StoreTest, TestChecksumErrorOnStartup) {
EXPECT_EQ(READ_SUCCESS, another_store.ReadFromDisk());
EXPECT_TRUE(!another_store.expected_checksum_.empty());
EXPECT_EQ("test_client_state", another_store.state());
+ EXPECT_EQ(69ul, store.file_size_);
EXPECT_TRUE(another_store.VerifyChecksum());
}

Powered by Google App Engine
This is Rietveld 408576698