Index: third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-and-deletion-race.html |
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-and-deletion-race.html b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-and-deletion-race.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ec076e875654e25a9071534f89414d685cf7f6bb |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-and-deletion-race.html |
@@ -0,0 +1,24 @@ |
+<!DOCTYPE html> |
+<script src="../../../resources/js-test.js"></script> |
+<body></body> |
+<script> |
+description('Test case that a MutationObserver is deleted while events are collected for it. crbug.com/557981'); |
+ |
+var div = document.createElement('div'); |
+var div2 = document.createElement('div'); |
+document.body.appendChild(div); |
+ |
+observer = new MutationObserver(function() {}); |
+observer.observe(div, {childList: true}); |
+ |
+var script = document.createElement('script'); |
+script.textContent = 'unregister_observer()'; |
+div2.appendChild(script); |
+div.appendChild(div2); |
+ |
+function unregister_observer() { |
+ observer.disconnect(); |
+ delete observer; |
+ gc(); |
+} |
+</script> |