Index: chrome/browser/prefs/pref_hash_filter_unittest.cc |
diff --git a/chrome/browser/prefs/pref_hash_filter_unittest.cc b/chrome/browser/prefs/pref_hash_filter_unittest.cc |
index ce75d506af199397eebec4d01880ca2e78a0f080..e19f46c69a235c54245f0a9f12d1670d9a33e032 100644 |
--- a/chrome/browser/prefs/pref_hash_filter_unittest.cc |
+++ b/chrome/browser/prefs/pref_hash_filter_unittest.cc |
@@ -340,7 +340,7 @@ class PrefHashFilterTest |
}; |
TEST_P(PrefHashFilterTest, EmptyAndUnchanged) { |
- pref_hash_filter_->FilterOnLoad(&pref_store_contents_); |
+ ASSERT_FALSE(pref_hash_filter_->FilterOnLoad(&pref_store_contents_)); |
// All paths checked. |
ASSERT_EQ(arraysize(kTestTrackedPrefs), |
mock_pref_hash_store_->checked_paths_count()); |
@@ -476,7 +476,7 @@ TEST_P(PrefHashFilterTest, EmptyAndUnknown) { |
kAtomicPref, PrefHashStoreTransaction::TRUSTED_UNKNOWN_VALUE); |
mock_pref_hash_store_->SetCheckResult( |
kSplitPref, PrefHashStoreTransaction::TRUSTED_UNKNOWN_VALUE); |
- pref_hash_filter_->FilterOnLoad(&pref_store_contents_); |
+ ASSERT_FALSE(pref_hash_filter_->FilterOnLoad(&pref_store_contents_)); |
ASSERT_EQ(arraysize(kTestTrackedPrefs), |
mock_pref_hash_store_->checked_paths_count()); |
ASSERT_EQ(2u, mock_pref_hash_store_->stored_paths_count()); |
@@ -512,7 +512,9 @@ TEST_P(PrefHashFilterTest, InitialValueUnknown) { |
kAtomicPref, PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE); |
mock_pref_hash_store_->SetCheckResult( |
kSplitPref, PrefHashStoreTransaction::UNTRUSTED_UNKNOWN_VALUE); |
- pref_hash_filter_->FilterOnLoad(&pref_store_contents_); |
+ // If we are enforcing, expect this to report changes. |
+ ASSERT_EQ(GetParam() >= PrefHashFilter::ENFORCE_ON_LOAD, |
+ pref_hash_filter_->FilterOnLoad(&pref_store_contents_)); |
ASSERT_EQ(arraysize(kTestTrackedPrefs), |
mock_pref_hash_store_->checked_paths_count()); |
ASSERT_EQ(2u, mock_pref_hash_store_->stored_paths_count()); |
@@ -570,7 +572,7 @@ TEST_P(PrefHashFilterTest, InitialValueTrustedUnknown) { |
kAtomicPref, PrefHashStoreTransaction::TRUSTED_UNKNOWN_VALUE); |
mock_pref_hash_store_->SetCheckResult( |
kSplitPref, PrefHashStoreTransaction::TRUSTED_UNKNOWN_VALUE); |
- pref_hash_filter_->FilterOnLoad(&pref_store_contents_); |
+ ASSERT_FALSE(pref_hash_filter_->FilterOnLoad(&pref_store_contents_)); |
ASSERT_EQ(arraysize(kTestTrackedPrefs), |
mock_pref_hash_store_->checked_paths_count()); |
ASSERT_EQ(2u, mock_pref_hash_store_->stored_paths_count()); |
@@ -621,7 +623,8 @@ TEST_P(PrefHashFilterTest, InitialValueChanged) { |
mock_invalid_keys.push_back("c"); |
mock_pref_hash_store_->SetInvalidKeysResult(kSplitPref, mock_invalid_keys); |
- pref_hash_filter_->FilterOnLoad(&pref_store_contents_); |
+ ASSERT_EQ(GetParam() >= PrefHashFilter::ENFORCE_ON_LOAD, |
+ pref_hash_filter_->FilterOnLoad(&pref_store_contents_)); |
ASSERT_EQ(arraysize(kTestTrackedPrefs), |
mock_pref_hash_store_->checked_paths_count()); |
ASSERT_EQ(2u, mock_pref_hash_store_->stored_paths_count()); |
@@ -682,7 +685,7 @@ TEST_P(PrefHashFilterTest, EmptyCleared) { |
PrefHashStoreTransaction::CLEARED); |
mock_pref_hash_store_->SetCheckResult(kSplitPref, |
PrefHashStoreTransaction::CLEARED); |
- pref_hash_filter_->FilterOnLoad(&pref_store_contents_); |
+ ASSERT_FALSE(pref_hash_filter_->FilterOnLoad(&pref_store_contents_)); |
ASSERT_EQ(arraysize(kTestTrackedPrefs), |
mock_pref_hash_store_->checked_paths_count()); |
ASSERT_EQ(2u, mock_pref_hash_store_->stored_paths_count()); |
@@ -717,7 +720,9 @@ TEST_P(PrefHashFilterTest, InitialValueMigrated) { |
mock_pref_hash_store_->SetCheckResult(kAtomicPref, |
PrefHashStoreTransaction::WEAK_LEGACY); |
- pref_hash_filter_->FilterOnLoad(&pref_store_contents_); |
+ |
+ ASSERT_EQ(GetParam() >= PrefHashFilter::ENFORCE_ON_LOAD, |
+ pref_hash_filter_->FilterOnLoad(&pref_store_contents_)); |
ASSERT_EQ(arraysize(kTestTrackedPrefs), |
mock_pref_hash_store_->checked_paths_count()); |
ASSERT_EQ(1u, mock_pref_hash_store_->stored_paths_count()); |
@@ -763,7 +768,7 @@ TEST_P(PrefHashFilterTest, InitialValueUnchangedLegacyId) { |
kAtomicPref, PrefHashStoreTransaction::SECURE_LEGACY); |
mock_pref_hash_store_->SetCheckResult( |
kSplitPref, PrefHashStoreTransaction::SECURE_LEGACY); |
- pref_hash_filter_->FilterOnLoad(&pref_store_contents_); |
+ ASSERT_FALSE(pref_hash_filter_->FilterOnLoad(&pref_store_contents_)); |
ASSERT_EQ(arraysize(kTestTrackedPrefs), |
mock_pref_hash_store_->checked_paths_count()); |
ASSERT_EQ(1u, mock_pref_hash_store_->transactions_performed()); |
@@ -820,7 +825,9 @@ TEST_P(PrefHashFilterTest, DontResetReportOnly) { |
PrefHashStoreTransaction::CHANGED); |
mock_pref_hash_store_->SetCheckResult(kReportOnlySplitPref, |
PrefHashStoreTransaction::CHANGED); |
- pref_hash_filter_->FilterOnLoad(&pref_store_contents_); |
+ |
+ ASSERT_EQ(GetParam() >= PrefHashFilter::ENFORCE_ON_LOAD, |
+ pref_hash_filter_->FilterOnLoad(&pref_store_contents_)); |
// All prefs should be checked and a new hash should be stored for each tested |
// pref. |
ASSERT_EQ(arraysize(kTestTrackedPrefs), |