OLD | NEW |
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 window.jsTestIsAsync = true; | 5 window.jsTestIsAsync = true; |
6 | 6 |
7 describe('MutationObservers', function() { | 7 describe('MutationObservers', function() { |
8 it ('must wait for the next loop when created during delivery', function(don
e) { | 8 it ('must wait for the next loop when created during delivery', function(don
e) { |
9 var order = []; | 9 var order = []; |
10 var div = document.createElement('div'); | 10 var div = document.createElement('div'); |
11 | 11 |
12 var observer3; | 12 var observer3; |
13 var observer1 = new MutationObserver(function(mutations) { | 13 var observer1 = new MutationObserver(function(mutations) { |
(...skipping 14 matching lines...) Expand all Loading... |
28 observer2.observe(div, {attributes: true}); | 28 observer2.observe(div, {attributes: true}); |
29 div.setAttribute('foo', 'bar'); | 29 div.setAttribute('foo', 'bar'); |
30 setTimeout(function() { | 30 setTimeout(function() { |
31 assert.deepEqual(order, [1, 2, 1, 3]); | 31 assert.deepEqual(order, [1, 2, 1, 3]); |
32 done(); | 32 done(); |
33 }, 0); | 33 }, 0); |
34 }); | 34 }); |
35 }); | 35 }); |
36 </script> | 36 </script> |
37 </html> | 37 </html> |
OLD | NEW |