blob: 77f42ffdc07550e5ad46b83a696125ee4497c7e5 [file] [log] [blame]
<script src="../../../resources/js-test.js"></script>
<script>
window.jsTestIsAsync = true;
description('Transient registrations should be cleared even without delivery.');
var mutationsDelivered = false;
function callback(mutations) {
mutationsDelivered = true;
}
var observer = new MutationObserver(callback);
var div = document.createElement('div');
var span = div.appendChild(document.createElement('span'));
observer.observe(div, {attributes: true, subtree: true});
div.removeChild(span);
setTimeout(function() {
// By the time this function runs the transient registration should be cleared,
// so we expect not to be notified of this attribute mutation.
span.setAttribute('bar', 'baz');
setTimeout(function() {
shouldBeFalse('mutationsDelivered');
finishJSTest();
}, 0);
}, 0);
</script>