blob: 75063316f79579d8bd35de6290527bdd74928eee [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../../resources/js-test.js"></script>
<script>
description('This tests disconnecting a MutationObserver while a mutation record is enqueued. WebKit should not crash.');
if (!window.GCController)
testFailed('This test requires GCController');
else {
jsTestIsAsync = true;
var observer = new MutationObserver(function() {});
var div = document.createElement('div');
document.body.appendChild(div);
observer.observe(div, {childList: true});
var script = document.createElement('script');
script.textContent = 'disconnectObserver()';
var child = document.createElement('div');
child.appendChild(script);
div.appendChild(child);
function disconnectObserver() {
observer.disconnect();
observer = null;
GCController.collect();
observer = new MutationObserver(function() {});
}
window.onload = () => {
testPassed('WebKit did not crash');
finishJSTest();
}
}
var successfullyParsed = true;
</script>
</body>
</html>