flutter_flutter/tests/mutation-observer/mutation-record-constructor.html
2014-10-23 11:17:19 -07:00

23 lines
688 B
HTML

<html>
<link rel="import" href="../resources/chai.html" />
<link rel="import" href="../resources/mocha.html" />
<script>
describe('MutationRecord', function() {
it('should be exposed on window but not constructable', function() {
assert.ok(window.MutationRecord);
assert.equal(typeof MutationRecord, "function");
assert.throw(function() {
new MutationRecord
}, TypeError);
var div = document.createElement('div');
var observer = new MutationObserver(function(){});
observer.observe(div, {attributes: true});
div.id = 'foo';
var record = observer.takeRecords()[0];
assert.ok(record instanceof MutationRecord);
});
});
</script>
</html>