test_bug412567.html (1216B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=412567 5 --> 6 <head> 7 <title>Test for Bug 412567</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 10 </head> 11 <body onload="testRedispatching(event);"> 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=412567">Mozilla Bug 412567</a> 13 <p id="display"></p> 14 <div id="content" style="display: none" onload="redispatchinHandler(event)"> 15 16 </div> 17 <pre id="test"> 18 <script class="testbody" type="text/javascript"> 19 20 /** Test for Bug 412567 */ 21 22 var loadEvent = null; 23 24 function redispatchinHandler(evt) { 25 is(evt.type, "load", "Wrong event type!"); 26 ok(!evt.isTrusted, "Event should not be trusted!"); 27 SimpleTest.finish(); 28 } 29 30 function redispatch() { 31 ok(loadEvent.isTrusted, "Event should be trusted before redispatching!"); 32 document.getElementById('content').dispatchEvent(loadEvent); 33 } 34 35 function testRedispatching(evt) { 36 is(evt.type, "load", "Wrong event type!"); 37 ok(evt.isTrusted, "Event should be trusted!"); 38 loadEvent = evt; 39 setTimeout(redispatch, 0); 40 } 41 42 SimpleTest.waitForExplicitFinish(); 43 </script> 44 </pre> 45 </body> 46 </html>