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..50ff77fc2a38dac1d5e3833bdd14b42628831263 100644 |
--- a/content/public/test/browser_test_utils.h |
+++ b/content/public/test/browser_test_utils.h |
@@ -79,13 +79,38 @@ 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 InvalidNativeKeycode(). |
+// |key_code| alone is good enough for scenarios that only need the char |
+// value represented by a key event and not the physical key on the keyboard |
+// or the keyboard layout. |
+// For scenarios such as chromoting that need the native code, |
+// SimulateKeyPressWithCode should be used. |
void SimulateKeyPress(WebContents* web_contents, |
- ui::KeyboardCode key, |
+ ui::KeyboardCode key_code, |
bool control, |
bool shift, |
bool alt, |
bool command); |
+// Sends a key press asynchronously. |
+// |code| specifies the UIEvents (aka: DOM4Events) value of the key: |
+// https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm |
+// The native code of the key event will be set based on |code|. |
+// See ui/base/keycodes/vi usb_keycode_map.h for mappings between |code| |
+// and the native code. |
+// Examples of the various codes: |
+// key_code: VKEY_A |
+// code: "KeyA" |
+// native key code: 0x001e (for Windows). |
+// native key code: 0x0026 (for Linux). |
+void SimulateKeyPressWithCode(WebContents* web_contents, |
+ ui::KeyboardCode key_code, |
+ 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 |