2 <script src=
"../../../resources/js-test.js"></script>
4 window
.jsTestIsAsync
= true;
7 function testFilesystem() {
14 div
= document
.createElement('div');
15 observer
= new MutationObserver(function(m
) {
19 observer
.observe(div
, { attributes
: true, characterData
: true });
21 webkitRequestFileSystem(TEMPORARY
, 5*1024*1024, function(fs
) {
22 fs
.root
.getFile('foo.txt', {create
: true, excluse
: true}, function(entry
) {
24 fileEntry
.getParent(mutateAfterGetParent
);
29 function mutateAfterGetParent() {
30 div
.setAttribute('foo', 'bar');
31 fileEntry
.remove(mutateAfterRemove
);
34 function mutateAfterRemove() {
35 shouldBe('mutations.length', '1');
36 shouldBe('mutations[0].type', '"attributes"');
37 shouldBe('mutations[0].attributeName', '"foo"');
40 div
.setAttribute('baz', 'bat');
41 setTimeout(finish
, 0);
45 shouldBe('mutations.length', '1');
46 shouldBe('mutations[0].type', '"attributes"');
47 shouldBe('mutations[0].attributeName', '"baz"');
49 observer
.disconnect();
57 description('Test that Mutation Records are delivered following FileSystem callbacks.');