OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 |
| 3 <head> |
| 4 <script src="npapi.js"></script> |
| 5 </head> |
| 6 |
| 7 |
| 8 <body> |
| 9 <div id="statusPanel" style="border: 1px solid red; width: 100%"> |
| 10 Test running.... |
| 11 </div> |
| 12 |
| 13 |
| 14 NPObject Delete in Deallocate<p> |
| 15 |
| 16 Tests the case where deallocation of an NPObject belonging to the plugin |
| 17 triggers scripting which causes the whole plugin to be torn down, and verifies |
| 18 that the object being deallocated is not deallocated a second time. |
| 19 |
| 20 <embed type="application/vnd.npapi-test" |
| 21 src="foo" |
| 22 name="delete_plugin_in_deallocate_test" |
| 23 id="delete_plugin_in_deallocate_test" |
| 24 mode="np_embed"> |
| 25 <script> |
| 26 |
| 27 function setTestObject(object) { |
| 28 window.testObject = object; |
| 29 setTimeout("deleteTestObject()", 0); |
| 30 var statusPanel = document.getElementById("statusPanel"); |
| 31 statusPanel.innerText = "Received test object..."; |
| 32 } |
| 33 |
| 34 function deleteTestObject() { |
| 35 window.testObject = null; |
| 36 var statusPanel = document.getElementById("statusPanel"); |
| 37 statusPanel.innerText = "Deleted test object..."; |
| 38 gc(); |
| 39 } |
| 40 |
| 41 function deletePlugin() { |
| 42 var plugin = document.getElementById("delete_plugin_in_deallocate_test"); |
| 43 if (plugin.parentNode && plugin.parentNode.removeChild) { |
| 44 plugin.parentNode.removeChild(plugin); |
| 45 } |
| 46 } |
| 47 |
| 48 </script> |
| 49 |
| 50 </body> |
| 51 </html> |
OLD | NEW |