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/unformatted.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
;
32 InspectorTest
.runDebuggerTestSuite([
33 function testSetup(next
)
35 InspectorTest
.scriptFormatter().then(function(sf
) {
41 function testBreakpointsInOriginalAndFormattedSource(next
)
43 InspectorTest
.showScriptSource("script-formatter-breakpoints-1.html", didShowScriptSource
);
45 function didShowScriptSource(frame
)
48 InspectorTest
.setBreakpoint(sourceFrame
, 11, "", true);
49 InspectorTest
.waitUntilPaused(pausedInF1
);
50 InspectorTest
.evaluateInPageWithTimeout("f1()");
53 function pausedInF1(callFrames
)
55 InspectorTest
.dumpBreakpointSidebarPane("while paused in raw");
56 InspectorTest
.resumeExecution(resumed
);
61 InspectorTest
.addSniffer(WebInspector
.ScriptFormatterEditorAction
.prototype, "_updateButton", uiSourceCodeScriptFormatted
);
62 scriptFormatter
._toggleFormatScriptSource();
65 function uiSourceCodeScriptFormatted()
67 // There should be a breakpoint in f1 although script is pretty-printed.
68 InspectorTest
.waitUntilPaused(pausedInF1Again
);
69 InspectorTest
.evaluateInPageWithTimeout("f1()");
72 function pausedInF1Again(callFrames
)
74 InspectorTest
.dumpBreakpointSidebarPane("while paused in pretty printed");
75 scriptFormatter
._discardFormattedUISourceCodeScript(panel
.visibleView
.uiSourceCode());
76 InspectorTest
.dumpBreakpointSidebarPane("while paused in raw");
77 InspectorTest
.removeBreakpoint(sourceFrame
, 11);
78 InspectorTest
.resumeExecution(next
);
86 <body onload=
"onload()">
87 <p>Tests the script formatting is working fine with breakpoints.