| Index: chrome/renderer/autofill/password_autofill_agent_browsertest.cc
|
| diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
|
| index 6a64f21860e68749608af881b31522c0596907a7..1723480a6b8fa2195a2f660fd0d43664434a0af0 100644
|
| --- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
|
| +++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
|
| @@ -12,6 +12,7 @@
|
| #include "components/autofill/content/renderer/test_password_autofill_agent.h"
|
| #include "components/autofill/core/common/form_data.h"
|
| #include "components/autofill/core/common/form_field_data.h"
|
| +#include "components/autofill/core/common/password_autofill_util.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "third_party/WebKit/public/platform/WebString.h"
|
| #include "third_party/WebKit/public/platform/WebVector.h"
|
| @@ -301,11 +302,19 @@ class PasswordAutofillAgentTest : public ChromeRenderViewTest {
|
| // has been shown to the user. Of course, it hasn't, so a message is never
|
| // sent to the browser on acceptance, and the DCHECK isn't hit (and nothing
|
| // is filled).
|
| - EXPECT_TRUE(autofill_agent_->password_autofill_agent_->ShowSuggestions(
|
| - username_element_));
|
| -
|
| - EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching(
|
| - AutofillHostMsg_ShowPasswordSuggestions::ID));
|
| + //
|
| + // These tests only make sense in the context of not ignoring
|
| + // autocomplete='off', so only test them if the disable autocomplete='off'
|
| + // flag is not enabled.
|
| + // TODO(jww): Remove this function and callers once autocomplete='off' is
|
| + // permanently ignored.
|
| + if (!ShouldIgnoreAutocompleteOffForPasswordFields()) {
|
| + EXPECT_TRUE(autofill_agent_->password_autofill_agent_->ShowSuggestions(
|
| + username_element_));
|
| +
|
| + EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching(
|
| + AutofillHostMsg_ShowPasswordSuggestions::ID));
|
| + }
|
| }
|
|
|
| void SimulateKeyDownEvent(const WebInputElement& element,
|
|
|