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

Unified Diff: components/user_prefs/tracked/pref_hash_filter_unittest.cc

Issue 2384213002: Send a TrackedPreference incident when registry pref validation fails. (Closed)
Patch Set: Address comments on patch set 4 Created 4 years, 2 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/user_prefs/tracked/pref_hash_filter_unittest.cc
diff --git a/components/user_prefs/tracked/pref_hash_filter_unittest.cc b/components/user_prefs/tracked/pref_hash_filter_unittest.cc
index fa137590bf82bbe239e9f581a0099c95ab75694c..1d3afd4b9fc3af307a2f3f7b1cf0015f417b55eb 100644
--- a/components/user_prefs/tracked/pref_hash_filter_unittest.cc
+++ b/components/user_prefs/tracked/pref_hash_filter_unittest.cc
@@ -1371,8 +1371,20 @@ TEST_P(PrefHashFilterTest, ExternalValidationValueChanged) {
ASSERT_EQ(
1u, mock_external_validation_pref_hash_store_->transactions_performed());
- // TODO(proberge): query mock_validation_state_ for number of CHANGED
- // and UNCHANGED preferences once the class supports external validation.
+ ASSERT_EQ(arraysize(kTestTrackedPrefs),
+ mock_validation_delegate_.recorded_validations_count());
+
+ // Regular validation should not have any CHANGED prefs.
+ ASSERT_EQ(arraysize(kTestTrackedPrefs),
+ mock_validation_delegate_.CountValidationsOfState(
+ PrefHashStoreTransaction::UNCHANGED));
+
+ // External validation should have two CHANGED prefs (kAtomic and kSplit).
+ ASSERT_EQ(2u, mock_validation_delegate_.CountExternalValidationsOfState(
+ PrefHashStoreTransaction::CHANGED));
+ ASSERT_EQ(arraysize(kTestTrackedPrefs) - 2u,
+ mock_validation_delegate_.CountExternalValidationsOfState(
+ PrefHashStoreTransaction::UNCHANGED));
}
INSTANTIATE_TEST_CASE_P(PrefHashFilterTestInstance,

Powered by Google App Engine
This is Rietveld 408576698