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

Unified Diff: LayoutTests/fast/events/keyboardevent-repeat.html

Issue 23444080: Implement KeyboardEvent.repeat attribute (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 2 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
Index: LayoutTests/fast/events/keyboardevent-repeat.html
diff --git a/LayoutTests/fast/events/keyboardevent-repeat.html b/LayoutTests/fast/events/keyboardevent-repeat.html
new file mode 100644
index 0000000000000000000000000000000000000000..12681aa97e5cc601ff976b3901b23b0c8961257b
--- /dev/null
+++ b/LayoutTests/fast/events/keyboardevent-repeat.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="help" href="http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent-repeat" />
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+description("Tests KeyboardEvent.repeat attribute");
+
+var lastKeyboardEvent;
+
+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 + ',' +
+ "repeat=" + ev.repeat);
+ }
+}
+
+var textarea = document.createElement("textarea");
+textarea.addEventListener("keydown", recordKeyEvent, false);
+document.body.insertBefore(textarea, document.body.firstChild);
+textarea.focus();
+
+if (window.eventSender) {
+ eventSender.keyDown("a");
+ shouldBeFalse("lastKeyboardEvent.repeat");
+
+ eventSender.keyDown("a", ["autoRepeat"]);
+ shouldBeTrue("lastKeyboardEvent.repeat");
+}
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698