Index: components/autofill/core/browser/autofill_test_utils.cc |
diff --git a/components/autofill/core/browser/autofill_test_utils.cc b/components/autofill/core/browser/autofill_test_utils.cc |
index 081defa337a6781650b195de46a744b8207b6b3f..0393d867e922b5bda1fe673bddaa2d63decb46ee 100644 |
--- a/components/autofill/core/browser/autofill_test_utils.cc |
+++ b/components/autofill/core/browser/autofill_test_utils.cc |
@@ -206,12 +206,17 @@ void DisableSystemServices(PrefService* prefs) { |
// Use a mock Keychain rather than the OS one to store credit card data. |
#if defined(OS_MACOSX) |
OSCrypt::UseMockKeychain(true); |
-#endif |
+#endif // defined(OS_MACOSX) |
- // Disable auxiliary profiles for unit testing. These reach out to system |
- // services on the Mac. |
+#if defined(OS_MACOSX) && !defined(OS_IOS) |
+ // Don't use the Address Book on Mac, as it reaches out to system services. |
+ if (prefs) |
+ prefs->SetBoolean(prefs::kAutofillUseMacAddressBook, false); |
+#else |
+ // Disable auxiliary profiles for unit testing by default. |
if (prefs) |
prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, false); |
+#endif // defined(OS_MACOSX) && !defined(OS_IOS) |
} |
} // namespace test |