summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/event_sending_controller.cc
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-08 04:13:50 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-08 04:13:50 +0000
commit18d87467f92a84c9535d78a29f3dfae154a0fb05 (patch)
treed5e0b4567a58a5177f8a9584946a2dacd12cc74d /webkit/tools/test_shell/event_sending_controller.cc
parentbd45292e5c21fcb3fef1fd5dfb8207ae29277f8a (diff)
downloadchromium_src-18d87467f92a84c9535d78a29f3dfae154a0fb05.zip
chromium_src-18d87467f92a84c9535d78a29f3dfae154a0fb05.tar.gz
chromium_src-18d87467f92a84c9535d78a29f3dfae154a0fb05.tar.bz2
Fix our version of eventSender to handle keyLocation arg correctly.
BUG=31360 TEST=LayoutTests/fast/events/keydown-numpad-keys.html Review URL: http://codereview.chromium.org/518036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35773 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/event_sending_controller.cc')
-rw-r--r--webkit/tools/test_shell/event_sending_controller.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/event_sending_controller.cc b/webkit/tools/test_shell/event_sending_controller.cc
index 77a27d8..43558dc 100644
--- a/webkit/tools/test_shell/event_sending_controller.cc
+++ b/webkit/tools/test_shell/event_sending_controller.cc
@@ -219,6 +219,15 @@ bool GetEditCommand(const WebKeyboardEvent& event, std::string* name) {
#endif
}
+// Key event location code introduced in DOM Level 3.
+// See also: http://www.w3.org/TR/DOM-Level-3-Events/#events-keyboardevents
+enum KeyLocationCode {
+ DOM_KEY_LOCATION_STANDARD = 0x00,
+ DOM_KEY_LOCATION_LEFT = 0x01,
+ DOM_KEY_LOCATION_RIGHT = 0x02,
+ DOM_KEY_LOCATION_NUMPAD = 0x03
+};
+
} // anonymous namespace
EventSendingController::EventSendingController(TestShell* shell)
@@ -579,6 +588,14 @@ void EventSendingController::keyDown(
if (needs_shift_key_modifier)
event_down.modifiers |= WebInputEvent::ShiftKey;
+ // See if KeyLocation argument is given.
+ if (args.size() >= 3 && args[2].isNumber()) {
+ int location = args[2].ToInt32();
+ if (location == DOM_KEY_LOCATION_NUMPAD) {
+ event_down.modifiers |= WebInputEvent::IsKeyPad;
+ }
+ }
+
event_char = event_up = event_down;
event_up.type = WebInputEvent::KeyUp;
// EventSendingController.m forces a layout here, with at least one