Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / events / keydown-keypress-focus-change.html
1 <html>
2 <script>
3     function test() {
4         if (window.testRunner) {
5             testRunner.dumpAsText();
6             testRunner.waitUntilDone();
7         }
8         setTimeout(test2, 0);
9     }
10     function test2() {
11         document.getElementById('tf0').focus();
12         eventSender.keyDown('a');
13         if (window.testRunner)
14             testRunner.notifyDone();
15     }
16     function log(msg) {
17         var res = document.getElementById('res');
18         res.innerHTML = res.innerHTML + msg + "<br>";
19     }
20
21 </script> 
22 <body onload="test()">
23     This tests that when the keydown event changes focus, the keypress event will go to the new focused node.<br>
24     To run this test manually, type a character in the first field.<br>
25     <input id="tf0" onkeydown="document.getElementById('tf1').focus()" onkeypress="log('Test Failed')">
26     <input id="tf1" onkeypress="log('Test Passed')">
27     <br>
28     <div id="res"></div>
29 </body>
30 </html>