|
1 <!doctype html> |
|
2 <html> |
|
3 <head> |
|
4 <title>Test for Bug 854082</title> |
|
5 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
6 <script type="text/javascript" src="utils.js"></script> |
|
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
8 |
|
9 <meta http-equiv="content-type" content="text/html; charset=utf-8"> |
|
10 <base href="chrome://browser/content/"> |
|
11 </head> |
|
12 <body> |
|
13 <script type="application/javascript"> |
|
14 // Tests that destroying the plugin's frame inside NPP_New does not cause a |
|
15 // crash |
|
16 |
|
17 SimpleTest.waitForExplicitFinish(); |
|
18 setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); |
|
19 |
|
20 // Create an object that will spawn asynchronously |
|
21 var o = document.createElement("object"); |
|
22 o.type = "application/x-test"; |
|
23 |
|
24 // The test plugin sets pluginFoundElement on its element inside NPP_New, |
|
25 // abuse this to run arbitrary script. |
|
26 var setterCalled; |
|
27 o.__defineSetter__("pluginFoundElement", function() { |
|
28 o.style.display = "none"; |
|
29 // Access clientTop to force layout flush |
|
30 o.clientTop; |
|
31 setterCalled = true; |
|
32 }); |
|
33 document.body.appendChild(o); |
|
34 |
|
35 SimpleTest.executeSoon(function() { |
|
36 ok(setterCalled, "Setter called and did not crash"); |
|
37 SimpleTest.finish(); |
|
38 }); |
|
39 </script> |
|
40 </body> |
|
41 </html> |