Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / dom / shadow / shadow-selection-detach-crash.html
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <output id="out"></output>
4 <script>
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, must detach
7 // itself from its window on finalization.
8
9 self.jsTestIsAsync = true;
10 if (window.testRunner) {
11     testRunner.dumpAsText();
12     testRunner.waitUntilDone();
13 }
14
15 function runTest() {
16     var out = document.getElementById("out");
17     var root = out.createShadowRoot();
18     var sel = root.getSelection();
19     document.body.removeChild(out);
20     root = sel = out = null;
21     gc();
22     testPassed("No crash, including on shutdown..?");
23     finishJSTest();
24 }
25 window.onload = runTest;
26 </script>