test_tearoff_with_cc.html (1529B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1288228 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 1288228</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 <script type="application/javascript"> 12 /** Test for Bug 1288228 */ 13 /* Note: the crash in bug 1288228 doesn't happen reliably (and only happens 14 * after several reloads). So, we reload the iframe 10 times, and then call 15 * it good if we haven't crashed. 16 */ 17 const maxReloads = 10; 18 let remainingReloads = maxReloads; 19 20 /* The helper-file in the iframe will notify us after it's performed its 21 * potentially-crash-triggering tweak. At that point, we reload the iframe 22 * and wait for it to notify again (or we simply finish, if we've completed 23 * all of the reloads we planned to do). 24 */ 25 window.addEventListener("message", reloadIframe); 26 27 function reloadIframe() { 28 if (--remainingReloads == 0) { 29 ok(true, "Didn't crash!"); 30 SimpleTest.finish(); 31 } else { 32 var frame = document.getElementById("testIframe"); 33 frame.setAttribute("src", ""); 34 frame.setAttribute("src", "tearoff_with_cc_helper.html"); 35 } 36 } 37 SimpleTest.waitForExplicitFinish(); 38 </script> 39 </head> 40 <body onload="reloadIframe()"> 41 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1288228"> 42 Mozilla Bug 1288228 43 </a> 44 <p id="display"> 45 <iframe id="testIframe"></iframe> 46 </p> 47 </body> 48 </html>