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

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

Issue 2478043002: HTTP Bad: Add warning message to autofill dropdown for http sites (Closed)
Patch Set: nit change Created 4 years, 1 month 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_external_delegate_unittest.cc
diff --git a/components/autofill/core/browser/autofill_external_delegate_unittest.cc b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
index 59add4d8584ef91cca7db779869845ebf42159bf..709c73444dd972f09f0a395cfcddbeb6dc926b87 100644
--- a/components/autofill/core/browser/autofill_external_delegate_unittest.cc
+++ b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
@@ -476,6 +476,32 @@ TEST_F(AutofillExternalDelegateUnitTest, AutofillWarnings) {
external_delegate_->OnSuggestionsReturned(kQueryId, autofill_item);
}
+// Test that Autofill warnings are removed if there are also autocomplete
+// entries in the vector.
+TEST_F(AutofillExternalDelegateUnitTest,
+ AutofillWarningsNotShown_WithSuggestions) {
+ IssueOnQuery(kQueryId);
+
+ // The enums must be cast to ints to prevent compile errors on linux_rel.
+ EXPECT_CALL(
+ autofill_client_,
+ ShowAutofillPopup(
+ _, _, SuggestionVectorIdsAre(testing::ElementsAre(
+ static_cast<int>(POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY))),
+ _));
+
+ // This should call ShowAutofillPopup.
+ std::vector<Suggestion> suggestions;
+ suggestions.push_back(Suggestion());
+ suggestions[0].frontend_id = POPUP_ITEM_ID_WARNING_MESSAGE;
+ suggestions.push_back(Suggestion());
+ suggestions[1].frontend_id = POPUP_ITEM_ID_WARNING_MESSAGE;
+ suggestions.push_back(Suggestion());
+ suggestions[2].value = ASCIIToUTF16("Rick");
+ suggestions[2].frontend_id = POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY;
+ external_delegate_->OnSuggestionsReturned(kQueryId, suggestions);
+}
+
// 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/core/browser/autofill_external_delegate.cc ('k') | components/autofill/core/browser/autofill_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698