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..2c81de4b7b34ca814e0f793fa20d4e3386e01e0f 100644 |
--- a/components/autofill/core/browser/autofill_manager_unittest.cc |
+++ b/components/autofill/core/browser/autofill_manager_unittest.cc |
@@ -133,6 +133,10 @@ class TestPersonalDataManager : public PersonalDataManager { |
credit_cards_.push_back(credit_card); |
} |
+#if defined(OS_MACOSX) && !defined(OS_IOS) |
+ bool ShouldShowAccessAddressBookSuggestion(AutofillType type) { return true; } |
Evan Stade
2014/08/28 17:31:55
where is this used? is it supposed to be virtual/O
erikchen
2014/08/28 17:37:52
Yup. Good catch, the method it was overriding wasn
Evan Stade
2014/08/28 17:42:32
can you just remove it instead?
erikchen
2014/08/28 18:14:46
Done.
|
+#endif // defined(OS_MACOSX) && !defined(OS_IOS) |
+ |
private: |
void CreateTestAutofillProfiles(ScopedVector<AutofillProfile>* profiles) { |
AutofillProfile* profile = new AutofillProfile; |
@@ -2780,6 +2784,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 { |