| <html> | |
| <head> | |
| <script> | |
| if (window.testRunner) { | |
| testRunner.dumpAsText(); | |
| testRunner.waitUntilDone(); | |
| } | |
| function log(msg) { | |
| document.getElementById("log").innerHTML += msg; | |
| } | |
| function gc() { | |
| if (window.GCController) | |
| GCController.collect(); | |
| else { | |
| // Allocate a sufficient number of objects to force a GC. | |
| for (var i = 0; i < 10000; i++) | |
| new Object; | |
| } | |
| } | |
| function test() { | |
| var s = document.createElement("script"); | |
| s.src = "resources/delayed-log.php?delay=1&msg=PASS&done=1"; | |
| s.async = true; | |
| document.body.appendChild(s); | |
| // s should still execute. | |
| document.body.removeChild(s); | |
| setTimeout(gc, 1); | |
| } | |
| </script> | |
| </head> | |
| <body onload="test()"> | |
| <div> | |
| <p> | |
| Test that an asynchronous script tag is executed, even if it's removed from the | |
| document before it was loaded. | |
| </p> | |
| <p> | |
| This test passes if the word "PASS" is displayed below. | |
| </p> | |
| </div> | |
| <div id="log"></div> | |
| </body> | |
| </html> |