Index: chrome/renderer/autofill/autofill_browsertest.cc |
diff --git a/chrome/renderer/autofill/autofill_browsertest.cc b/chrome/renderer/autofill/autofill_browsertest.cc |
index 50694ddff561e3e416e7981b40429368669d779a..a4c5d7ef09f0d95adddb5e277b78f3ec4e0fa00b 100644 |
--- a/chrome/renderer/autofill/autofill_browsertest.cc |
+++ b/chrome/renderer/autofill/autofill_browsertest.cc |
@@ -83,6 +83,9 @@ TEST_F(ChromeRenderViewTest, SendForms) { |
WebInputElement firstname = |
document.getElementById("firstname").to<WebInputElement>(); |
+ // Make sure to query for Autofill suggestions before selecting one. |
+ autofill_agent_->QueryAutofillSuggestions(firstname, false); |
+ |
// Accept suggestion that contains a label. Labeled items indicate Autofill |
// as opposed to Autocomplete. We're testing this distinction below with |
// the |AutofillHostMsg_FillAutofillFormData::ID| message. |
@@ -149,6 +152,9 @@ TEST_F(ChromeRenderViewTest, FillFormElement) { |
document.getElementById("middlename").to<WebInputElement>(); |
middlename.setAutofilled(true); |
+ // Make sure to query for Autofill suggestions before selecting one. |
+ autofill_agent_->QueryAutofillSuggestions(firstname, false); |
+ |
// Accept a suggestion in a form that has been auto-filled. This triggers |
// the direct filling of the firstname element with value parameter. |
autofill_agent_->didAcceptAutofillSuggestion(firstname, |