| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <script type="text/javascript"> | |
| 4 if (window.testRunner) { | |
| 5 testRunner.dumpAsText(); | |
| 6 testRunner.waitUntilDone(); | |
| 7 } | |
| 8 | |
| 9 | |
| 10 function runTest() { | |
| 11 var p = document.getElementById('plg'); | |
| 12 var iframe = document.getElementById('frame-id'); | |
| 13 p.remember(iframe.contentWindow); | |
| 14 | |
| 15 var someObject = {a: 1, b: 2}; | |
| 16 // Load another page in iframe, so plugin keeps reference to old frame's con
tentWindow. | |
| 17 iframe.onload = function() { | |
| 18 // This will trigger Release Object for previously remembered reference. | |
| 19 p.remember(someObject); | |
| 20 document.getElementById('result').innerHTML = 'SUCCESS'; | |
| 21 if (window.testRunner) | |
| 22 testRunner.notifyDone(); | |
| 23 }; | |
| 24 iframe.src = 'resources/empty2.html'; | |
| 25 } | |
| 26 | |
| 27 </script> | |
| 28 <body> | |
| 29 <embed id="plg" type="application/x-webkit-test-netscape"></embed><P> | |
| 30 <iframe id="frame-id" src="resources/empty.html" onload='runTest()'></iframe> | |
| 31 <div>This tests that releasing a reference to a contentWindow that has already b
een navigated away works correctly and does not crash. If this test is successfu
l, the word SUCCESS should be seen below.</div> | |
| 32 <div id="result">FAILED</div> | |
| 33 </body> | |
| 34 </html> | |
| 35 | |
| OLD | NEW |