| OLD | NEW |
| (Empty) |
| 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="resources/unformatted.js"></script> | |
| 6 | |
| 7 <script> | |
| 8 | |
| 9 function f1() | |
| 10 { | |
| 11 var a=0;var b=1;var c=3;var d=4;var e=5; | |
| 12 var f=0; | |
| 13 return 0; | |
| 14 } | |
| 15 | |
| 16 var test = function() | |
| 17 { | |
| 18 WebInspector.breakpointManager._storage._breakpoints = {}; | |
| 19 var panel = WebInspector.inspectorView.showPanel("sources"); | |
| 20 var scriptFormatter = InspectorTest.scriptFormatter(); | |
| 21 var sourceFrame; | |
| 22 | |
| 23 InspectorTest.runDebuggerTestSuite([ | |
| 24 function testBreakpointsInOriginalAndFormattedSource(next) | |
| 25 { | |
| 26 InspectorTest.showScriptSource("script-formatter-breakpoints-1.html"
, didShowScriptSource); | |
| 27 | |
| 28 function didShowScriptSource(frame) | |
| 29 { | |
| 30 sourceFrame = frame; | |
| 31 InspectorTest.setBreakpoint(sourceFrame, 11, "", true); | |
| 32 InspectorTest.waitUntilPaused(pausedInF1); | |
| 33 InspectorTest.evaluateInPageWithTimeout("f1()"); | |
| 34 } | |
| 35 | |
| 36 function pausedInF1(callFrames) | |
| 37 { | |
| 38 InspectorTest.dumpBreakpointSidebarPane("while paused in raw"); | |
| 39 InspectorTest.resumeExecution(resumed); | |
| 40 } | |
| 41 | |
| 42 function resumed() | |
| 43 { | |
| 44 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorActio
n.prototype, "_updateButton", uiSourceCodeScriptFormatted); | |
| 45 scriptFormatter._toggleFormatScriptSource(); | |
| 46 } | |
| 47 | |
| 48 function uiSourceCodeScriptFormatted() | |
| 49 { | |
| 50 // There should be a breakpoint in f1 although script is pretty-
printed. | |
| 51 InspectorTest.waitUntilPaused(pausedInF1Again); | |
| 52 InspectorTest.evaluateInPageWithTimeout("f1()"); | |
| 53 } | |
| 54 | |
| 55 function pausedInF1Again(callFrames) | |
| 56 { | |
| 57 InspectorTest.dumpBreakpointSidebarPane("while paused in pretty
printed"); | |
| 58 scriptFormatter._discardFormattedUISourceCodeScript(panel.visibl
eView.uiSourceCode()); | |
| 59 InspectorTest.dumpBreakpointSidebarPane("while paused in raw"); | |
| 60 InspectorTest.removeBreakpoint(sourceFrame, 11); | |
| 61 InspectorTest.resumeExecution(next); | |
| 62 } | |
| 63 } | |
| 64 ]); | |
| 65 | |
| 66 } | |
| 67 </script> | |
| 68 </head> | |
| 69 <body onload="runTest()"> | |
| 70 <p>Tests the script formatting is working fine with breakpoints. | |
| 71 </p> | |
| 72 </body> | |
| 73 </html> | |
| OLD | NEW |