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 922048022e0cd895f3b7ea19daf2d4778ce1b9ff..176a2bc8c2c67540e4e1a514dbcfdfa2a229a9d6 100644 |
--- a/components/safe_browsing_db/v4_store_unittest.cc |
+++ b/components/safe_browsing_db/v4_store_unittest.cc |
@@ -798,4 +798,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 |