andersca | 2b1d066 | 2007-06-14 21:43:03 +0000 | [diff] [blame] | 1 | <html> |
| 2 | <script> |
| 3 | function runTest() |
| 4 | { |
rniwa@webkit.org | 5cf7fa8 | 2012-06-15 07:38:37 +0000 | [diff] [blame] | 5 | if (window.testRunner) |
| 6 | testRunner.dumpAsText(); |
andersca | 2b1d066 | 2007-06-14 21:43:03 +0000 | [diff] [blame] | 7 | |
| 8 | var successCount = 0; |
| 9 | var plugin = document.getElementById("testPlugin"); |
| 10 | plugin.logDestroy = true; |
| 11 | |
| 12 | var testObject = plugin.testObject; |
| 13 | plugin.parentNode.removeChild(plugin); |
| 14 | |
| 15 | try { |
| 16 | testObject.property; |
| 17 | } catch (e) { |
| 18 | if (e instanceof ReferenceError) |
| 19 | successCount++; |
| 20 | } |
| 21 | |
| 22 | try { |
| 23 | testObject.property = 'hello'; |
| 24 | } catch (e) { |
| 25 | if (e instanceof ReferenceError) |
| 26 | successCount++; |
| 27 | } |
| 28 | |
| 29 | if (successCount == 2) |
| 30 | document.getElementById('result').innerHTML = 'SUCCESS'; |
| 31 | } |
| 32 | |
| 33 | </script> |
| 34 | |
| 35 | <body onload="runTest();"> |
| 36 | This tests that accessing plug-in script objects from a destroyed plugin cause throws the right exceptions. |
| 37 | <div id="result">FAILURE</div> |
| 38 | <embed id="testPlugin" type="application/x-webkit-test-netscape" width="200" height="200"></embed> |
| 39 | </body> |
| 40 | </html> |