mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
28 lines
943 B
HTML
28 lines
943 B
HTML
<html>
|
|
<link rel="import" href="../resources/chai.html" />
|
|
<link rel="import" href="../resources/mocha.html" />
|
|
<script>
|
|
describe('MutationObserver', function() {
|
|
it('should not invoke callbacks when appending a script', function() {
|
|
var mutationsDelivered = false;
|
|
function callback(mutations) {
|
|
mutationsDelivered = true;
|
|
}
|
|
|
|
var observer = new MutationObserver(callback);
|
|
var div = document.createElement('div');
|
|
observer.observe(div, {attributes: true});
|
|
div.setAttribute('foo', 'bar');
|
|
assert.notOk(mutationsDelivered);
|
|
var scriptDidRun = false;
|
|
var script = document.createElement('script');
|
|
script.textContent = 'scriptDidRun = true';
|
|
assert.notOk(scriptDidRun);
|
|
document.documentElement.appendChild(script);
|
|
assert.notOk(scriptDidRun);
|
|
assert.notOk(mutationsDelivered);
|
|
});
|
|
});
|
|
</script>
|
|
</html>
|