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 90c6525fa88ca316d0051a6fabf0e73147e51e6f..3b747e1ea826afeac98182ca7dc1df295734d780 100644 |
--- a/components/safe_browsing_db/v4_store_unittest.cc |
+++ b/components/safe_browsing_db/v4_store_unittest.cc |
@@ -800,4 +800,20 @@ TEST_F(V4StoreTest, TestMergeUpdatesFailsChecksum) { |
.MergeUpdate(prefix_map_old, HashPrefixMap(), nullptr, "aawc")); |
} |
+TEST_F(V4StoreTest, TestChecksumErrorOnStartup) { |
+ HashPrefixMap prefix_map_additions; |
+ EXPECT_EQ(APPLY_UPDATE_SUCCESS, |
+ V4Store::AddUnlumpedHashes(4, "2222", &prefix_map_additions)); |
+ V4Store store(task_runner_, store_path_); |
+ EXPECT_EQ(APPLY_UPDATE_SUCCESS, |
+ store.MergeUpdate(HashPrefixMap(), prefix_map_additions, nullptr, |
+ "aawc")); |
+ EXPECT_FALSE(store.hash_prefix_map_.empty()); |
+ |
+ task_runner_->RunPendingTasks(); |
+ base::RunLoop().RunUntilIdle(); |
+ |
+ EXPECT_TRUE(store.hash_prefix_map_.empty()); |
+} |
+ |
} // namespace safe_browsing |