| Index: LayoutTests/inspector/debugger/skip-pauses-until-reload.html
|
| diff --git a/LayoutTests/inspector/debugger/skip-pauses-until-reload.html b/LayoutTests/inspector/debugger/skip-pauses-until-reload.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..10561a6c5b8c630a078147af177290b0ef8518d1
|
| --- /dev/null
|
| +++ b/LayoutTests/inspector/debugger/skip-pauses-until-reload.html
|
| @@ -0,0 +1,139 @@
|
| +<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>
|
| +
|
| +function testFunction()
|
| +{
|
| + console.log("Begin");
|
| + debugger; // Reload follows, nothing below should break.
|
| + console.log("Middle: Breakpoint 1"); // Breakpoint
|
| + console.log("Middle: Breakpoint 2"); // Breakpoint
|
| + console.assert(false, "Assertion failed!");
|
| + console.error("Some console.error message");
|
| + debugger; // Should skip this also.
|
| + var element = document.getElementById("element");
|
| + var parent = element.parentElement;
|
| + var child = document.createElement("span");
|
| + element.setAttribute("foo", "bar"); // DOM breakpoint: AttributeModified
|
| + element.appendChild(child); // DOM breakpoint: SubtreeModified
|
| + parent.removeChild(element); // DOM breakpoint: NodeRemoved
|
| + parent.appendChild(element);
|
| + element.click(); // Event breakpoint
|
| + console.log("End");
|
| + // Should be last.
|
| + eval("throwException()");
|
| +}
|
| +
|
| +function throwException()
|
| +{
|
| + function inner()
|
| + {
|
| + try {
|
| + if (window.foo === 1)
|
| + throw new Error("error message");
|
| + } finally {
|
| + ++window.foo;
|
| + }
|
| + }
|
| + try {
|
| + window.foo = 1;
|
| + inner();
|
| + } finally {
|
| + ++window.foo;
|
| + }
|
| +}
|
| +
|
| +function test()
|
| +{
|
| + InspectorTest.startDebuggerTest(step1);
|
| +
|
| + function step1()
|
| + {
|
| + InspectorTest.showScriptSource("skip-pauses-until-reload.html", didShowScriptSource);
|
| + }
|
| +
|
| + function didShowScriptSource(sourceFrame)
|
| + {
|
| + InspectorTest.addResult("Script source was shown.");
|
| + InspectorTest.addResult("Set up breakpoints.");
|
| + InspectorTest.setBreakpoint(sourceFrame, 11, "", true);
|
| + InspectorTest.setBreakpoint(sourceFrame, 12, "", true);
|
| + InspectorTest.addResult("Set up to pause on all exceptions.");
|
| + // FIXME: Test is flaky with PauseOnAllExceptions due to races in debugger.
|
| + DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions);
|
| + InspectorTest.nodeWithId("element", didResolveNode);
|
| + }
|
| +
|
| + function didResolveNode(node)
|
| + {
|
| + WebInspector.showPanel("elements");
|
| + var pane = WebInspector.domBreakpointsSidebarPane;
|
| + InspectorTest.addResult("Set up DOM breakpoints.");
|
| + pane._setBreakpoint(node, pane._breakpointTypes.SubtreeModified, true);
|
| + pane._setBreakpoint(node, pane._breakpointTypes.AttributeModified, true);
|
| + pane._setBreakpoint(node, pane._breakpointTypes.NodeRemoved, true);
|
| + setUpEventBreakpoints();
|
| + }
|
| +
|
| + function setUpEventBreakpoints()
|
| + {
|
| + WebInspector.showPanel("sources");
|
| + var pane = WebInspector.panels.sources.sidebarPanes.eventListenerBreakpoints;
|
| + InspectorTest.addResult("Set up Event breakpoints.");
|
| + pane._setBreakpoint("listener:click");
|
| + InspectorTest.runAfterPendingDispatches(didSetUp);
|
| + }
|
| +
|
| + function didSetUp()
|
| + {
|
| + InspectorTest.addResult("Did set up.");
|
| + InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
|
| + }
|
| +
|
| + function didPause(callFrames)
|
| + {
|
| + InspectorTest.captureStackTrace(callFrames);
|
| + DebuggerAgent.setSkipAllPauses(true, true, didSetSkipAllPauses);
|
| + }
|
| +
|
| + function didSetSkipAllPauses()
|
| + {
|
| + InspectorTest.addResult("Set up to skip all pauses.");
|
| + doReloadPage();
|
| + }
|
| +
|
| + function doReloadPage()
|
| + {
|
| + InspectorTest.addResult("Reloading the page...");
|
| + InspectorTest.waitUntilPausedNextTime(didPauseAfterReload);
|
| + InspectorTest.reloadPage(didReloadPage);
|
| + }
|
| + function didReloadPage()
|
| + {
|
| + InspectorTest.addResult("PASS: Reloaded without hitting breakpoints.");
|
| + InspectorTest.completeDebuggerTest();
|
| + }
|
| +
|
| + function didPauseAfterReload(callFrames)
|
| + {
|
| + InspectorTest.addResult("FAIL: Should not pause while reloading the page!");
|
| + InspectorTest.captureStackTrace(callFrames);
|
| + InspectorTest.waitUntilPausedNextTime(didPauseAfterReload);
|
| + InspectorTest.resumeExecution();
|
| + }
|
| +};
|
| +
|
| +</script>
|
| +
|
| +</head>
|
| +
|
| +<body onload="runTest()">
|
| +<p>Tests that 'skip all pauses' mode blocks breakpoint and gets cancelled right at page reload.
|
| +</p>
|
| +
|
| +<div id="element" onclick="return 0;"></div>
|
| +</body>
|
| +</html>
|
|
|