Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / keydown-keypress-focus-change.html
blob8bb26e68d1ec63fac000b59101cb5ba16e55d66d
1 <html>
2 <script>
3 function test() {
4 if (window.testRunner) {
5 testRunner.dumpAsText();
6 testRunner.waitUntilDone();
8 setTimeout(test2, 0);
10 function test2() {
11 document.getElementById('tf0').focus();
12 eventSender.keyDown('a');
13 if (window.testRunner)
14 testRunner.notifyDone();
16 function log(msg) {
17 var res = document.getElementById('res');
18 res.innerHTML = res.innerHTML + msg + "<br>";
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>