3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/debugger-test.js"></script>
5 <script src=
"../../../inspector/sources/debugger/resources/unformatted4.js"></script>
11 var a
=0;var b
=1;var c
=3;var d
=4;var e
=5;
18 if (window
.testRunner
) {
19 testRunner
.waitUntilDone();
20 testRunner
.showWebInspector();
27 WebInspector
.breakpointManager
._storage
._breakpoints
= {};
28 var panel
= WebInspector
.panels
.sources
;
31 InspectorTest
.runDebuggerTestSuite([
32 function testSetup(next
)
34 InspectorTest
.scriptFormatter().then(function(sf
) {
40 function testBreakpointSetInOriginalAndRemovedInFormatted(next
)
42 InspectorTest
.showScriptSource("script-formatter-breakpoints-4.html", didShowScriptSource
);
44 function didShowScriptSource(sourceFrame
)
46 InspectorTest
.addResult("Adding breakpoint.");
47 InspectorTest
.addSniffer(WebInspector
.BreakpointManager
.TargetBreakpoint
.prototype, "_addResolvedLocation", breakpointResolved
);
48 InspectorTest
.setBreakpoint(sourceFrame
, 11, "", true);
51 function breakpointResolved()
53 InspectorTest
.addResult("Formatting.");
54 InspectorTest
.addSniffer(WebInspector
.ScriptFormatterEditorAction
.prototype, "_updateButton", uiSourceCodeScriptFormatted
);
55 scriptFormatter
._toggleFormatScriptSource();
58 function uiSourceCodeScriptFormatted()
60 InspectorTest
.addResult("Removing breakpoint.");
61 var formattedSourceFrame
= panel
.visibleView
;
62 InspectorTest
.removeBreakpoint(formattedSourceFrame
, 19);
63 InspectorTest
.addResult("Unformatting.");
64 scriptFormatter
._discardFormattedUISourceCodeScript(panel
.visibleView
.uiSourceCode());
65 var breakpoints
= WebInspector
.breakpointManager
._storage
._setting
.get();
66 InspectorTest
.assertEquals(breakpoints
.length
, 0, "There should not be any breakpoints in the storage.");
75 <body onload=
"onload()">
76 <p>Tests the script formatting is working fine with breakpoints.