diff options
author | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-27 21:26:16 +0000 |
---|---|---|
committer | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-27 21:26:16 +0000 |
commit | 599f9732f1e0d9c1e53b81a579cc142d243e1fbb (patch) | |
tree | 2206ff06e5af224861ef4b08f97532aaab309d67 /chrome | |
parent | 3432291b5b66e9bea09537c3bfbc4d80f27442a4 (diff) | |
download | chromium_src-599f9732f1e0d9c1e53b81a579cc142d243e1fbb.zip chromium_src-599f9732f1e0d9c1e53b81a579cc142d243e1fbb.tar.gz chromium_src-599f9732f1e0d9c1e53b81a579cc142d243e1fbb.tar.bz2 |
Reset to defaults failed to reset the Autofill/Mac/Address Book card preference
Adds awareness of kAutoFillAuxiliaryProfilesEnabled preference to |OptionsUtil::ResetToDefaults()|, which is used to reset preferences from the "Under the Hood" / "Reset to Defaults" button.
BUG=49873
TEST=AutoFillManagerTest.AuxiliaryProfilesReset
Review URL: http://codereview.chromium.org/3054019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53845 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/autofill/autofill_manager_unittest.cc | 24 | ||||
-rw-r--r-- | chrome/browser/options_util.cc | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/chrome/browser/autofill/autofill_manager_unittest.cc b/chrome/browser/autofill/autofill_manager_unittest.cc index 6cceed9..a7c8f3a 100644 --- a/chrome/browser/autofill/autofill_manager_unittest.cc +++ b/chrome/browser/autofill/autofill_manager_unittest.cc @@ -1189,4 +1189,28 @@ TEST_F(AutoFillManagerTest, HiddenFields) { // fields. Need to query the PDM. } +// Checks that resetting the auxiliary profile enabled preference does the right +// thing on all platforms. +TEST_F(AutoFillManagerTest, AuxiliaryProfilesReset) { +#if defined(OS_MACOSX) + // Auxiliary profiles is implemented on Mac only. It enables Mac Address + // Book integration. + ASSERT_TRUE(profile()->GetPrefs()->GetBoolean( + prefs::kAutoFillAuxiliaryProfilesEnabled)); + profile()->GetPrefs()->SetBoolean( + prefs::kAutoFillAuxiliaryProfilesEnabled, false); + profile()->GetPrefs()->ClearPref(prefs::kAutoFillAuxiliaryProfilesEnabled); + ASSERT_TRUE(profile()->GetPrefs()->GetBoolean( + prefs::kAutoFillAuxiliaryProfilesEnabled)); +#else + ASSERT_FALSE(profile()->GetPrefs()->GetBoolean( + prefs::kAutoFillAuxiliaryProfilesEnabled)); + profile()->GetPrefs()->SetBoolean( + prefs::kAutoFillAuxiliaryProfilesEnabled, true); + profile()->GetPrefs()->ClearPref(prefs::kAutoFillAuxiliaryProfilesEnabled); + ASSERT_FALSE(profile()->GetPrefs()->GetBoolean( + prefs::kAutoFillAuxiliaryProfilesEnabled)); +#endif +} + } // namespace diff --git a/chrome/browser/options_util.cc b/chrome/browser/options_util.cc index 8bcf063..5ab7b06 100644 --- a/chrome/browser/options_util.cc +++ b/chrome/browser/options_util.cc @@ -45,6 +45,7 @@ void OptionsUtil::ResetToDefaults(Profile* profile) { prefs::kEnableSpellCheck, prefs::kEnableTranslate, prefs::kAutoFillEnabled, + prefs::kAutoFillAuxiliaryProfilesEnabled, prefs::kHomePage, prefs::kHomePageIsNewTabPage, prefs::kPromptForDownload, |