3 <body onload=
"test();">
5 <input id=
"input-box"></input>
6 <embed id=
"plugin" type=
"application/x-webkit-test-webplugin" supports-keyboard-focus=
"true" contentEditable=
"false"></embed>
9 function focusPluginByTabKeypress() {
10 var inputBox
= document
.getElementById('input-box');
12 eventSender
.keyDown('\t');
15 var seenKeyup
= false;
19 // Change focus one more time to make sure we don't see any keypress events.
20 focusPluginByTabKeypress();
22 testRunner
.notifyDone();
26 function onKeypress(e
) {
27 console
.log('FAIL: Unexpected keypress event');
28 testRunner
.notifyDone();
32 if (!window
.testRunner
|| !window
.eventSender
) {
33 document
.write("This test does not work in manual mode.");
35 testRunner
.waitUntilDone();
36 testRunner
.dumpAsText();
38 // We will press tab to move the focus from <input> to the plugin.
39 // We verify that the plugin only sees keyup events, not any keypress.
40 var plugin
= document
.getElementById('plugin');
41 plugin
.onkeyup
= onKeyup
;
42 plugin
.onkeypress
= onKeypress
;
43 focusPluginByTabKeypress();