[WK2] selection does not disappear after coping the text
[framework/web/webkit-efl.git] / LayoutTests / fast / mutation / disconnect-cancel-pending.html
1 <!DOCTYPE html>
2 <script src="../js/resources/js-test-pre.js"></script>
3 <script>
4 description('Test that WebKitMutationObserver.disconnect cancels pending delivery');
5
6 window.jsTestIsAsync = true;
7 var mutations;
8 var observer;
9
10 function start() {
11     mutations = null;
12     div = document.createElement('div');
13
14     observer = new WebKitMutationObserver(function(m) {
15         mutations = m;
16     });
17
18     observer.observe(div, { attributes: true });
19     div.setAttribute('foo', 'bar');
20     observer.disconnect();
21     setTimeout(next, 0);
22 }
23
24 function next() {
25     debug('Disconnecting should cancel any pending delivery...');
26     shouldBeNull('mutations');
27     observer.observe(div, { attributes: true });
28     div.setAttribute('bar', 'baz');
29     setTimeout(finish, 0);
30 }
31
32 function finish() {
33     debug('...and re-observing should not see any of the previously-generated records.');
34     shouldBe('mutations.length', '1');
35     shouldBe('mutations[0].attributeName', '"bar"');
36     finishJSTest();
37 }
38
39 if (!window.WebKitMutationObserver)
40     testFailed('This test requires ENABLE(MUTATION_OBSERVERS)');
41 else
42     start();
43
44 </script>
45 <script src="../js/resources/js-test-post.js"></script>