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

Unified Diff: components/safe_browsing_db/v4_store_unittest.cc

Issue 2384893002: PVer4: Test checksum on startup outside the hotpath of DB load (Closed)
Patch Set: Created 4 years, 3 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 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
« components/safe_browsing_db/v4_store.cc ('K') | « components/safe_browsing_db/v4_store.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698