Index: chrome/browser/safe_browsing/incident_reporting/state_store_unittest.cc |
diff --git a/chrome/browser/safe_browsing/incident_reporting/state_store_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/state_store_unittest.cc |
index ff12661356e90278fd6095c74d5fba86561b3906..9862d319197d188ccb488c43145311d275ea46a0 100644 |
--- a/chrome/browser/safe_browsing/incident_reporting/state_store_unittest.cc |
+++ b/chrome/browser/safe_browsing/incident_reporting/state_store_unittest.cc |
@@ -185,6 +185,37 @@ TEST_F(StateStoreTest, ClearForType) { |
} |
} |
+TEST_F(StateStoreTest, ClearAll) { |
+ StateStore state_store(profile_); |
+ // Write some state to the store. |
+ { |
+ StateStore::Transaction transaction(&state_store); |
+ for (const auto& data : kTestData_) |
+ transaction.MarkAsReported(data.type, data.key, data.digest); |
+ } |
+ |
+ StateStore::Transaction(&state_store).ClearAll(); |
+ |
+ for (const auto& data : kTestData_) { |
+ ASSERT_FALSE(state_store.HasBeenReported(data.type, data.key, data.digest)); |
+ } |
+ |
+ // Run tasks to write prefs out to the JsonPrefStore. |
+ task_runner_->RunUntilIdle(); |
+ |
+ // Delete the profile. |
+ DeleteProfile(); |
+ |
+ // Recreate the profile. |
+ CreateProfile(); |
+ |
+ StateStore store_2(profile_); |
+ for (const auto& data : kTestData_) { |
+ // Verify that the state did not survive through the Platform State Store. |
+ ASSERT_FALSE(store_2.HasBeenReported(data.type, data.key, data.digest)); |
+ } |
+} |
+ |
TEST_F(StateStoreTest, Persistence) { |
// Write some state to the store. |
{ |