mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
29 lines
694 B
HTML
29 lines
694 B
HTML
<!DOCTYPE html>
|
|
|
|
<script src="../../../resources/js-test.js"></script>
|
|
|
|
<script>
|
|
description('MutationObserver wrappers should survive GC for passing into the callback even if JS has lost references.');
|
|
|
|
jsTestIsAsync = true;
|
|
|
|
function addObserver(node, fn) {
|
|
var observer = new MutationObserver(fn);
|
|
observer.testProperty = true;
|
|
observer.observe(node, {attributes:true});
|
|
}
|
|
|
|
window.addEventListener("load", function() {
|
|
addObserver(document.body, function(records, observer) {
|
|
window.observer = observer;
|
|
shouldBe('observer.testProperty', 'true');
|
|
finishJSTest();
|
|
});
|
|
|
|
gc();
|
|
|
|
document.body.setAttribute('touch', 'the node');
|
|
});
|
|
</script>
|
|
|