test_bug651956.html (1096B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=651956 5 --> 6 <head> 7 <title>Test for Bug 651956</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=651956">Mozilla Bug 651956</a> 14 <p id="display"></p> 15 <div id="content"> 16 <input> 17 </div> 18 <pre id="test"> 19 <script type="application/javascript"> 20 21 /** Test for Bug 651956 */ 22 23 var input = document.getElementsByTagName('input')[0]; 24 25 var gotInputEvent = false; 26 27 input.addEventListener("input", function() { 28 gotInputEvent = true; 29 }, {once: true}); 30 31 input.addEventListener("focus", function() { 32 synthesizeKey("KEY_Escape"); 33 34 setTimeout(function() { 35 ok(!gotInputEvent, "No input event should have been sent."); 36 SimpleTest.finish(); 37 }); 38 }, {once: true}); 39 40 SimpleTest.waitForExplicitFinish(); 41 SimpleTest.waitForFocus(function() { 42 input.focus(); 43 }); 44 45 </script> 46 </pre> 47 </body> 48 </html>