blob: 44798d976e7ce746a71be392dd48b08517241392 [file] [log] [blame]
<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<div id="out"></div>
<script>
description("Garbage collection of Selection objects with shorter lifetimes must not crash.");
// A Selection object that dies before the window object it is registered to, must detach
// itself from its window on finalization.
self.jsTestIsAsync = true;
if (window.testRunner)
testRunner.waitUntilDone();
function runTest() {
var out = document.getElementById("out");
var root = out.createShadowRoot();
var sel = root.getSelection();
document.body.removeChild(out);
root = sel = out = null;
gc();
testPassed("No crash, including on shutdown..?");
finishJSTest();
}
window.onload = runTest;
</script>