| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/prefs/pref_hash_filter.h" | 5 #include "chrome/browser/prefs/pref_hash_filter.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 } | 562 } |
| 563 | 563 |
| 564 TEST_P(PrefHashFilterTest, MultiplePrefsFilterSerializeData) { | 564 TEST_P(PrefHashFilterTest, MultiplePrefsFilterSerializeData) { |
| 565 base::DictionaryValue root_dict; | 565 base::DictionaryValue root_dict; |
| 566 // Ownership of the following values is transfered to |root_dict|. | 566 // Ownership of the following values is transfered to |root_dict|. |
| 567 base::Value* int_value1 = base::Value::CreateIntegerValue(1); | 567 base::Value* int_value1 = base::Value::CreateIntegerValue(1); |
| 568 base::Value* int_value2 = base::Value::CreateIntegerValue(2); | 568 base::Value* int_value2 = base::Value::CreateIntegerValue(2); |
| 569 base::Value* int_value3 = base::Value::CreateIntegerValue(3); | 569 base::Value* int_value3 = base::Value::CreateIntegerValue(3); |
| 570 base::Value* int_value4 = base::Value::CreateIntegerValue(4); | 570 base::Value* int_value4 = base::Value::CreateIntegerValue(4); |
| 571 base::DictionaryValue* dict_value = new base::DictionaryValue; | 571 base::DictionaryValue* dict_value = new base::DictionaryValue; |
| 572 dict_value->Set("a", base::Value::CreateBooleanValue(true)); | 572 dict_value->Set("a", new base::FundamentalValue(true)); |
| 573 root_dict.Set(kAtomicPref, int_value1); | 573 root_dict.Set(kAtomicPref, int_value1); |
| 574 root_dict.Set(kAtomicPref2, int_value2); | 574 root_dict.Set(kAtomicPref2, int_value2); |
| 575 root_dict.Set(kAtomicPref3, int_value3); | 575 root_dict.Set(kAtomicPref3, int_value3); |
| 576 root_dict.Set("untracked", int_value4); | 576 root_dict.Set("untracked", int_value4); |
| 577 root_dict.Set(kSplitPref, dict_value); | 577 root_dict.Set(kSplitPref, dict_value); |
| 578 | 578 |
| 579 // Only update kAtomicPref, kAtomicPref3, and kSplitPref. | 579 // Only update kAtomicPref, kAtomicPref3, and kSplitPref. |
| 580 pref_hash_filter_->FilterUpdate(kAtomicPref); | 580 pref_hash_filter_->FilterUpdate(kAtomicPref); |
| 581 pref_hash_filter_->FilterUpdate(kAtomicPref3); | 581 pref_hash_filter_->FilterUpdate(kAtomicPref3); |
| 582 pref_hash_filter_->FilterUpdate(kSplitPref); | 582 pref_hash_filter_->FilterUpdate(kSplitPref); |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 mock_pref_hash_store_->stored_value(kAtomicPref2).first); | 1086 mock_pref_hash_store_->stored_value(kAtomicPref2).first); |
| 1087 | 1087 |
| 1088 ASSERT_FALSE(RecordedReset()); | 1088 ASSERT_FALSE(RecordedReset()); |
| 1089 } | 1089 } |
| 1090 } | 1090 } |
| 1091 | 1091 |
| 1092 INSTANTIATE_TEST_CASE_P( | 1092 INSTANTIATE_TEST_CASE_P( |
| 1093 PrefHashFilterTestInstance, PrefHashFilterTest, | 1093 PrefHashFilterTestInstance, PrefHashFilterTest, |
| 1094 testing::Values(PrefHashFilter::NO_ENFORCEMENT, | 1094 testing::Values(PrefHashFilter::NO_ENFORCEMENT, |
| 1095 PrefHashFilter::ENFORCE_ON_LOAD)); | 1095 PrefHashFilter::ENFORCE_ON_LOAD)); |
| OLD | NEW |