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

Unified Diff: LayoutTests/fast/events/keydown-numlock-standard-location.html

Issue 22831043: KeyboardEvent.location should be DOM_KEY_LOCATION_STANDARD for Num Lock key (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove mention of DRT Created 7 years, 4 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 | « no previous file | LayoutTests/fast/events/keydown-numlock-standard-location-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/fast/events/keydown-numlock-standard-location-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698