| 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..108f188dd17f80577a87c2fc4b09b4018f0f71f9 100644
|
| --- a/components/safe_browsing_db/v4_store_unittest.cc
|
| +++ b/components/safe_browsing_db/v4_store_unittest.cc
|
| @@ -800,4 +800,22 @@ TEST_F(V4StoreTest, TestMergeUpdatesFailsChecksum) {
|
| .MergeUpdate(prefix_map_old, HashPrefixMap(), nullptr, "aawc"));
|
| }
|
|
|
| +TEST_F(V4StoreTest, TestChecksumErrorOnStartup) {
|
| + ListUpdateResponse list_update_response;
|
| + list_update_response.set_new_client_state("test_client_state");
|
| + list_update_response.set_platform_type(LINUX_PLATFORM);
|
| + list_update_response.set_response_type(ListUpdateResponse::FULL_UPDATE);
|
| + list_update_response.mutable_checksum()->set_sha256("checksum");
|
| + WriteFileFormatProtoToFile(0x600D71FE, 9, &list_update_response);
|
| + V4Store store(task_runner_, store_path_);
|
| + EXPECT_TRUE(store.expected_checksum_.empty());
|
| +
|
| + EXPECT_EQ(READ_SUCCESS, store.ReadFromDisk());
|
| + EXPECT_TRUE(!store.expected_checksum_.empty());
|
| + EXPECT_EQ("test_client_state", store.state());
|
| +
|
| + EXPECT_FALSE(store.VerifyChecksum());
|
| + // The database schedules the checksum verification.
|
| +}
|
| +
|
| } // namespace safe_browsing
|
|
|