Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / debugger-ui / script-formatter-breakpoints-2.html
blobdecad53b39caa1aac7f349afb3eda76ac56434cf
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script src="../debugger/resources/unformatted2.js"></script>
6 <script>
7 var test = function()
9 WebInspector.breakpointManager._storage._breakpoints = {};
10 var panel = WebInspector.panels.sources;
11 var scriptFormatter;
12 var formattedSourceFrame;
14 InspectorTest.runDebuggerTestSuite([
15 function testSetup(next)
17 InspectorTest.scriptFormatter().then(function(sf) {
18 scriptFormatter = sf;
19 next();
20 });
23 function testBreakpointsSetAndRemoveInFormattedSource(next)
25 InspectorTest.showScriptSource("unformatted2.js", didShowScriptSource);
27 function didShowScriptSource(frame)
29 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted);
30 scriptFormatter._toggleFormatScriptSource();
33 function uiSourceCodeScriptFormatted()
35 formattedSourceFrame = panel.visibleView;
36 InspectorTest.setBreakpoint(formattedSourceFrame, 3, "", true);
37 InspectorTest.waitUntilPaused(pausedInF2);
38 InspectorTest.evaluateInPageWithTimeout("f2()");
41 function pausedInF2(callFrames)
43 InspectorTest.dumpBreakpointSidebarPane("while paused in pretty printed");
44 InspectorTest.removeBreakpoint(formattedSourceFrame, 3);
45 scriptFormatter._discardFormattedUISourceCodeScript(panel.visibleView.uiSourceCode());
46 InspectorTest.dumpBreakpointSidebarPane("while paused in raw");
47 InspectorTest.resumeExecution(next);
50 ]);
53 </script>
54 </head>
55 <body onload="runTest()">
56 <p>Tests the script formatting is working fine with breakpoints.
57 </p>
58 </body>
59 </html>