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

Unified Diff: chrome/renderer/autofill/password_autofill_agent_browsertest.cc

Issue 563313004: [Password Manager] Unfriend PasswordAutofillAgentTest from PasswordAutofillAgent (clean-up). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated review comments. Created 6 years, 3 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: 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 f17aeb63127b985df577ec84794cf32e049e6e99..9c450a24504cf2b0b10f84e8f952a78d1f25af57 100644
--- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
@@ -9,6 +9,7 @@
#include "components/autofill/content/renderer/autofill_agent.h"
#include "components/autofill/content/renderer/form_autofill_util.h"
#include "components/autofill/content/renderer/password_autofill_agent.h"
+#include "components/autofill/content/renderer/test_autofill_agent.h"
#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"
@@ -278,7 +279,7 @@ class PasswordAutofillAgentTest : public ChromeRenderViewTest {
if (move_caret_to_end)
input.setSelectionRange(new_value.length(), new_value.length());
if (is_user_input)
- password_autofill_agent()->FirstUserGestureObserved();
+ password_autofill_->FirstUserGestureObserved();
autofill_agent_->textFieldDidChange(input);
// Processing is delayed because of a Blink bug:
// https://bugs.webkit.org/show_bug.cgi?id=16976
@@ -345,7 +346,7 @@ class PasswordAutofillAgentTest : public ChromeRenderViewTest {
// permanently ignored.
if (!ShouldIgnoreAutocompleteOffForPasswordFields()) {
EXPECT_TRUE(
- password_autofill_agent()->ShowSuggestions(username_element_, false));
+ password_autofill_->ShowSuggestions(username_element_, false));
EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching(
AutofillHostMsg_ShowPasswordSuggestions::ID));
@@ -457,10 +458,6 @@ class PasswordAutofillAgentTest : public ChromeRenderViewTest {
render_thread_->sink().ClearMessages();
}
- PasswordAutofillAgent* password_autofill_agent() {
- return autofill_agent_->password_autofill_agent_;
- }
-
void ExpectFormSubmittedWithPasswords(const std::string& password_value,
const std::string& new_password_value) {
const IPC::Message* message =
@@ -1508,7 +1505,7 @@ TEST_F(PasswordAutofillAgentTest,
// Simulate that the password value was cleared by the site's JavaScript
// before submit.
password_element_.setValue(WebString());
- static_cast<content::RenderViewObserver*>(password_autofill_agent())
+ static_cast<content::RenderViewObserver*>(password_autofill_)
->WillSubmitForm(GetMainFrame(), username_element_.form());
// Observe that the PasswordAutofillAgent still remembered the last non-empty
@@ -1529,7 +1526,7 @@ TEST_F(PasswordAutofillAgentTest,
// Simulate that the user actually cleared the password again.
SimulateInputChangeForElement(
"", true, GetMainFrame(), password_element_, true);
- static_cast<content::RenderViewObserver*>(password_autofill_agent())
+ static_cast<content::RenderViewObserver*>(password_autofill_)
->WillSubmitForm(GetMainFrame(), username_element_.form());
// Observe that the PasswordAutofillAgent respects the user having cleared the
@@ -1558,7 +1555,7 @@ TEST_F(PasswordAutofillAgentTest,
// Simulate that the password value was cleared by the site's JavaScript
// before submit.
password_element_.setValue(WebString());
- static_cast<content::RenderViewObserver*>(password_autofill_agent())
+ static_cast<content::RenderViewObserver*>(password_autofill_)
->WillSubmitForm(GetMainFrame(), username_element_.form());
// Observe that the PasswordAutofillAgent still remembered the last non-empty

Powered by Google App Engine
This is Rietveld 408576698