test_bug821307.html (1189B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=821307 5 --> 6 <head> 7 <title>Test for Bug 821307</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script src="/tests/SimpleTest/EventUtils.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=821307">Mozilla Bug 821307</a> 14 <p id="display"></p> 15 <div id="content" style="display: none"> 16 </div> 17 18 <input id='dummy'></input> 19 <input type="password" id='input' value='11111111111111111' style="width:40em; font-size:40px;"></input> 20 21 <pre id="test"> 22 <script type="application/javascript"> 23 24 SimpleTest.waitForExplicitFinish(); 25 SimpleTest.waitForFocus(function() { 26 var dummy = document.getElementById('dummy'); 27 dummy.focus(); 28 is(document.activeElement, dummy, "Check dummy element is now focused"); 29 30 var input = document.getElementById('input'); 31 var rect = input.getBoundingClientRect(); 32 synthesizeMouse(input, 100, rect.height/2, {}); 33 is(document.activeElement, input, "Check input element is now focused"); 34 35 SimpleTest.finish(); 36 }); 37 38 </script> 39 </pre> 40 </body> 41 </html>