|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <title>Test removing an instance's DOM node</title> |
|
5 <script type="text/javascript" src="/MochiKit/packed.js"></script> |
|
6 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
7 <script type="text/javascript" src="utils.js"></script> |
|
8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
9 </head> |
|
10 <body onload="startTest()"> |
|
11 <script type="application/javascript;version=1.8"> |
|
12 SimpleTest.waitForExplicitFinish(); |
|
13 setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); |
|
14 |
|
15 var destroyed = false; |
|
16 function onDestroy() { |
|
17 destroyed = true; |
|
18 } |
|
19 |
|
20 function checkPluginAlreadyDestroyed() { |
|
21 is(destroyed, true, "Plugin instance should have been destroyed."); |
|
22 SimpleTest.finish(); |
|
23 } |
|
24 |
|
25 function startTest() { |
|
26 var p1 = document.getElementById('plugin1'); |
|
27 var d1 = document.getElementById('div1'); |
|
28 |
|
29 p1.callOnDestroy(onDestroy); |
|
30 |
|
31 setTimeout(checkPluginAlreadyDestroyed, 0); |
|
32 |
|
33 d1.removeChild(p1); |
|
34 } |
|
35 </script> |
|
36 |
|
37 <p id="display"></p> |
|
38 |
|
39 <div id="div1"> |
|
40 <embed id="plugin1" type="application/x-test" width="200" height="200"></embed> |
|
41 </div> |
|
42 </body> |
|
43 </html> |