Index: LayoutTests/fast/events/keydown-enter-key-on-focused-element-inside-link.html |
diff --git a/LayoutTests/fast/events/keydown-enter-key-on-focused-element-inside-link.html b/LayoutTests/fast/events/keydown-enter-key-on-focused-element-inside-link.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a1ad01a94128549aa22236b8e54fff62f5412e19 |
--- /dev/null |
+++ b/LayoutTests/fast/events/keydown-enter-key-on-focused-element-inside-link.html |
@@ -0,0 +1,22 @@ |
+<!DOCTYPE html> |
robwu
2014/10/13 09:19:48
This file should be renamed to "keypress-enter....
Miyoung Shin(g)
2014/10/13 11:05:01
Oh, right, I will change it
|
+<script src="../../resources/js-test.js"></script> |
+<a id="link" href="#" tabindex="-1" onclick="checkKeyEvent(event)"> |
+ <h1 tabindex="1">EnterMe</h1> |
+</a> |
+<div id="console"></div> |
+<script> |
+ description("This test ensures that the link is activated by enter key on focusing the child element inside the anchor"); |
+ |
+ var i = 0; |
+ function test() { |
+ if (window.eventSender) |
+ eventSender.keyDown('\t'); |
+ var event = document.createEvent("KeyboardEvents"); |
+ event.initKeyboardEvent("keypress", true, true, window, "Enter", 0, 0, 0, 0, 0, false); |
+ document.activeElement.dispatchEvent(event); |
robwu
2014/10/13 09:19:48
You should also be simulating the keydown/keyup ev
Miyoung Shin(g)
2014/10/13 11:05:01
OK. I will add keydown/keyup as well
robwu
2014/10/13 11:29:32
The test code in the following files suggest that
|
+ } |
+ function checkKeyEvent(event) { |
+ debug("PASS : [" + document.activeElement.localName + "], link is activated") |
+ } |
+ test(); |
+</script> |