OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/prefs/scoped_user_pref_update.h" | 8 #include "base/prefs/scoped_user_pref_update.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "components/syncable_prefs/pref_model_associator.h" | 10 #include "components/syncable_prefs/pref_model_associator.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 // PrefModelAssociatorClient implementation. | 29 // PrefModelAssociatorClient implementation. |
30 bool IsMergeableListPreference(const std::string& pref_name) const override { | 30 bool IsMergeableListPreference(const std::string& pref_name) const override { |
31 return pref_name == kListPrefName; | 31 return pref_name == kListPrefName; |
32 } | 32 } |
33 | 33 |
34 bool IsMergeableDictionaryPreference( | 34 bool IsMergeableDictionaryPreference( |
35 const std::string& pref_name) const override { | 35 const std::string& pref_name) const override { |
36 return pref_name == kDictionaryPrefName; | 36 return pref_name == kDictionaryPrefName; |
37 } | 37 } |
38 | 38 |
39 bool IsMigratedPreference(const std::string& new_pref_name, | |
40 std::string* old_pref_name) const override { | |
41 return false; | |
42 } | |
43 | |
44 bool IsOldMigratedPreference(const std::string& old_pref_name, | |
45 std::string* new_pref_name) const override { | |
46 return false; | |
47 } | |
48 | |
49 private: | 39 private: |
50 DISALLOW_COPY_AND_ASSIGN(TestPrefModelAssociatorClient); | 40 DISALLOW_COPY_AND_ASSIGN(TestPrefModelAssociatorClient); |
51 }; | 41 }; |
52 | 42 |
53 class AbstractPreferenceMergeTest : public testing::Test { | 43 class AbstractPreferenceMergeTest : public testing::Test { |
54 protected: | 44 protected: |
55 AbstractPreferenceMergeTest() { | 45 AbstractPreferenceMergeTest() { |
56 PrefServiceMockFactory factory; | 46 PrefServiceMockFactory factory; |
57 factory.SetPrefModelAssociatorClient(&client_); | 47 factory.SetPrefModelAssociatorClient(&client_); |
58 scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry( | 48 scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry( |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 base::DictionaryValue server_patterns_; | 457 base::DictionaryValue server_patterns_; |
468 }; | 458 }; |
469 | 459 |
470 TEST_F(IndividualPreferenceMergeTest, ListPreference) { | 460 TEST_F(IndividualPreferenceMergeTest, ListPreference) { |
471 EXPECT_TRUE(MergeListPreference(kListPrefName)); | 461 EXPECT_TRUE(MergeListPreference(kListPrefName)); |
472 } | 462 } |
473 | 463 |
474 } // namespace | 464 } // namespace |
475 | 465 |
476 } // namespace syncable_prefs | 466 } // namespace syncable_prefs |
OLD | NEW |