| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script> | |
| 5 function runTest() | |
| 6 { | |
| 7 // Make the plugin retrieve a DOM element to itself. This exercises | |
| 8 // https://bugs.webkit.org/show_bug.cgi?id=80428 | |
| 9 document.getElementById("testPlugin").testDOMAccess(); | |
| 10 | |
| 11 var callReload = true; | |
| 12 if (window.sessionStorage) { | |
| 13 if (window.sessionStorage.netscapeDomAccessAndReloadHasReloaded) | |
| 14 callReload = false; | |
| 15 else | |
| 16 window.sessionStorage.netscapeDomAccessAndReloadHasReloaded = 1; | |
| 17 } | |
| 18 | |
| 19 if (window.testRunner) | |
| 20 testRunner.dumpAsText(); | |
| 21 | |
| 22 if (callReload) { | |
| 23 if (window.testRunner) | |
| 24 testRunner.waitUntilDone(); | |
| 25 location.reload(); | |
| 26 } else { | |
| 27 window.GCController.collect(); | |
| 28 // Note we could also collect the number of live nodes, but that seems | |
| 29 // more likely to give spurious failures. When an HTMLPluginElement is | |
| 30 // improperly retained, its owning Document also survives, so we'll | |
| 31 // detect an excess Document. | |
| 32 if (internals && internals.numberOfLiveDocuments) { | |
| 33 var numberOfLiveDocuments = internals.numberOfLiveDocuments(); | |
| 34 if (numberOfLiveDocuments == 1) { | |
| 35 document.getElementById("result").innerHTML = "SUCCESS"; | |
| 36 } | |
| 37 } else { | |
| 38 document.getElementById("result").innerHTML = "FAILED; This test i
s only valid in DumpRenderTree, and only when the Inspector is enabled."; | |
| 39 } | |
| 40 if (window.testRunner) { | |
| 41 testRunner.dumpAsText(); | |
| 42 testRunner.notifyDone(); | |
| 43 } | |
| 44 } | |
| 45 } | |
| 46 </script> | |
| 47 </head> | |
| 48 <body onload="runTest();"> | |
| 49 <p>This page tests reloading a Netscape plugin that accesses its own DOM element
. See https://bugs.webkit.org/show_bug.cgi?id=80428, "HTMLPluginElement is not d
estroyed on reload or navigation if getNPObject is called". | |
| 50 | |
| 51 If it succeeds, you should see SUCCESS below. | |
| 52 <embed id="testPlugin" type="application/x-webkit-test-netscape" width="200" hei
ght="200"></embed> | |
| 53 <div id="result">FAILURE</div> | |
| 54 </body> | |
| 55 </html> | |
| OLD | NEW |