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('MutationObserver', function() { | |
6 it('should not invoke callbacks when appending a script', function() { | |
7 var mutationsDelivered = false; | |
8 function callback(mutations) { | |
9 mutationsDelivered = true; | |
10 } | |
11 | |
12 var observer = new MutationObserver(callback); | |
13 var div = document.createElement('div'); | |
14 observer.observe(div, {attributes: true}); | |
15 div.setAttribute('foo', 'bar'); | |
16 assert.notOk(mutationsDelivered); | |
17 var scriptDidRun = false; | |
18 var script = document.createElement('script'); | |
19 script.textContent = 'scriptDidRun = true'; | |
20 assert.notOk(scriptDidRun); | |
21 document.documentElement.appendChild(script); | |
22 assert.notOk(scriptDidRun); | |
23 assert.notOk(mutationsDelivered); | |
24 }); | |
25 }); | |
26 </script> | |
27 </html> | |
OLD | NEW |