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..a7d6eb9eae328b66b5da0e66e8edbac47c5bfbbb 100644 |
--- a/components/safe_browsing_db/v4_store_unittest.cc |
+++ b/components/safe_browsing_db/v4_store_unittest.cc |
@@ -800,4 +800,23 @@ 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( |
+ std::string(crypto::kSHA256Length, 0)); |
+ 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. |
Nathan Parker
2016/10/07 23:24:29
Is there a database here? I'm confused by the comm
vakh (use Gerrit instead)
2016/10/10 17:42:34
Done.
|
+} |
+ |
} // namespace safe_browsing |