OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../../resources/js-test.js"></script> | |
5 </head> | |
6 <body> | |
7 <p id="description"></p> | |
8 <select id='top'></select> | |
9 <pre id="console"></pre> | |
10 <script> | |
11 description("Tests to ensure that default action does not occur."); | |
12 | |
13 function focusHandler() { | |
14 testFailed('default action should not occur.'); | |
15 } | |
16 | |
17 function test() | |
18 { | |
19 if (window.testRunner) | |
20 testRunner.dumpAsText(); | |
21 | |
22 var node = document.getElementById('top'); | |
23 node.addEventListener('focus', focusHandler, false); | |
Rick Byers
2015/03/05 16:34:18
as an extra sanity check that your test is functio
| |
24 var client = node.getBoundingClientRect(); | |
25 | |
26 var event = document.createEvent("MouseEvents"); | |
Rick Byers
2015/03/05 16:34:18
nit: might as well use the constructor syntax (new
| |
27 event.initMouseEvent("mousedown", true, false, window, | |
28 0, client.left, client.top, client.left, client.top, fa lse, false, false, false, 0, null); | |
29 node.dispatchEvent(event); | |
30 } | |
31 | |
32 test(); | |
33 </script> | |
34 </body> | |
35 </html> | |
OLD | NEW |