| OLD | NEW |
| 1 | 1 |
| 2 <script src="../../resources/js-test.js"></script> | 2 <script src="../../resources/js-test.js"></script> |
| 3 </head> | 3 </head> |
| 4 <script> | 4 <script> |
| 5 var subframe; | 5 var subframe; |
| 6 var testObject; | 6 var testObject; |
| 7 | 7 |
| 8 function runTest() { | 8 function runTest() { |
| 9 subframe = document.getElementById('subframe'); | 9 subframe = document.getElementById('subframe'); |
| 10 subframe.contentWindow.document.documentElement.innerHTML = '<embed id="plug
in" type="application/x-webkit-test-netscape" test="npruntime-object-from-destro
yed-plugin"></embed>'; | 10 subframe.contentWindow.document.documentElement.innerHTML = '<embed id="plug
in" type="application/x-webkit-test-netscape" test="npruntime-object-from-destro
yed-plugin"></embed>'; |
| 11 | 11 |
| 12 var plugin = subframe.contentWindow.document.getElementById('plugin'); | 12 var plugin = subframe.contentWindow.document.getElementById('plugin'); |
| 13 | 13 |
| 14 // Get a reference to the plug-in test object. | 14 // Get a reference to the plugin test object. |
| 15 testObject = plugin.testObject; | 15 testObject = plugin.testObject; |
| 16 | 16 |
| 17 plugin.evaluate('window.top.subframe.parentNode.removeChild(window.top.subfr
ame)') | 17 plugin.evaluate('window.top.subframe.parentNode.removeChild(window.top.subfr
ame)') |
| 18 | 18 |
| 19 // testObject is now a dangling object and every operation on it should thro
w. | 19 // testObject is now a dangling object and every operation on it should thro
w. |
| 20 shouldThrow('testObject.gettingProperty'); | 20 shouldThrow('testObject.gettingProperty'); |
| 21 shouldThrow('testObject.settingProperty = 10'); | 21 shouldThrow('testObject.settingProperty = 10'); |
| 22 shouldThrow('testObject()'); | 22 shouldThrow('testObject()'); |
| 23 shouldThrow('new testObject();') | 23 shouldThrow('new testObject();') |
| 24 } | 24 } |
| 25 | 25 |
| 26 </script> | 26 </script> |
| 27 <body onLoad="runTest()"> | 27 <body onLoad="runTest()"> |
| 28 <p id="description"></p> | 28 <p id="description"></p> |
| 29 <iframe id="subframe"></iframe> | 29 <iframe id="subframe"></iframe> |
| 30 <div id="console"></div> | 30 <div id="console"></div> |
| 31 | 31 |
| 32 <script> | 32 <script> |
| 33 description("Test various operation on an NPObject whose plug-in (that lives in
a subframe) has been destroyed"); | 33 description("Test various operation on an NPObject whose plugin (that lives in a
subframe) has been destroyed"); |
| 34 | 34 |
| 35 </script> | 35 </script> |
| OLD | NEW |