3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script src="resources/unformatted2.js"></script>
9 WebInspector.breakpointManager._storage._breakpoints = {};
10 var panel = WebInspector.inspectorView.showPanel("sources");
11 var scriptFormatter = InspectorTest.scriptFormatter();
13 var formattedSourceFrame;
15 InspectorTest.runDebuggerTestSuite([
16 function testBreakpointsSetInFormattedAndRemoveInOriginalSource(next)
18 InspectorTest.showScriptSource("unformatted2.js", didShowScriptSource);
20 function didShowScriptSource(frame)
23 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted);
24 scriptFormatter._toggleFormatScriptSource();
27 function uiSourceCodeScriptFormatted()
29 formattedSourceFrame = panel.visibleView;
30 InspectorTest.setBreakpoint(formattedSourceFrame, 3, "", true);
31 InspectorTest.waitUntilPaused(pausedInF2);
32 InspectorTest.evaluateInPageWithTimeout("f2()");
35 function pausedInF2(callFrames)
37 InspectorTest.dumpBreakpointSidebarPane("while paused in pretty printed");
38 scriptFormatter._discardFormattedUISourceCodeScript(panel.visibleView.uiSourceCode());
39 InspectorTest.dumpBreakpointSidebarPane("while paused in raw");
40 // No need to remove breakpoint since formattedUISourceCode was removed.
41 InspectorTest.resumeExecution(next);
49 <body onload="runTest()">
50 <p>Tests the script formatting is working fine with breakpoints.