test_bug421839-1.html (2086B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=421839 5 --> 6 <head> 7 <title>Test for Bug 421839</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> 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=421839">Mozilla Bug 421839</a> 13 <p id="display"></p> 14 <div id="content" style="display: none"> 15 16 </div> 17 Moving with you mouse from above to below and back a few times across the iframe, shouldn't crash Mozilla<br/> 18 19 <iframe id="iframe" src="data:text/html;charset=utf-8,text%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%0A%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3Etext%3Cbr%3E"></iframe> 20 <pre id="test"> 21 <script type="application/javascript"> 22 23 /** Test for Bug 421839 */ 24 25 var counter = 0; 26 27 SimpleTest.waitForExplicitFinish(); 28 29 var doc = document; 30 if (document.getElementById('iframe')) 31 doc = document.getElementById('iframe').contentDocument; 32 33 function toggleIframe(){ 34 var x=document.getElementById('iframe'); 35 x.style.display = x.style.display == 'none' ? x.style.display = '' : x.style.display = 'none'; 36 setTimeout(toggleIframe,100); 37 38 if (++counter == 4) 39 setTimeout(finish, 200); 40 41 } 42 setTimeout(toggleIframe,100); 43 44 function ctrlclick(i){ 45 var wu = SpecialPowers.getDOMWindowUtils(doc.defaultView); 46 var wu2 = SpecialPowers.getDOMWindowUtils(top); 47 48 try 49 { 50 wu.sendMouseEvent('mousedown', 2*i, 2*i, 0, 1, 0); 51 wu2.sendMouseEvent('mousemove', 500*i, 500*i, 0, 0, 0); 52 //wu.sendMouseEvent('mouseup', 2*i, 2*i, 0, 1, 2); 53 } 54 catch(e) 55 { 56 } 57 58 i+=1; 59 if (i>50) 60 i =0; 61 62 setTimeout(ctrlclick,20,i); 63 64 if (++counter == 4) 65 setTimeout(finish, 200); 66 67 } 68 69 setTimeout(ctrlclick,20,0); 70 71 function finish() 72 { 73 ok(true, "This is a mochikit version of a crash test. To complete is to pass."); 74 SimpleTest.finish(); 75 } 76 </script> 77 </pre> 78 </body> 79 </html>