diff options
-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, |