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

Side by Side Diff: LayoutTests/fast/dom/MutationObserver/observer-wrapper-dropoff-transient.html

Issue 12317072: Merge 143386 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 years, 10 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 2
3 <script src="../../js/resources/js-test-pre.js"></script> 3 <script src="../../js/resources/js-test-pre.js"></script>
4 4
5 <script> 5 <script>
6 description('MutationObserver wrappers should survive GC for passing into the ca llback even if JS has lost references and the only remaining observations are tr ansient.'); 6 description('MutationObserver wrappers should survive GC for passing into the ca llback even if JS has lost references and the only remaining observations are tr ansient.');
7 7
8 jsTestIsAsync = true; 8 jsTestIsAsync = true;
9 9
10 function addObserver(node, fn) { 10 function addObserver(node, fn) {
11 var observer = new WebKitMutationObserver(fn); 11 var observer = new MutationObserver(fn);
12 observer.testProperty = true; 12 observer.testProperty = true;
13 observer.observe(node, {attributes:true, subtree: true}); 13 observer.observe(node, {attributes:true, subtree: true});
14 } 14 }
15 15
16 onload = function() { 16 onload = function() {
17 var root = document.createElement('div'); 17 var root = document.createElement('div');
18 var child = root.appendChild(document.createElement('span')); 18 var child = root.appendChild(document.createElement('span'));
19 addObserver(root, function(records, observer) { 19 addObserver(root, function(records, observer) {
20 window.observer = observer; 20 window.observer = observer;
21 shouldBe('observer.testProperty', 'true'); 21 shouldBe('observer.testProperty', 'true');
22 finishJSTest(); 22 finishJSTest();
23 }); 23 });
24 24
25 root.removeChild(child); 25 root.removeChild(child);
26 child.setAttribute('foo', 'bar'); 26 child.setAttribute('foo', 'bar');
27 root = null; 27 root = null;
28 28
29 gc(); 29 gc();
30 }; 30 };
31 </script> 31 </script>
32 32
33 <script src="../../js/resources/js-test-post.js"></script> 33 <script src="../../js/resources/js-test-post.js"></script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698