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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <link rel="help" href="http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardE vent-repeat" />
5 <script src="../js/resources/js-test-pre.js"></script>
6 </head>
7 <body>
8 <script>
9 description("Tests KeyboardEvent.repeat attribute");
10
11 var lastKeyboardEvent;
12
13 function recordKeyEvent(ev) {
14 ev = ev || event;
15 ev.keyCode = (ev.which || ev.keyCode);
16 if (window.eventSender) {
17 lastKeyboardEvent = ev;
18 } else {
19 debug("Type=" + ev.type + "," +
20 "keyCode=" + ev.keyCode + ',' +
21 "repeat=" + ev.repeat);
22 }
23 }
24
25 var textarea = document.createElement("textarea");
26 textarea.addEventListener("keydown", recordKeyEvent, false);
27 document.body.insertBefore(textarea, document.body.firstChild);
28 textarea.focus();
29
30 if (window.eventSender) {
31 eventSender.keyDown("a");
32 shouldBeFalse("lastKeyboardEvent.repeat");
33
34 eventSender.keyDown("a", ["autoRepeat"]);
35 shouldBeTrue("lastKeyboardEvent.repeat");
36 }
37 </script>
38 <script src="../js/resources/js-test-post.js"></script>
39 </body>
40 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698