| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
| 3 <output id="out"></output> | 3 <div id="out"></div> |
| 4 <script> | 4 <script> |
| 5 description("Garbage collection of Selection objects with shorter lifetimes must
not crash."); | 5 description("Garbage collection of Selection objects with shorter lifetimes must
not crash."); |
| 6 // A Selection object that dies before the window object it is registered to, mu
st detach | 6 // A Selection object that dies before the window object it is registered to, mu
st detach |
| 7 // itself from its window on finalization. | 7 // itself from its window on finalization. |
| 8 | 8 |
| 9 self.jsTestIsAsync = true; | 9 self.jsTestIsAsync = true; |
| 10 if (window.testRunner) | 10 if (window.testRunner) |
| 11 testRunner.waitUntilDone(); | 11 testRunner.waitUntilDone(); |
| 12 | 12 |
| 13 function runTest() { | 13 function runTest() { |
| 14 var out = document.getElementById("out"); | 14 var out = document.getElementById("out"); |
| 15 var root = out.createShadowRoot(); | 15 var root = out.createShadowRoot(); |
| 16 var sel = root.getSelection(); | 16 var sel = root.getSelection(); |
| 17 document.body.removeChild(out); | 17 document.body.removeChild(out); |
| 18 root = sel = out = null; | 18 root = sel = out = null; |
| 19 gc(); | 19 gc(); |
| 20 testPassed("No crash, including on shutdown..?"); | 20 testPassed("No crash, including on shutdown..?"); |
| 21 finishJSTest(); | 21 finishJSTest(); |
| 22 } | 22 } |
| 23 window.onload = runTest; | 23 window.onload = runTest; |
| 24 </script> | 24 </script> |
| OLD | NEW |