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

Unified Diff: components/autofill/browser/autofill_external_delegate_unittest.cc

Issue 16344003: [Autofill] Fix popup delegate to show warnings correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « components/autofill/browser/autofill_external_delegate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/browser/autofill_external_delegate_unittest.cc
diff --git a/components/autofill/browser/autofill_external_delegate_unittest.cc b/components/autofill/browser/autofill_external_delegate_unittest.cc
index 4554844815ef29589fb0529c420ffd38126e5735..57578489d3150f11ca90dda801a6281d60d29350 100644
--- a/components/autofill/browser/autofill_external_delegate_unittest.cc
+++ b/components/autofill/browser/autofill_external_delegate_unittest.cc
@@ -119,7 +119,7 @@ class AutofillExternalDelegateUnitTest
field.should_autocomplete = true;
const gfx::RectF element_bounds;
- external_delegate_->OnQuery(query_id, form, field, element_bounds, false);
+ external_delegate_->OnQuery(query_id, form, field, element_bounds, true);
}
MockAutofillManagerDelegate manager_delegate_;
@@ -223,6 +223,33 @@ TEST_F(AutofillExternalDelegateUnitTest, ExternalDelegateDataList) {
autofill_ids);
}
+// Test that the Autofill popup is able to display warnings explaining why
+// Autofill is disabled for a website.
+// Regression test for http://crbug.com/247880
+TEST_F(AutofillExternalDelegateUnitTest, AutofillWarnings) {
+ IssueOnQuery(kQueryId);
+
+ // The enums must be cast to ints to prevent compile errors on linux_rel.
+ EXPECT_CALL(manager_delegate_,
+ ShowAutofillPopup(
+ _, _, _, _,
+ testing::ElementsAre(
+ static_cast<int>(
+ WebAutofillClient::MenuItemIDWarningMessage)),
+ _));
+
+ // This should call ShowAutofillPopup.
+ std::vector<base::string16> autofill_item;
+ autofill_item.push_back(base::string16());
+ std::vector<int> autofill_ids;
+ autofill_ids.push_back(WebAutofillClient::MenuItemIDWarningMessage);
+ external_delegate_->OnSuggestionsReturned(kQueryId,
+ autofill_item,
+ autofill_item,
+ autofill_item,
+ autofill_ids);
+}
+
// Test that the Autofill delegate doesn't try and fill a form with a
// negative unique id.
TEST_F(AutofillExternalDelegateUnitTest, ExternalDelegateInvalidUniqueId) {
« no previous file with comments | « components/autofill/browser/autofill_external_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698