diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-10 13:14:04 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-10 13:14:04 +0000 |
commit | c753f148dc1a10cd9461e50e03dc2a93652c13d1 (patch) | |
tree | 9e1a8558556a0f31d4e527c4c203d076f8cca920 /chrome/browser/extensions/extension_prefs_unittest.cc | |
parent | e6dbde892ddea9e179fa76e4db1333e83776d160 (diff) | |
download | chromium_src-c753f148dc1a10cd9461e50e03dc2a93652c13d1.zip chromium_src-c753f148dc1a10cd9461e50e03dc2a93652c13d1.tar.gz chromium_src-c753f148dc1a10cd9461e50e03dc2a93652c13d1.tar.bz2 |
Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable.
Minimize usage of PrefServiceSyncable. It is mostly an implementation detail of ProfileImpl and the sync integration.
TBR=ben@chromium.org
BUG=155525
Review URL: https://codereview.chromium.org/12079097
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181648 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_prefs_unittest.cc')
-rw-r--r-- | chrome/browser/extensions/extension_prefs_unittest.cc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/chrome/browser/extensions/extension_prefs_unittest.cc b/chrome/browser/extensions/extension_prefs_unittest.cc index f328378..765fa37 100644 --- a/chrome/browser/extensions/extension_prefs_unittest.cc +++ b/chrome/browser/extensions/extension_prefs_unittest.cc @@ -15,6 +15,8 @@ #include "chrome/browser/extensions/extension_pref_value_map.h" #include "chrome/browser/extensions/extension_prefs.h" #include "chrome/browser/prefs/mock_pref_change_callback.h" +#include "chrome/browser/prefs/pref_registry_syncable.h" +#include "chrome/browser/prefs/pref_service_syncable.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/extension_manifest_constants.h" @@ -59,10 +61,10 @@ ExtensionPrefsTest::ExtensionPrefsTest() ExtensionPrefsTest::~ExtensionPrefsTest() { } -void ExtensionPrefsTest::RegisterPreferences() {} +void ExtensionPrefsTest::RegisterPreferences(PrefRegistrySyncable* registry) {} void ExtensionPrefsTest::SetUp() { - RegisterPreferences(); + RegisterPreferences(prefs_.pref_registry()); Initialize(); } @@ -70,8 +72,9 @@ void ExtensionPrefsTest::TearDown() { Verify(); // Reset ExtensionPrefs, and re-verify. + prefs_.ResetPrefRegistry(); + RegisterPreferences(prefs_.pref_registry()); prefs_.RecreateExtensionPrefs(); - RegisterPreferences(); Verify(); prefs_.pref_service()->CommitPendingWrite(); message_loop_.RunUntilIdle(); @@ -820,15 +823,16 @@ ExtensionPrefsPrepopulatedTest::ExtensionPrefsPrepopulatedTest() ExtensionPrefsPrepopulatedTest::~ExtensionPrefsPrepopulatedTest() {} -void ExtensionPrefsPrepopulatedTest::RegisterPreferences() { - prefs()->pref_service()->RegisterStringPref( - kPref1, kDefaultPref1, PrefServiceSyncable::UNSYNCABLE_PREF); - prefs()->pref_service()->RegisterStringPref( - kPref2, kDefaultPref2, PrefServiceSyncable::UNSYNCABLE_PREF); - prefs()->pref_service()->RegisterStringPref( - kPref3, kDefaultPref3, PrefServiceSyncable::UNSYNCABLE_PREF); - prefs()->pref_service()->RegisterStringPref( - kPref4, kDefaultPref4, PrefServiceSyncable::UNSYNCABLE_PREF); +void ExtensionPrefsPrepopulatedTest::RegisterPreferences( + PrefRegistrySyncable* registry) { + registry->RegisterStringPref( + kPref1, kDefaultPref1, PrefRegistrySyncable::UNSYNCABLE_PREF); + registry->RegisterStringPref( + kPref2, kDefaultPref2, PrefRegistrySyncable::UNSYNCABLE_PREF); + registry->RegisterStringPref( + kPref3, kDefaultPref3, PrefRegistrySyncable::UNSYNCABLE_PREF); + registry->RegisterStringPref( + kPref4, kDefaultPref4, PrefRegistrySyncable::UNSYNCABLE_PREF); } void ExtensionPrefsPrepopulatedTest::InstallExtControlledPref( |