3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script src="resources/unformatted4.js"></script>
11 var a=0;var b=1;var c=3;var d=4;var e=5;
18 WebInspector.breakpointManager._storage._breakpoints = {};
19 var panel = WebInspector.inspectorView.showPanel("sources");
20 var scriptFormatter = InspectorTest.scriptFormatter();
22 InspectorTest.runDebuggerTestSuite([
23 function testBreakpointSetInOriginalAndRemovedInFormatted(next)
25 InspectorTest.showScriptSource("script-formatter-breakpoints-4.html", didShowScriptSource);
27 function didShowScriptSource(sourceFrame)
29 InspectorTest.addResult("Adding breakpoint.");
30 InspectorTest.addSniffer(WebInspector.BreakpointManager.Breakpoint.prototype, "_addResolvedLocation", breakpointResolved);
31 InspectorTest.setBreakpoint(sourceFrame, 11, "", true);
34 function breakpointResolved()
36 InspectorTest.addResult("Formatting.");
37 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted);
38 scriptFormatter._toggleFormatScriptSource();
41 function uiSourceCodeScriptFormatted()
43 InspectorTest.addResult("Removing breakpoint.");
44 var formattedSourceFrame = panel.visibleView;
45 InspectorTest.removeBreakpoint(formattedSourceFrame, 16);
46 InspectorTest.addResult("Unformatting.");
47 scriptFormatter._discardFormattedUISourceCodeScript(panel.visibleView.uiSourceCode());
48 var breakpoints = WebInspector.breakpointManager._storage._setting.get();
49 InspectorTest.assertEquals(breakpoints.length, 0, "There should not be any breakpoints in the storage.");
58 <body onload="runTest()">
59 <p>Tests the script formatting is working fine with breakpoints.