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

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

Issue 2048533002: Add code and key into the browser test key simulation methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix chromeos build Created 4 years, 6 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 | « chrome/test/remoting/remote_desktop_browsertest.cc ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »
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 0bf16be20617d7cfa0226a03de91a2f3ede496c7..c3812dceb81f2ff1fff5f2bb7d0b4e1b4371b48c 100644
--- a/content/public/test/browser_test_utils.h
+++ b/content/public/test/browser_test_utils.h
@@ -27,6 +27,8 @@
#include "ipc/message_filter.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "ui/accessibility/ax_node_data.h"
+#include "ui/events/keycodes/dom/dom_code.h"
+#include "ui/events/keycodes/dom/dom_key.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "url/gurl.h"
@@ -148,38 +150,20 @@ void SimulateTapWithModifiersAt(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| specifies the UIEvents (aka: DOM4Events) value of the key.
+// |code| specifies the UIEvents (aka: DOM4Events) value of the physical key.
// |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::DomKey key,
+ ui::DomCode code,
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 std::string& code,
- bool control,
- bool shift,
- bool alt,
- bool command);
-
// Allow ExecuteScript* methods to target either a WebContents or a
// RenderFrameHost. Targetting a WebContents means executing the script in the
// RenderFrameHost returned by WebContents::GetMainFrame(), which is the
« no previous file with comments | « chrome/test/remoting/remote_desktop_browsertest.cc ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698