summaryrefslogtreecommitdiffstats
path: root/content/public/test/render_view_test.h
diff options
context:
space:
mode:
authorrouslan <rouslan@chromium.org>2015-04-27 18:00:01 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-28 01:00:02 +0000
commit6a3f8d9afcbb397f562e3a359ffbe39d59d278b9 (patch)
treea00e18a07a30bf38e399277e81d7a2fb0db40bfb /content/public/test/render_view_test.h
parent992492e66abc07139da9b20aaccf405ca8866586 (diff)
downloadchromium_src-6a3f8d9afcbb397f562e3a359ffbe39d59d278b9.zip
chromium_src-6a3f8d9afcbb397f562e3a359ffbe39d59d278b9.tar.gz
chromium_src-6a3f8d9afcbb397f562e3a359ffbe39d59d278b9.tar.bz2
[autofill] Allow only a user gesture to trigger autofill.
If a script inserts text into an input field without a user gesture, then do not show the autofill popup. TEST=AutofillRendererTest.IgnoreNonUserGestureTextFieldChanges BUG=353001 Review URL: https://codereview.chromium.org/1026493002 Cr-Commit-Position: refs/heads/master@{#327204}
Diffstat (limited to 'content/public/test/render_view_test.h')
-rw-r--r--content/public/test/render_view_test.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/content/public/test/render_view_test.h b/content/public/test/render_view_test.h
index d3fd776..91d0df6 100644
--- a/content/public/test/render_view_test.h
+++ b/content/public/test/render_view_test.h
@@ -22,6 +22,7 @@
struct ViewMsg_Resize_Params;
namespace blink {
+class WebInputElement;
class WebWidget;
}
@@ -99,7 +100,7 @@ class RenderViewTest : public testing::Test {
void SendWebKeyboardEvent(const blink::WebKeyboardEvent& key_event);
// Send a raw mouse event to the renderer.
- void SendWebMouseEvent(const blink::WebMouseEvent& key_event);
+ void SendWebMouseEvent(const blink::WebMouseEvent& mouse_event);
// Returns the bounds (coordinates and size) of the element with id
// |element_id|. Returns an empty rect if such an element was not found.
@@ -130,6 +131,18 @@ class RenderViewTest : public testing::Test {
gfx::Rect resizer_rect,
bool is_fullscreen);
+ // Simulates typing the |ascii_character| into this render view. Also accepts
+ // ui::VKEY_BACK for backspace. Will flush the message loop if
+ // |flush_message_loop| is true.
+ void SimulateUserTypingASCIICharacter(char ascii_character,
+ bool flush_message_loop);
+
+ // Simulates user focusing |input|, erasing all text, and typing the
+ // |new_value| instead. Will process input events for autofill. This is a user
+ // gesture.
+ void SimulateUserInputChangeForElement(blink::WebInputElement* input,
+ const std::string& new_value);
+
// These are all methods from RenderViewImpl that we expose to testing code.
bool OnMessageReceived(const IPC::Message& msg);
void DidNavigateWithinPage(blink::WebLocalFrame* frame,