|
1 <head> |
|
2 <title>Plugin crashing in nested loop</title> |
|
3 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
4 <script type="application/javascript" src="utils.js"></script> |
|
5 |
|
6 <body> |
|
7 <script class="testbody" type="application/javascript"> |
|
8 SimpleTest.waitForExplicitFinish(); |
|
9 setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); |
|
10 |
|
11 window.frameLoaded = function frameLoaded_toCrash() { |
|
12 if (!SimpleTest.testPluginIsOOP()) { |
|
13 ok(true, "Skipping this test when test plugin is not OOP."); |
|
14 SimpleTest.finish(); |
|
15 return; |
|
16 } |
|
17 |
|
18 var iframe = document.getElementById('iframe1'); |
|
19 var p = iframe.contentDocument.getElementById('plugin1'); |
|
20 |
|
21 // This test is for bug 550026, which is inherently nondeterministic. |
|
22 // If we hit that bug, the browser process would crash when the plugin |
|
23 // crashes in crashInNestedLoop. If not, we'll pass "spuriously". |
|
24 try { |
|
25 p.crashInNestedLoop(); |
|
26 // The plugin didn't crash when expected. This happens sometimes. Give |
|
27 // it longer to crash. If it crashes (but not at the apropriate time), |
|
28 // soft fail with a todo; if it doesn't crash then something went wrong, |
|
29 // so fail. |
|
30 setTimeout( |
|
31 function() { |
|
32 try { |
|
33 p.getPaintCount(); |
|
34 ok(false, "plugin should crash"); |
|
35 } catch (e) { |
|
36 todo(false, "p.crashInNestedLoop() should throw an exception"); |
|
37 } |
|
38 |
|
39 SimpleTest.finish(); |
|
40 }, |
|
41 1000); |
|
42 } |
|
43 catch (e) { |
|
44 ok(true, "p.crashInNestedLoop() should throw an exception"); |
|
45 SimpleTest.finish(); |
|
46 } |
|
47 |
|
48 } |
|
49 |
|
50 </script> |
|
51 <iframe id="iframe1" src="crashing_subpage.html" width="600" height="600"></iframe> |