| Index: LayoutTests/fast/events/script-tests/keydown-numpad-keys.js
|
| diff --git a/LayoutTests/fast/events/script-tests/keydown-numpad-keys.js b/LayoutTests/fast/events/script-tests/keydown-numpad-keys.js
|
| index 70a34d41f75d83e5938cbed877f4dac4bf12e298..cc8c71b8e0bd66166feec0609ec99efcf80bd24c 100644
|
| --- a/LayoutTests/fast/events/script-tests/keydown-numpad-keys.js
|
| +++ b/LayoutTests/fast/events/script-tests/keydown-numpad-keys.js
|
| @@ -19,7 +19,7 @@ function recordKeyEvent(ev) {
|
| }
|
|
|
| function testKeyEventWithLocation(evString, evLocation, expectedKeyCode) {
|
| - eventSender.keyDown(evString, [], evLocation);
|
| + eventSender.keyDown(evString, [], eval(evLocation));
|
| shouldBe("lastKeyboardEvent.type", '"keydown"');
|
| shouldEvaluateTo("lastKeyboardEvent.keyCode", expectedKeyCode);
|
| shouldEvaluateTo("lastKeyboardEvent.location", evLocation);
|
| @@ -31,29 +31,27 @@ document.body.insertBefore(textarea, document.body.firstChild);
|
| textarea.focus();
|
|
|
| if (window.eventSender) {
|
| - // location=0 indicates that we send events as standard keys.
|
| - testKeyEventWithLocation("pageUp", 0, 33);
|
| - testKeyEventWithLocation("pageDown", 0, 34);
|
| - testKeyEventWithLocation("home", 0, 36);
|
| - testKeyEventWithLocation("end", 0, 35);
|
| - testKeyEventWithLocation("leftArrow", 0, 37);
|
| - testKeyEventWithLocation("rightArrow", 0, 39);
|
| - testKeyEventWithLocation("upArrow", 0, 38);
|
| - testKeyEventWithLocation("downArrow", 0, 40);
|
| - testKeyEventWithLocation("insert", 0, 45);
|
| - testKeyEventWithLocation("delete", 0, 46);
|
| + testKeyEventWithLocation("pageUp", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD", 33);
|
| + testKeyEventWithLocation("pageDown", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD", 34);
|
| + testKeyEventWithLocation("home", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD", 36);
|
| + testKeyEventWithLocation("end", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD", 35);
|
| + testKeyEventWithLocation("leftArrow", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD", 37);
|
| + testKeyEventWithLocation("rightArrow", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD", 39);
|
| + testKeyEventWithLocation("upArrow", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD", 38);
|
| + testKeyEventWithLocation("downArrow", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD", 40);
|
| + testKeyEventWithLocation("insert", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD", 45);
|
| + testKeyEventWithLocation("delete", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD", 46);
|
|
|
| - // location=3 indicates that we send events as numeric-pad keys.
|
| - testKeyEventWithLocation("pageUp", 3, 33);
|
| - testKeyEventWithLocation("pageDown", 3, 34);
|
| - testKeyEventWithLocation("home", 3, 36);
|
| - testKeyEventWithLocation("end", 3, 35);
|
| - testKeyEventWithLocation("leftArrow", 3, 37);
|
| - testKeyEventWithLocation("rightArrow", 3, 39);
|
| - testKeyEventWithLocation("upArrow", 3, 38);
|
| - testKeyEventWithLocation("downArrow", 3, 40);
|
| - testKeyEventWithLocation("insert", 3, 45);
|
| - testKeyEventWithLocation("delete", 3, 46);
|
| + testKeyEventWithLocation("pageUp", "KeyboardEvent.DOM_KEY_LOCATION_NUMPAD", 33);
|
| + testKeyEventWithLocation("pageDown", "KeyboardEvent.DOM_KEY_LOCATION_NUMPAD", 34);
|
| + testKeyEventWithLocation("home", "KeyboardEvent.DOM_KEY_LOCATION_NUMPAD", 36);
|
| + testKeyEventWithLocation("end", "KeyboardEvent.DOM_KEY_LOCATION_NUMPAD", 35);
|
| + testKeyEventWithLocation("leftArrow", "KeyboardEvent.DOM_KEY_LOCATION_NUMPAD", 37);
|
| + testKeyEventWithLocation("rightArrow", "KeyboardEvent.DOM_KEY_LOCATION_NUMPAD", 39);
|
| + testKeyEventWithLocation("upArrow", "KeyboardEvent.DOM_KEY_LOCATION_NUMPAD", 38);
|
| + testKeyEventWithLocation("downArrow", "KeyboardEvent.DOM_KEY_LOCATION_NUMPAD", 40);
|
| + testKeyEventWithLocation("insert", "KeyboardEvent.DOM_KEY_LOCATION_NUMPAD", 45);
|
| + testKeyEventWithLocation("delete", "KeyboardEvent.DOM_KEY_LOCATION_NUMPAD", 46);
|
| } else {
|
| - debug("This test requires DumpRenderTree. To manually test, 1) focus on the textarea above and push numpad keys without locking NumLock and 2) see if the location= value is 3 (DOM_KEY_LOCATION_NUMPAD specified in DOM level 3).");
|
| + debug("This test requires DumpRenderTree. To manually test, 1) focus on the textarea above and push numpad keys without locking NumLock and 2) see if the location= value is KeyboardEvent.DOM_KEY_LOCATION_NUMPAD (specified in DOM level 3).");
|
| }
|
|
|