OLD | NEW |
1 <html> | 1 <html> |
2 <import src="../resources/chai.sky" /> | 2 <import src="../resources/chai.sky" /> |
3 <import src="../resources/mocha.sky" /> | 3 <import src="../resources/mocha.sky" /> |
4 <script> | 4 <script> |
5 describe('MutationObserver', function() { | 5 describe('MutationObserver', function() { |
6 it('should deliver in order of creation', function(done) { | 6 it('should deliver in order of creation', function(done) { |
7 var order = []; | 7 var order = []; |
8 var observers = []; | 8 var observers = []; |
9 | 9 |
10 function setUpOrdering(num) { | 10 function setUpOrdering(num) { |
(...skipping 10 matching lines...) Expand all Loading... |
21 observers[2].observe(div, {characterData: true, subtree: true}); | 21 observers[2].observe(div, {characterData: true, subtree: true}); |
22 observers[1].observe(div, {attributes: true}); | 22 observers[1].observe(div, {attributes: true}); |
23 observers[7].observe(div, {childList: true}); | 23 observers[7].observe(div, {childList: true}); |
24 observers[4].observe(div, {attributes: true}); | 24 observers[4].observe(div, {attributes: true}); |
25 observers[9].observe(div, {attributes: true}); | 25 observers[9].observe(div, {attributes: true}); |
26 observers[0].observe(div, {childList: true}); | 26 observers[0].observe(div, {childList: true}); |
27 observers[5].observe(div, {attributes: true}); | 27 observers[5].observe(div, {attributes: true}); |
28 observers[6].observe(div, {characterData: true, subtree: true}); | 28 observers[6].observe(div, {characterData: true, subtree: true}); |
29 observers[8].observe(div, {attributes: true}); | 29 observers[8].observe(div, {attributes: true}); |
30 div.setAttribute('foo', 'bar'); | 30 div.setAttribute('foo', 'bar'); |
31 div.appendChild(document.createTextNode('hello')); | 31 div.appendChild(new Text('hello')); |
32 div.firstChild.textContent = 'goodbye'; | 32 div.firstChild.textContent = 'goodbye'; |
33 setTimeout(function() { | 33 setTimeout(function() { |
34 assert.deepEqual(order, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); | 34 assert.deepEqual(order, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); |
35 done(); | 35 done(); |
36 }, 0); | 36 }, 0); |
37 }); | 37 }); |
38 }); | 38 }); |
39 </script> | 39 </script> |
40 </html> | 40 </html> |
OLD | NEW |