OLD | NEW |
---|---|
(Empty) | |
1 <!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
| |
2 <script src="../../resources/js-test.js"></script> | |
3 <a id="link" href="#" tabindex="-1" onclick="checkKeyEvent(event)"> | |
4 <h1 tabindex="1">EnterMe</h1> | |
5 </a> | |
6 <div id="console"></div> | |
7 <script> | |
8 description("This test ensures that the link is activated by enter key on fo cusing the child element inside the anchor"); | |
9 | |
10 var i = 0; | |
11 function test() { | |
12 if (window.eventSender) | |
13 eventSender.keyDown('\t'); | |
14 var event = document.createEvent("KeyboardEvents"); | |
15 event.initKeyboardEvent("keypress", true, true, window, "Enter", 0, 0, 0 , 0, 0, false); | |
16 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
| |
17 } | |
18 function checkKeyEvent(event) { | |
19 debug("PASS : [" + document.activeElement.localName + "], link is activa ted") | |
20 } | |
21 test(); | |
22 </script> | |
OLD | NEW |