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

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

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.h
diff --git a/components/autofill/content/renderer/test_password_autofill_agent.h b/components/autofill/content/renderer/test_password_autofill_agent.h
index 01f5a4b07387e444cc571f07d77320a95c581348..cbd73592989698296c428211ccad164ff9145eec 100644
--- a/components/autofill/content/renderer/test_password_autofill_agent.h
+++ b/components/autofill/content/renderer/test_password_autofill_agent.h
@@ -5,7 +5,11 @@
#ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_TEST_PASSWORD_AUTOFILL_AGENT_H_
#define COMPONENTS_AUTOFILL_CONTENT_RENDERER_TEST_PASSWORD_AUTOFILL_AGENT_H_
+#include <vector>
+
+#include "base/memory/scoped_vector.h"
#include "components/autofill/content/renderer/password_autofill_agent.h"
+#include "ipc/ipc_message.h"
namespace autofill {
@@ -14,12 +18,30 @@ class TestPasswordAutofillAgent : public PasswordAutofillAgent {
explicit TestPasswordAutofillAgent(content::RenderView* render_view);
virtual ~TestPasswordAutofillAgent();
+ // content::RenderViewObserver implementation:
+ virtual bool Send(IPC::Message* message) OVERRIDE;
+
+ // Access messages that would have been sent to the browser.
+ const std::vector<IPC::Message*>& messages() const { return messages_.get(); }
+
+ // Enqueue messages and do not forward them.
+ void pause_messages() { pause_messages_ = true; }
+
+ // Stop enqueuing messages and forward on all received messages.
+ void resume_messages();
+
+ void clear_messages() { messages_.clear(); }
+
private:
// Always returns true. This allows browser tests with "data: " URL scheme to
// work with the password manager.
// PasswordAutofillAgent:
virtual bool OriginCanAccessPasswordManager(
const blink::WebSecurityOrigin& origin) OVERRIDE;
+
+ ScopedVector<IPC::Message> messages_;
+
+ bool pause_messages_;
};
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698