Reviewed by Yury Semikhatsky.
Web Inspector: [Chromium] inspector/debugger/dom-breakpoints.html TIMEOUTs
https://bugs.webkit.org/show_bug.cgi?id=54638
* http/tests/inspector/change-iframe-src.html:
* http/tests/inspector/debugger-test.js:
(initialize_DebuggerTest.InspectorTest.startDebuggerTest.startTest):
(initialize_DebuggerTest.InspectorTest.startDebuggerTest):
(initialize_DebuggerTest.InspectorTest.completeDebuggerTest.disableDebugger):
(initialize_DebuggerTest.InspectorTest.runDebuggerTestSuite.runner):
(initialize_DebuggerTest.InspectorTest.runDebuggerTestSuite):
(initialize_DebuggerTest.InspectorTest.waitUntilPaused):
(initialize_DebuggerTest.InspectorTest.waitUntilPausedAndDumpStack.step1):
(initialize_DebuggerTest.InspectorTest.waitUntilPausedAndDumpStack):
(initialize_DebuggerTest.InspectorTest.waitUntilResumed):
(initialize_DebuggerTest.InspectorTest.resumeExecution):
(initialize_DebuggerTest.InspectorTest.showScriptSource):
(initialize_DebuggerTest.InspectorTest._showScriptSource):
(initialize_DebuggerTest.InspectorTest.expandProperties.expandNextPath):
(initialize_DebuggerTest.InspectorTest.expandProperties):
* http/tests/inspector/elements-test.js:
(initialize_ElementTest.InspectorTest.nodeWithId.processChildren):
(initialize_ElementTest.InspectorTest.nodeWithId):
(initialize_ElementTest.InspectorTest.selectNodeWithId.mycallback):
(initialize_ElementTest.InspectorTest.selectNodeWithId):
(initialize_ElementTest.InspectorTest.expandElementsTree.mycallback):
(initialize_ElementTest.InspectorTest.expandElementsTree):
(initialize_ElementTest):
* http/tests/inspector/inspector-test.js:
(initialize_InspectorTest.InspectorTest.evaluateInConsole):
(initialize_InspectorTest.InspectorTest.evaluateInConsoleAndDump.mycallback):
(initialize_InspectorTest.InspectorTest.evaluateInConsoleAndDump):
(initialize_InspectorTest.InspectorTest.evaluateInPage.mycallback):
(initialize_InspectorTest.InspectorTest.evaluateInPage):
(initialize_InspectorTest.InspectorTest.evaluateInPageWithTimeout):
(initialize_InspectorTest.InspectorTest.reloadPage):
(initialize_InspectorTest.InspectorTest.runAfterPendingDispatches):
(initialize_InspectorTest.InspectorTest.runTestSuite.runner):
(initialize_InspectorTest.InspectorTest.runTestSuite):
(initialize_InspectorTest.InspectorTest.safeWrap):
* http/tests/inspector/resource-parameters.html:
* inspector/console/console-assert.html:
* inspector/console/console-trace-in-eval.html:
* inspector/console/console-trace.html:
* inspector/debugger/dom-breakpoints-expected.txt:
* inspector/debugger/dom-breakpoints.html:
* inspector/extensions/extensions-audits-tests.js:
(initialize_ExtensionsAuditsTest.InspectorTest.startExtensionAudits):
(initialize_ExtensionsAuditsTest):
* inspector/styles/styles-iframe.html:
* inspector/styles/styles-update-from-js.html:
* inspector/timeline/timeline-network-resource.html:
* inspector/timeline/timeline-script-tag-1.html:
* inspector/timeline/timeline-script-tag-2.html:
* platform/chromium/test_expectations.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79205
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-02-21 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: [Chromium] inspector/debugger/dom-breakpoints.html TIMEOUTs
+ https://bugs.webkit.org/show_bug.cgi?id=54638
+
+ * http/tests/inspector/change-iframe-src.html:
+ * http/tests/inspector/debugger-test.js:
+ (initialize_DebuggerTest.InspectorTest.startDebuggerTest.startTest):
+ (initialize_DebuggerTest.InspectorTest.startDebuggerTest):
+ (initialize_DebuggerTest.InspectorTest.completeDebuggerTest.disableDebugger):
+ (initialize_DebuggerTest.InspectorTest.runDebuggerTestSuite.runner):
+ (initialize_DebuggerTest.InspectorTest.runDebuggerTestSuite):
+ (initialize_DebuggerTest.InspectorTest.waitUntilPaused):
+ (initialize_DebuggerTest.InspectorTest.waitUntilPausedAndDumpStack.step1):
+ (initialize_DebuggerTest.InspectorTest.waitUntilPausedAndDumpStack):
+ (initialize_DebuggerTest.InspectorTest.waitUntilResumed):
+ (initialize_DebuggerTest.InspectorTest.resumeExecution):
+ (initialize_DebuggerTest.InspectorTest.showScriptSource):
+ (initialize_DebuggerTest.InspectorTest._showScriptSource):
+ (initialize_DebuggerTest.InspectorTest.expandProperties.expandNextPath):
+ (initialize_DebuggerTest.InspectorTest.expandProperties):
+ * http/tests/inspector/elements-test.js:
+ (initialize_ElementTest.InspectorTest.nodeWithId.processChildren):
+ (initialize_ElementTest.InspectorTest.nodeWithId):
+ (initialize_ElementTest.InspectorTest.selectNodeWithId.mycallback):
+ (initialize_ElementTest.InspectorTest.selectNodeWithId):
+ (initialize_ElementTest.InspectorTest.expandElementsTree.mycallback):
+ (initialize_ElementTest.InspectorTest.expandElementsTree):
+ (initialize_ElementTest):
+ * http/tests/inspector/inspector-test.js:
+ (initialize_InspectorTest.InspectorTest.evaluateInConsole):
+ (initialize_InspectorTest.InspectorTest.evaluateInConsoleAndDump.mycallback):
+ (initialize_InspectorTest.InspectorTest.evaluateInConsoleAndDump):
+ (initialize_InspectorTest.InspectorTest.evaluateInPage.mycallback):
+ (initialize_InspectorTest.InspectorTest.evaluateInPage):
+ (initialize_InspectorTest.InspectorTest.evaluateInPageWithTimeout):
+ (initialize_InspectorTest.InspectorTest.reloadPage):
+ (initialize_InspectorTest.InspectorTest.runAfterPendingDispatches):
+ (initialize_InspectorTest.InspectorTest.runTestSuite.runner):
+ (initialize_InspectorTest.InspectorTest.runTestSuite):
+ (initialize_InspectorTest.InspectorTest.safeWrap):
+ * http/tests/inspector/resource-parameters.html:
+ * inspector/console/console-assert.html:
+ * inspector/console/console-trace-in-eval.html:
+ * inspector/console/console-trace.html:
+ * inspector/debugger/dom-breakpoints-expected.txt:
+ * inspector/debugger/dom-breakpoints.html:
+ * inspector/extensions/extensions-audits-tests.js:
+ (initialize_ExtensionsAuditsTest.InspectorTest.startExtensionAudits):
+ (initialize_ExtensionsAuditsTest):
+ * inspector/styles/styles-iframe.html:
+ * inspector/styles/styles-update-from-js.html:
+ * inspector/timeline/timeline-network-resource.html:
+ * inspector/timeline/timeline-script-tag-1.html:
+ * inspector/timeline/timeline-script-tag-2.html:
+ * platform/chromium/test_expectations.txt:
+
2011-02-21 Alejandro G. Castro <alex@igalia.com>
Fixed typo in gtk Skipped list.
function step1(node)
{
node.setAttribute("src", "http://localhost:8000/inspector/resources/iframe-from-different-domain-data.html");
- InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+ InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
}
function step2()
if (WebInspector.panels.scripts._debuggerEnabled)
startTest();
else {
- InspectorTest._addSniffer(WebInspector.panels.scripts, "debuggerWasEnabled", startTest);
+ InspectorTest.addSniffer(WebInspector.panels.scripts, "debuggerWasEnabled", startTest);
WebInspector.panels.scripts._toggleDebugging(false);
}
function startTest()
{
InspectorTest.addResult("Debugger was enabled.");
- InspectorTest._addSniffer(WebInspector.debuggerModel, "_pausedScript", InspectorTest._pausedScript, true);
- InspectorTest._addSniffer(WebInspector.debuggerModel, "_resumedScript", InspectorTest._resumedScript, true);
- callback();
+ InspectorTest.addSniffer(WebInspector.debuggerModel, "_pausedScript", InspectorTest._pausedScript, true);
+ InspectorTest.addSniffer(WebInspector.debuggerModel, "_resumedScript", InspectorTest._resumedScript, true);
+ InspectorTest.safeWrap(callback)();
}
};
if (!scriptsPanel._debuggerEnabled)
completeTest();
else {
- InspectorTest._addSniffer(WebInspector.panels.scripts, "debuggerWasDisabled", completeTest);
+ InspectorTest.addSniffer(WebInspector.panels.scripts, "debuggerWasDisabled", completeTest);
scriptsPanel._toggleDebugging(false);
}
}
}
};
+InspectorTest.runDebuggerTestSuite = function(testSuite)
+{
+ var testSuiteTests = testSuite.slice();
+
+ function runner()
+ {
+ if (!testSuiteTests.length) {
+ InspectorTest.completeDebuggerTest();
+ return;
+ }
+
+ InspectorTest.safeWrap(testSuiteTests.shift())(runner, runner);
+ }
+
+ InspectorTest.startDebuggerTest(runner);
+}
+
InspectorTest.runTestFunctionAndWaitUntilPaused = function(callback)
{
InspectorTest.evaluateInConsole("setTimeout(testFunction, 0)");
InspectorTest.waitUntilPaused = function(callback)
{
+ callback = InspectorTest.safeWrap(callback);
+
if (InspectorTest._callFrames)
callback(InspectorTest._callFrames);
else
InspectorTest._waitUntilPausedCallback = callback;
};
+InspectorTest.waitUntilPausedAndDumpStack = function(callback)
+{
+ InspectorTest.waitUntilPaused(step1);
+
+ function step1(callFrames)
+ {
+ InspectorTest.captureStackTrace(callFrames);
+ InspectorTest.addResult(WebInspector.panels.scripts.sidebarPanes.callstack.bodyElement.lastChild.innerText);
+ InspectorTest.resumeExecution(InspectorTest.safeWrap(callback));
+ }
+};
+
InspectorTest.waitUntilResumed = function(callback)
{
+ callback = InspectorTest.safeWrap(callback);
+
if (!InspectorTest._callFrames)
callback();
else
{
if (WebInspector.panels.scripts.paused)
WebInspector.panels.scripts._togglePause();
- if (callback)
- InspectorTest.waitUntilResumed(callback);
+ InspectorTest.waitUntilResumed(callback);
};
InspectorTest.captureStackTrace = function(callFrames)
InspectorTest.showScriptSource = function(scriptName, callback)
{
if (InspectorTest._scriptsAreParsed([scriptName]))
- InspectorTest._showScriptSource(scriptName, callback);
+ InspectorTest._showScriptSource(scriptName, InspectorTest.safeWrap(callback));
else
- InspectorTest._addSniffer(WebInspector.debuggerModel, "_parsedScriptSource", InspectorTest.showScriptSource.bind(InspectorTest, scriptName, callback));
+ InspectorTest.addSniffer(WebInspector.debuggerModel, "_parsedScriptSource", InspectorTest.showScriptSource.bind(InspectorTest, scriptName, callback));
};
InspectorTest._scriptsAreParsed = function(scripts)
if (sourceFrame._content)
callback(sourceFrame);
else
- InspectorTest._addSniffer(sourceFrame._textModel, "setText", callback.bind(null, sourceFrame));
+ InspectorTest.addSniffer(sourceFrame._textModel, "setText", callback.bind(null, sourceFrame));
};
InspectorTest.expandProperties = function(properties, callback)
function expandNextPath()
{
if (index === properties.length) {
- callback();
+ InspectorTest.safeWrap(callback)();
return;
}
var parentTreeElement = properties[index++];
InspectorTest.nodeWithId = function(idValue, callback)
{
+ callback = InspectorTest.safeWrap(callback);
var result = null;
var topLevelChildrenRequested = false;
var pendingRequests = 0;
var childNode = children[i];
if (childNode.getAttribute("id") === idValue) {
result = childNode;
- if (callback)
- callback(result);
+ callback(result);
return;
}
pendingRequests++;
if (topLevel)
topLevelChildrenRequested = true;
if (topLevelChildrenRequested && !result && !pendingRequests)
- callback(null);
+ callback(null);
}
pendingRequests++;
WebInspector.domAgent.getChildNodesAsync(WebInspector.domAgent.document, processChildren.bind(this, true));
InspectorTest.selectNodeWithId = function(idValue, callback)
{
+ callback = InspectorTest.safeWrap(callback);
function mycallback(node)
{
if (node)
WebInspector.updateFocusedNode(node.id);
- if (callback)
- InspectorTest.runAfterPendingDispatches(callback.bind(null, node));
+ InspectorTest.runAfterPendingDispatches(callback.bind(null, node));
}
InspectorTest.nodeWithId(idValue, mycallback);
};
InspectorTest.expandElementsTree = function(callback)
{
+ callback = InspectorTest.safeWrap(callback);
+
function expand(treeItem)
{
var children = treeItem.children;
{
WebInspector.panels.elements.updateModifiedNodes();
expand(WebInspector.panels.elements.treeOutline);
- if (callback)
- callback();
+ callback();
}
InspectorTest.nodeWithId(/nonstring/, mycallback);
};
dump(WebInspector.domAgent.document, "", WebInspector.domAgent.document.id - 1);
};
-};
\ No newline at end of file
+};
InspectorTest.evaluateInConsole = function(code, callback)
{
+ callback = InspectorTest.safeWrap(callback);
+
WebInspector.console.visible = true;
WebInspector.console.prompt.text = code;
var event = document.createEvent("KeyboardEvent");
event.initKeyboardEvent("keydown", true, true, null, "Enter", "");
WebInspector.console.promptElement.dispatchEvent(event);
- InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage",
+ InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage",
function(commandResult) {
- if (callback)
- callback(commandResult.toMessageElement().textContent);
+ callback(commandResult.toMessageElement().textContent);
});
}
InspectorTest.evaluateInConsoleAndDump = function(code, callback)
{
+ callback = InspectorTest.safeWrap(callback);
+
function mycallback(text)
{
InspectorTest.addResult(code + " = " + text);
- if (callback)
- callback(text);
+ callback(text);
}
InspectorTest.evaluateInConsole(code, mycallback);
}
InspectorTest.evaluateInPage = function(code, callback)
{
+ callback = InspectorTest.safeWrap(callback);
+
function mycallback(result)
{
- if (callback)
- callback(WebInspector.RemoteObject.fromPayload(result));
+ callback(WebInspector.RemoteObject.fromPayload(result));
}
RuntimeAgent.evaluate(code, "console", false, mycallback);
}
-InspectorTest.evaluateInPageWithTimeout = function(code, callback)
+InspectorTest.evaluateInPageWithTimeout = function(code)
{
- InspectorTest.evaluateInPage("setTimeout(unescape('" + escape(code) + "'))", callback);
+ InspectorTest.evaluateInPage("setTimeout(unescape('" + escape(code) + "'))");
}
InspectorTest.addResult = function(text)
InspectorTest.reloadPage = function(callback)
{
- InspectorTest._reloadPageCallback = callback;
+ InspectorTest._reloadPageCallback = InspectorTest.safeWrap(callback);
if (WebInspector.panels.network)
WebInspector.panels.network._reset();
InspectorTest.runAfterPendingDispatches = function(callback)
{
+ callback = InspectorTest.safeWrap(callback);
+
WebInspector.TestController.prototype.runAfterPendingDispatches(callback);
}
InspectorTest.completeTest();
return;
}
- var nextTestFunction = testSuiteTests.shift();
- nextTestFunction(runner);
+ InspectorTest.safeWrap(testSuiteTests.shift())(runner, runner);
}
-
runner();
}
-InspectorTest._addSniffer = function(receiver, methodName, override, opt_sticky)
+InspectorTest.safeWrap = function(func, onexception)
+{
+ function result()
+ {
+ if (!func)
+ return;
+ var wrapThis = this;
+ try {
+ return func.apply(wrapThis, arguments);
+ } catch(e) {
+ InspectorTest.addResult("Exception while running: " + func + "\n" + e);
+ if (onexception)
+ InspectorTest.safeWrap(onexception)();
+ else
+ InspectorTest.completeTest();
+ }
+ }
+ return result;
+}
+
+InspectorTest.addSniffer = function(receiver, methodName, override, opt_sticky)
{
+ override = InspectorTest.safeWrap(override);
+
var original = receiver[methodName];
if (typeof original !== "function")
throw ("Cannot find method to override: " + methodName);
function test()
{
InspectorTest.evaluateInPage("submit()");
- InspectorTest._addSniffer(WebInspector.NetworkDispatcher.prototype, "didFinishLoading", dumpHAR);
+ InspectorTest.addSniffer(WebInspector.NetworkDispatcher.prototype, "didFinishLoading", dumpHAR);
function dumpHAR()
{
}
}
InspectorTest.evaluateInPage("setTimeout(a, 0)");
- InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", callback, true);
+ InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", callback, true);
}
</script>
InspectorTest.completeTest();
}
InspectorTest.evaluateInPage("doEvalSource()");
- InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", callback);
+ InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", callback);
}
</script>
InspectorTest.completeTest();
}
InspectorTest.evaluateInPage("setTimeout(a, 0)");
- InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", callback);
+ InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", callback);
}
</script>
Append childElement to rootElement.
Script execution paused.
Call stack:
- 0) appendElement (dom-breakpoints.html:11)
+ 0) appendElement (dom-breakpoints.html:12)
1) (:1)
Paused on a "Subtree Modified" breakpoint set on div#rootElement, because a new child was added to that node.
Script execution resumed.
Append grandchildElement to childElement.
Script execution paused.
Call stack:
- 0) appendElement (dom-breakpoints.html:11)
+ 0) appendElement (dom-breakpoints.html:12)
1) (:1)
Paused on a "Subtree Modified" breakpoint set on div#rootElement, because a new child was added to its descendant div#childElement.
Script execution resumed.
Remove grandchildElement.
Script execution paused.
Call stack:
- 0) removeElement (dom-breakpoints.html:23)
+ 0) removeElement (dom-breakpoints.html:24)
1) (:1)
Paused on a "Subtree Modified" breakpoint set on div#rootElement, because its descendant div#grandchildElement was removed.
Script execution resumed.
Modify rootElement className.
Script execution paused.
Call stack:
- 0) modifyAttribute (dom-breakpoints.html:17)
+ 0) modifyAttribute (dom-breakpoints.html:18)
1) (:1)
Paused on a "Attribute Modified" breakpoint set on div#rootElement.
Script execution resumed.
Test that 'Node Removed' breakpoint is hit when removing a node.
-Append elementToRemove to rootElement.
Set 'Node Removed' DOM breakpoint on elementToRemove.
Remove elementToRemove.
Script execution paused.
Call stack:
- 0) removeElement (dom-breakpoints.html:23)
+ 0) removeElement (dom-breakpoints.html:24)
1) (:1)
Paused on a "Node Removed" breakpoint set on div#elementToRemove.
Script execution resumed.
Append childElement to rootElement.
Script execution paused.
Call stack:
- 0) appendElement (dom-breakpoints.html:11)
+ 0) appendElement (dom-breakpoints.html:12)
1) (:1)
Paused on a "Subtree Modified" breakpoint set on div#rootElement, because a new child was added to that node.
Script execution resumed.
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/elements-test.js"></script>
<script src="../../http/tests/inspector/debugger-test.js"></script>
<script>
element.parentNode.removeChild(element);
}
-var test = function()
+function test()
{
var rootElement;
- testInsertChild = {};
- testInsertChild.step1 = function()
- {
- InspectorTest.addResult("Test that 'Subtree Modified' breakpoint is hit when appending a child.");
- InspectorTest.nodeWithId("rootElement", testInsertChild.step2);
- };
- testInsertChild.step2 = function(node)
- {
- rootElement = node;
- WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.SubtreeModified);
- InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement.");
- InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'childElement')");
- InspectorTest.addResult("Append childElement to rootElement.");
- InspectorTest.waitUntilPaused(testInsertChild.step3);
- };
- testInsertChild.step3 = function(callFrames)
- {
- dumpStatus(callFrames);
- InspectorTest.resumeExecution(testInsertGrandchild.step1);
- };
-
- var testInsertGrandchild = {};
- testInsertGrandchild.step1 = function()
- {
- InspectorTest.addResult("Test that 'Subtree Modified' breakpoint is hit when appending a grandchild.");
- InspectorTest.evaluateInPageWithTimeout("appendElement('childElement', 'grandchildElement')");
- InspectorTest.addResult("Append grandchildElement to childElement.");
- InspectorTest.waitUntilPaused(testInsertGrandchild.step2);
- }
- testInsertGrandchild.step2 = function(callFrames)
- {
- dumpStatus(callFrames);
- InspectorTest.resumeExecution(testRemoveChild.step1);
- }
-
- var testRemoveChild = {};
- testRemoveChild.step1 = function()
- {
- InspectorTest.addResult("Test that 'Subtree Modified' breakpoint is hit when removing a child.");
- InspectorTest.evaluateInPageWithTimeout("removeElement('grandchildElement')");
- InspectorTest.addResult("Remove grandchildElement.");
- InspectorTest.waitUntilPaused(testRemoveChild.step2);
-
- }
- testRemoveChild.step2 = function(callFrames)
- {
- dumpStatus(callFrames);
- rootElement.breakpoints[WebInspector.DOMBreakpointTypes.SubtreeModified].remove();
- InspectorTest.resumeExecution(testModifyAttribute.step1);
- }
-
- var testModifyAttribute = {};
- testModifyAttribute.step1 = function()
- {
- InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is hit when modifying attribute.");
- WebInspector.breakpointManager.createDOMBreakpoint(rootElement.id, WebInspector.DOMBreakpointTypes.AttributeModified);
- InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on rootElement.");
- InspectorTest.evaluateInPageWithTimeout("modifyAttribute('rootElement', 'className', 'foo')");
- InspectorTest.addResult("Modify rootElement className.");
- InspectorTest.waitUntilPaused(testModifyAttribute.step2.bind(null));
- }
- testModifyAttribute.step2 = function(callFrames)
- {
- dumpStatus(callFrames);
- rootElement.breakpoints[WebInspector.DOMBreakpointTypes.AttributeModified].remove();
- InspectorTest.resumeExecution(testRemoveNode.step1);
- }
-
- var testRemoveNode = {};
- testRemoveNode.step1 = function()
- {
- InspectorTest.addResult("Test that 'Node Removed' breakpoint is hit when removing a node.");
- InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'elementToRemove')", testRemoveNode.step2);
- }
- testRemoveNode.step2 = function()
- {
- InspectorTest.addResult("Append elementToRemove to rootElement.");
- InspectorTest.nodeWithId("elementToRemove", testRemoveNode.step3);
- }
- testRemoveNode.step3 = function(node)
- {
- WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.NodeRemoved);
- InspectorTest.addResult("Set 'Node Removed' DOM breakpoint on elementToRemove.");
- InspectorTest.evaluateInPageWithTimeout("removeElement('elementToRemove')");
- InspectorTest.addResult("Remove elementToRemove.");
- InspectorTest.waitUntilPaused(testRemoveNode.step4);
- }
- testRemoveNode.step4 = function(callFrames)
- {
- dumpStatus(callFrames);
- InspectorTest.resumeExecution(testReload.step1);
- }
-
- var testReload= {};
- testReload.step1 = function()
- {
- InspectorTest.addResult("Test that DOM breakpoints are persisted between page reloads.");
- InspectorTest.nodeWithId("rootElement", testReload.step2);
- }
- testReload.step2 = function(node)
- {
- WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.SubtreeModified);
- InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement.");
- InspectorTest.reloadPage(testReload.step3);
- }
- testReload.step3 = function()
- {
- InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'childElement')");
- InspectorTest.addResult("Append childElement to rootElement.");
- InspectorTest.waitUntilPaused(testReload.step4);
- }
- testReload.step4 = function(callFrames)
- {
- dumpStatus(callFrames);
- InspectorTest.completeDebuggerTest();
- }
-
- function dumpStatus(callFrames)
- {
- InspectorTest.captureStackTrace(callFrames);
- InspectorTest.addResult(WebInspector.panels.scripts.sidebarPanes.callstack.bodyElement.lastChild.innerText);
- }
-
- InspectorTest.startDebuggerTest(testInsertChild.step1);
-};
+ InspectorTest.runDebuggerTestSuite([
+ function testInsertChild(next)
+ {
+ InspectorTest.addResult("Test that 'Subtree Modified' breakpoint is hit when appending a child.");
+ InspectorTest.nodeWithId("rootElement", step2);
+
+ function step2(node)
+ {
+ rootElement = node;
+ WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.SubtreeModified);
+ InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement.");
+ InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'childElement')");
+ InspectorTest.addResult("Append childElement to rootElement.");
+ InspectorTest.waitUntilPausedAndDumpStack(next);
+ }
+ },
+
+ function testInsertGrandchild(next)
+ {
+ InspectorTest.addResult("Test that 'Subtree Modified' breakpoint is hit when appending a grandchild.");
+ InspectorTest.evaluateInPageWithTimeout("appendElement('childElement', 'grandchildElement')");
+ InspectorTest.addResult("Append grandchildElement to childElement.");
+ InspectorTest.waitUntilPausedAndDumpStack(next);
+ },
+
+ function testRemoveChild(next)
+ {
+ InspectorTest.addResult("Test that 'Subtree Modified' breakpoint is hit when removing a child.");
+ InspectorTest.evaluateInPageWithTimeout("removeElement('grandchildElement')");
+ InspectorTest.addResult("Remove grandchildElement.");
+ InspectorTest.waitUntilPausedAndDumpStack(step2);
+
+ function step2()
+ {
+ rootElement.breakpoints[WebInspector.DOMBreakpointTypes.SubtreeModified].remove();
+ next();
+ }
+ },
+
+ function testModifyAttribute(next)
+ {
+ InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is hit when modifying attribute.");
+ WebInspector.breakpointManager.createDOMBreakpoint(rootElement.id, WebInspector.DOMBreakpointTypes.AttributeModified);
+ InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on rootElement.");
+ InspectorTest.evaluateInPageWithTimeout("modifyAttribute('rootElement', 'className', 'foo')");
+ InspectorTest.addResult("Modify rootElement className.");
+ InspectorTest.waitUntilPausedAndDumpStack(step2);
+
+ function step2(callFrames)
+ {
+ rootElement.breakpoints[WebInspector.DOMBreakpointTypes.AttributeModified].remove();
+ next();
+ }
+ },
+
+ function testRemoveNode(next)
+ {
+ InspectorTest.addResult("Test that 'Node Removed' breakpoint is hit when removing a node.");
+ InspectorTest.nodeWithId("elementToRemove", step2);
+
+ function step2(node)
+ {
+ WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.NodeRemoved);
+ InspectorTest.addResult("Set 'Node Removed' DOM breakpoint on elementToRemove.");
+ InspectorTest.evaluateInPageWithTimeout("removeElement('elementToRemove')");
+ InspectorTest.addResult("Remove elementToRemove.");
+ InspectorTest.waitUntilPausedAndDumpStack(next);
+ }
+ },
+
+ function testReload(next)
+ {
+ InspectorTest.addResult("Test that DOM breakpoints are persisted between page reloads.");
+ InspectorTest.nodeWithId("rootElement", step2);
+
+ function step2(node)
+ {
+ WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.SubtreeModified);
+ InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement.");
+ InspectorTest.reloadPage(step3);
+ }
+
+ function step3()
+ {
+ InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'childElement')");
+ InspectorTest.addResult("Append childElement to rootElement.");
+ InspectorTest.waitUntilPausedAndDumpStack(next);
+ }
+ }
+ ]);
+}
</script>
</head>
<p>
Tests DOM breakpoints. <a href="https://bugs.webkit.org/show_bug.cgi?id=42886">Bug 42886</a>
</p>
-<div id="rootElement"></div>
+
+<div id="rootElement">
+<div id="elementToRemove"></div>
+</div>
+
</body>
</html>
-
InspectorTest.collectAuditResults();
port.postMessage("");
}
- InspectorTest._addSniffer(WebInspector.panels.audits, "_auditFinishedCallback", onAuditsDone, true);
+ InspectorTest.addSniffer(WebInspector.panels.audits, "_auditFinishedCallback", onAuditsDone, true);
launcherView._launchButtonClicked();
}
function test()
{
InspectorTest.evaluateInPage("loadIframe()");
- InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step0);
+ InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step0);
function step0()
{
function step0()
{
InspectorTest.evaluateInPage("modifyStyleAttribute()");
- InspectorTest._addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
}
// Set style via cssText.
// Inhibit the second Styles pane update from step0().
function callback()
{
- InspectorTest._addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
}
InspectorTest.evaluateInPage("modifyCssText()", callback);
dumpAttributeAndStyles();
InspectorTest.evaluateInPage("modifyParsedAttributes()");
- InspectorTest._addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step3);
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step3);
}
// Finish the test.
function step1()
{
InspectorTest.evaluateInPage("performActions()");
- InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+ InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
}
function step2()
function step1()
{
InspectorTest.evaluateInPage("performActions()");
- InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+ InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
}
function step2()
InspectorAgent.startTimelineProfiler(step1);
function step1()
{
- InspectorTest._addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
+ InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);
InspectorTest.evaluateInPage("performActions()");
}
BUGWK54472 : media/audio-delete-while-slider-thumb-clicked.html = TIMEOUT
-BUGWK54638 SKIP : inspector/debugger/dom-breakpoints.html = TIMEOUT
-
BUGWK54387 : fast/js/kde/math.html = TEXT
// Flaky