<html>
<script>
function test() {
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
setTimeout(test2, 0);
}
function test2() {
document.getElementById('tf0').focus();
eventSender.keyDown('a');
if (window.testRunner)
testRunner.notifyDone();
}
function log(msg) {
var res = document.getElementById('res');
res.innerHTML = res.innerHTML + msg + "<br>";
}
</script>
<body onload="test()">
This tests that when the keydown event changes focus, the keypress event will go to the new focused node.<br>
To run this test manually, type a character in the first field.<br>
<input id="tf0" onkeydown="document.getElementById('tf1').focus()" onkeypress="log('Test Failed')">
<input id="tf1" onkeypress="log('Test Passed')">
<br>
<div id="res"></div>
</body>
</html>