Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: LayoutTests/fast/dom/shadow/shadow-selection-detach-crash.html

Issue 569643002: Simplify and weaken DOMWindowProperty unregistration (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add test Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/dom/shadow/shadow-selection-detach-crash.html
diff --git a/LayoutTests/fast/dom/shadow/shadow-selection-detach-crash.html b/LayoutTests/fast/dom/shadow/shadow-selection-detach-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..73f3c207e1ced40ad9a6e2e15e4a4b42bab308cd
--- /dev/null
+++ b/LayoutTests/fast/dom/shadow/shadow-selection-detach-crash.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<output id="out"></output>
+<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.dumpAsText();
+ 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>

Powered by Google App Engine
This is Rietveld 408576698