layout/generic/test/test_bug421839-1.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial