blob: 3cc7099561f236524478544c3af6dc72f10a3b14 [file] [log] [blame]
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/debugger-test.js"></script>
<script>
var test = function()
{
var setup =
"window.testDiv = document.createElement('div');\n" +
"window.deliveryCount = 0;\n" +
"var observer = new WebKitMutationObserver(function(records) {\n" +
" window.deliveryCount++;\n" +
"});\n" +
"observer.observe(window.testDiv, { attributes: true });";
var mutateAndPause =
"function mutateAndPause() {\n" +
" window.testDiv.setAttribute('foo', 'baz');\n" +
" debugger;\n" +
"};\n" +
"setTimeout(mutateAndPause, 0);";
InspectorTest.startDebuggerTest(step1);
function step1()
{
InspectorTest.evaluateInConsole(setup, function() {
InspectorTest.addResult("DIV and observer setup.");
InspectorTest.evaluateInConsoleAndDump("deliveryCount", step2);
});
}
function step2()
{
InspectorTest.evaluateInConsole("window.testDiv.setAttribute('foo', 'bar')", function() {
InspectorTest.addResult("setAttribute should have triggered delivery.");
InspectorTest.evaluateInConsoleAndDump("deliveryCount", step3);
});
}
function step3()
{
InspectorTest.evaluateInConsole(mutateAndPause, InspectorTest.addResult.bind(InspectorTest, "mutateAndPause invoked."));
InspectorTest.waitUntilPaused(step4);
}
function step4() {
InspectorTest.addResult("Delivery should not have taken place.");
InspectorTest.evaluateInConsoleAndDump("deliveryCount", function() {
InspectorTest.resumeExecution(step5);
});
}
function step5() {
InspectorTest.addResult("Second delivery should now have happened.");
InspectorTest.evaluateInConsoleAndDump("deliveryCount", InspectorTest.completeDebuggerTest);
}
}
</script>
</head>
<body onload="runTest()">
<p>
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>
</p>
</body>
</html>