3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/console-test.js"></script>
5 <script src=
"../../../http/tests/inspector/debugger-test.js"></script>
11 "window.testDiv = document.createElement('div');\n" +
12 "window.deliveryCount = 0;\n" +
13 "var observer = new WebKitMutationObserver(function(records) {\n" +
14 " window.deliveryCount++;\n" +
16 "observer.observe(window.testDiv, { attributes: true });";
19 "function mutateAndPause() {\n" +
20 " window.testDiv.setAttribute('foo', 'baz');\n" +
23 "setTimeout(mutateAndPause, 0);";
25 InspectorTest
.startDebuggerTest(step1
);
29 InspectorTest
.evaluateInPage(setup
, function() {
30 InspectorTest
.addResult("DIV and observer setup.");
31 InspectorTest
.evaluateInConsoleAndDump("deliveryCount", step2
);
37 InspectorTest
.evaluateInPage("window.testDiv.setAttribute('foo', 'bar')", function() {
38 InspectorTest
.addResult("setAttribute should have triggered delivery.");
39 InspectorTest
.evaluateInConsoleAndDump("deliveryCount", step3
);
45 InspectorTest
.evaluateInPage(mutateAndPause
, InspectorTest
.addResult
.bind(InspectorTest
, "mutateAndPause invoked."));
46 InspectorTest
.waitUntilPaused(step4
);
50 InspectorTest
.addResult("Delivery should not have taken place.");
51 InspectorTest
.evaluateInConsoleAndDump("deliveryCount", function() {
52 InspectorTest
.resumeExecution(step5
);
57 InspectorTest
.addResult("Second delivery should now have happened.");
58 InspectorTest
.evaluateInConsoleAndDump("deliveryCount", InspectorTest
.completeDebuggerTest
);
65 <body onload=
"runTest()">
67 Tests that DOM Mutation Observers do not attempt to deliver mutation records while the debugger is paused.
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=105810">Bug
105810</a>