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

Unified Diff: content/public/test/browser_test_utils.h

Issue 23542008: Add a CodeToNativeKeycode helper that converts UIEvent code to native code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing CR feedback Created 7 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
« no previous file with comments | « no previous file | content/public/test/browser_test_utils.cc » ('j') | content/public/test/browser_test_utils.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/browser_test_utils.h
diff --git a/content/public/test/browser_test_utils.h b/content/public/test/browser_test_utils.h
index 4dce33e2df01ceebc72aab4bc34a01265c7fc7fb..ea8b79c50f9d9d5a2ca409ff9e705fbf15dffa98 100644
--- a/content/public/test/browser_test_utils.h
+++ b/content/public/test/browser_test_utils.h
@@ -79,6 +79,7 @@ void SimulateMouseEvent(WebContents* web_contents,
const gfx::Point& point);
// Sends a key press asynchronously.
+// The native code of the key event will be set to 0.
Wez 2013/09/05 00:16:33 This should be "... will be set to InvalidNativeKe
weitao 2013/09/05 07:49:17 Done.
void SimulateKeyPress(WebContents* web_contents,
ui::KeyboardCode key,
bool control,
@@ -86,6 +87,18 @@ void SimulateKeyPress(WebContents* web_contents,
bool alt,
bool command);
+// Sends a key press asynchronously.
+// The native code of the key event will be set based on |code|.
Wez 2013/09/05 00:16:33 This should refer to the DOM4 UI Events spec, e.g.
weitao 2013/09/05 07:49:17 Done.
+// TODO: should we have an overload that takes only KeyboardCode or
+// |code| and generates the other one based on US keyboard layout?
Wez 2013/09/05 00:16:33 nit: This isn't really a TODO, so I don't think th
weitao 2013/09/05 07:49:17 Done.
+void SimulateKeyPress(WebContents* web_contents,
Wez 2013/09/05 00:16:33 As per style guide, this shouldn't be an override,
weitao 2013/09/05 07:49:17 Done.
+ ui::KeyboardCode key,
+ const char* code,
+ bool control,
+ bool shift,
+ bool alt,
+ bool command);
+
// Allow ExecuteScript* methods to target either a WebContents or a
// RenderViewHost. Targetting a WebContents means executing script in the
// RenderViewHost returned by WebContents::GetRenderViewHost(), which is the
« no previous file with comments | « no previous file | content/public/test/browser_test_utils.cc » ('j') | content/public/test/browser_test_utils.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698