OLD | NEW |
| (Empty) |
1 <html> | |
2 <link rel="import" href="../resources/chai.html" /> | |
3 <link rel="import" href="../resources/mocha.html" /> | |
4 <script> | |
5 describe('Transient registrations', function() { | |
6 it('should be cleared even without delivery', function(done) { | |
7 var mutationsDelivered = false; | |
8 var observer = new MutationObserver(function(mutations) { | |
9 mutationsDelivered = true; | |
10 }); | |
11 var div = document.createElement('div'); | |
12 var span = div.appendChild(document.createElement('span')); | |
13 observer.observe(div, {attributes: true, subtree: true}); | |
14 div.removeChild(span); | |
15 setTimeout(function() { | |
16 // By the time this function runs the transient registration should | |
17 // be cleared, so we expect not to be notified of this attribute | |
18 // mutation. | |
19 span.setAttribute('bar', 'baz'); | |
20 setTimeout(function() { | |
21 assert.notOk(mutationsDelivered); | |
22 done(); | |
23 }, 0); | |
24 }, 0); | |
25 }); | |
26 }); | |
27 </script> | |
28 </html> | |
OLD | NEW |