| Index: LayoutTests/fast/events/keydown-numlock-standard-location.html
|
| diff --git a/LayoutTests/fast/events/keydown-numlock-standard-location.html b/LayoutTests/fast/events/keydown-numlock-standard-location.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..25d7645f267bed6d24e797b6d79e0a1309c59780
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/events/keydown-numlock-standard-location.html
|
| @@ -0,0 +1,46 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<script src="../js/resources/js-test-pre.js"></script>
|
| +</head>
|
| +<body>
|
| +<script>
|
| +description("Checks that KeyboardEvent.location is DOM_KEY_LOCATION_STANDARD for NumLock key.");
|
| +
|
| +var lastKeyboardEvent = null;
|
| +function recordKeyEvent(ev) {
|
| + ev = ev || event;
|
| + ev.keyCode = (ev.which || ev.keyCode);
|
| + if (window.eventSender) {
|
| + lastKeyboardEvent = ev;
|
| + } else {
|
| + debug('Type=' + ev.type + ',' +
|
| + 'keyCode=' + ev.keyCode + ',' +
|
| + 'ctrlKey=' + ev.ctrlKey + ',' +
|
| + 'shiftKey=' + ev.shiftKey + ',' +
|
| + 'altKey=' + ev.altKey + ',' +
|
| + 'metaKey=' + ev.metaKey + ',' +
|
| + 'location=' + ev.location);
|
| + }
|
| +}
|
| +
|
| +var textarea = document.createElement("textarea");
|
| +textarea.addEventListener("keydown", recordKeyEvent, false);
|
| +document.body.insertBefore(textarea, document.body.firstChild);
|
| +textarea.focus();
|
| +
|
| +var VKEY_NUMLOCK = 0x90;
|
| +
|
| +if (window.eventSender) {
|
| + eventSender.keyDown("numLock");
|
| + shouldBeEqualToString("lastKeyboardEvent.type", "keydown");
|
| + shouldBe("lastKeyboardEvent.keyCode", "VKEY_NUMLOCK");
|
| + shouldBe("lastKeyboardEvent.location", "KeyboardEvent.DOM_KEY_LOCATION_STANDARD");
|
| +} else {
|
| + debug("This test needs window.eventSender to run.");
|
| +}
|
| +
|
| +</script>
|
| +<script src="../js/resources/js-test-post.js"></script>
|
| +</body>
|
| +</html>
|
|
|