Chromium Code Reviews| 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..cf5387c40258242d84a9b14aef2d553cc0f2959d |
| --- /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 requires DumpRenderTree."); |
|
tkent
2013/08/25 22:29:34
nit: No DRT any more.
|
| +} |
| + |
| +</script> |
| +<script src="../js/resources/js-test-post.js"></script> |
| +</body> |
| +</html> |