Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: components/autofill/core/browser/autofill_manager_unittest.cc

Issue 301343002: mac: Clean up autofill integration with Address Book. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@autofill_cleanup2_base
Patch Set: Autofill test failures on Android. Undo a change to autofill_test_utils.cc. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/autofill_manager_unittest.cc
diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc
index 4e3fd92cd8aca8d71cf028bcbf134a0c67d6b1af..d8cc496fce6e765bae3eb5eb11cfdfd1c6cb6290 100644
--- a/components/autofill/core/browser/autofill_manager_unittest.cc
+++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -1552,8 +1552,14 @@ TEST_F(AutofillManagerTest, FillAddressForm) {
// Test that we correctly fill an address form from an auxiliary profile.
TEST_F(AutofillManagerTest, FillAddressFormFromAuxiliaryProfile) {
personal_data_.ClearAutofillProfiles();
+#if defined(OS_MACOSX) && !defined(OS_IOS)
+ autofill_delegate_.GetPrefs()->SetBoolean(
+ ::autofill::prefs::kAutofillUseMacAddressBook, true);
+#else
autofill_delegate_.GetPrefs()->SetBoolean(
::autofill::prefs::kAutofillAuxiliaryProfilesEnabled, true);
+#endif // defined(OS_MACOSX) && !defined(OS_IOS)
+
personal_data_.CreateTestAuxiliaryProfiles();
// Set up our form data.
@@ -2479,12 +2485,12 @@ TEST_F(AutofillManagerTest, AuxiliaryProfilesReset) {
PrefService* prefs = autofill_delegate_.GetPrefs();
#if defined(OS_MACOSX) || defined(OS_ANDROID)
// Auxiliary profiles is implemented on Mac and Android only.
- // OSX: enables Mac Address Book integration.
+ // OSX: This preference exists for legacy reasons. It is no longer used.
// Android: enables integration with user's contact profile.
ASSERT_TRUE(
prefs->GetBoolean(::autofill::prefs::kAutofillAuxiliaryProfilesEnabled));
- prefs->SetBoolean(
- ::autofill::prefs::kAutofillAuxiliaryProfilesEnabled, false);
+ prefs->SetBoolean(::autofill::prefs::kAutofillAuxiliaryProfilesEnabled,
+ false);
prefs->ClearPref(::autofill::prefs::kAutofillAuxiliaryProfilesEnabled);
ASSERT_TRUE(
prefs->GetBoolean(::autofill::prefs::kAutofillAuxiliaryProfilesEnabled));
@@ -2495,7 +2501,7 @@ TEST_F(AutofillManagerTest, AuxiliaryProfilesReset) {
prefs->ClearPref(::autofill::prefs::kAutofillAuxiliaryProfilesEnabled);
ASSERT_FALSE(
prefs->GetBoolean(::autofill::prefs::kAutofillAuxiliaryProfilesEnabled));
-#endif
+#endif // defined(OS_MACOSX) || defined(OS_ANDROID)
}
TEST_F(AutofillManagerTest, DeterminePossibleFieldTypesForUpload) {
« no previous file with comments | « components/autofill/core/browser/autofill_manager.cc ('k') | components/autofill/core/browser/autofill_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698