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

Side by Side Diff: sky/tests/mutation-observer/observer-wrapper-dropoff-transient.sky

Issue 694423002: Replace <link rel="import"> with <import> (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 <html> 1 <html>
2 <link rel="import" href="../resources/chai.sky" /> 2 <import src="../resources/chai.sky" />
3 <link rel="import" href="../resources/mocha.sky" /> 3 <import src="../resources/mocha.sky" />
4 <script> 4 <script>
5 describe('MutationObserver wrappers', function() { 5 describe('MutationObserver wrappers', function() {
6 it('should survive GC for passing into the callback even if JS has lost refe rences and the only remaining observations are transient.', function(done) { 6 it('should survive GC for passing into the callback even if JS has lost refe rences and the only remaining observations are transient.', function(done) {
7 function addObserver(node, fn) { 7 function addObserver(node, fn) {
8 var observer = new MutationObserver(fn); 8 var observer = new MutationObserver(fn);
9 observer.testProperty = true; 9 observer.testProperty = true;
10 observer.observe(node, {attributes:true, subtree: true}); 10 observer.observe(node, {attributes:true, subtree: true});
11 } 11 }
12 12
13 var root = document.createElement('div'); 13 var root = document.createElement('div');
14 var child = root.appendChild(document.createElement('span')); 14 var child = root.appendChild(document.createElement('span'));
15 addObserver(root, function(records, observer) { 15 addObserver(root, function(records, observer) {
16 window.observer = observer; 16 window.observer = observer;
17 assert.ok(observer.testProperty); 17 assert.ok(observer.testProperty);
18 done(); 18 done();
19 }); 19 });
20 20
21 root.removeChild(child); 21 root.removeChild(child);
22 child.setAttribute('foo', 'bar'); 22 child.setAttribute('foo', 'bar');
23 root = null; 23 root = null;
24 24
25 gc(); 25 gc();
26 }); 26 });
27 }); 27 });
28 </script> 28 </script>
29 </html> 29 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698