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> |