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

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

Issue 512933004: mac: Don't show "Access Address Book" prompt if Autofill is disabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check for form autofillability. Created 6 years, 4 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 861ca23e6559705ad9676a4c74c21879b417632d..99faf6f998a7cf9f22f995f6f771ed537b020c46 100644
--- a/components/autofill/core/browser/autofill_manager_unittest.cc
+++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -2780,6 +2780,24 @@ TEST_F(AutofillManagerTest, RemoveProfileVariant) {
EXPECT_TRUE(autofill_manager_->GetProfileWithGUID(guid.c_str()));
}
+#if defined(OS_MACOSX) && !defined(OS_IOS)
+TEST_F(AutofillManagerTest, AccessAddressBookPrompt) {
+ FormData form;
+ test::CreateTestAddressFormData(&form);
+ std::vector<FormData> forms(1, form);
+ FormsSeen(forms);
+ FormFieldData& field = form.fields[0];
+
+ field.should_autocomplete = false;
+ EXPECT_FALSE(
+ autofill_manager_->ShouldShowAccessAddressBookSuggestion(form, field));
+
+ field.should_autocomplete = true;
+ EXPECT_TRUE(
+ autofill_manager_->ShouldShowAccessAddressBookSuggestion(form, field));
+}
+#endif // defined(OS_MACOSX) && !defined(OS_IOS)
+
namespace {
class MockAutofillClient : public TestAutofillClient {
« no previous file with comments | « components/autofill/core/browser/autofill_manager.cc ('k') | components/autofill/core/browser/personal_data_manager_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698