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

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: Respond to estade's style suggestion. 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..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 {
« 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