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

Unified Diff: components/autofill/content/renderer/test_password_autofill_agent.cc

Issue 166043006: Add password manager autocomplete suggestion when a username element in clicked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed a comment and cleaned up a browser test Created 6 years, 10 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: components/autofill/content/renderer/test_password_autofill_agent.cc
diff --git a/components/autofill/content/renderer/test_password_autofill_agent.cc b/components/autofill/content/renderer/test_password_autofill_agent.cc
index af2a543a308d54f51044fd1f254368e0b1d37e50..e0355cf2e1ede0c37a579cf9e983c515eafc8828 100644
--- a/components/autofill/content/renderer/test_password_autofill_agent.cc
+++ b/components/autofill/content/renderer/test_password_autofill_agent.cc
@@ -8,7 +8,7 @@ namespace autofill {
TestPasswordAutofillAgent::TestPasswordAutofillAgent(
content::RenderView* render_view)
- : PasswordAutofillAgent(render_view) {}
+ : PasswordAutofillAgent(render_view), pause_messages_(false) {}
TestPasswordAutofillAgent::~TestPasswordAutofillAgent() {}
@@ -17,4 +17,18 @@ bool TestPasswordAutofillAgent::OriginCanAccessPasswordManager(
return true;
}
+bool TestPasswordAutofillAgent::Send(IPC::Message* message) {
+ if (pause_messages_) {
+ messages_.push_back(message);
+ return true;
+ }
+
+ return PasswordAutofillAgent::Send(message);
+}
+
+void TestPasswordAutofillAgent::resume_messages() {
+ pause_messages_ = false;
+ clear_messages();
+}
+
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698