| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script src="resources/unformatted.js"></script> | 5 <script src="resources/unformatted.js"></script> |
| 6 | |
| 7 <script> | 6 <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() | 7 var test = function() |
| 17 { | 8 { |
| 18 WebInspector.breakpointManager._storage._breakpoints = {}; | 9 WebInspector.breakpointManager._storage._breakpoints = {}; |
| 19 var panel = WebInspector.inspectorView.showPanel("sources"); | 10 var panel = WebInspector.inspectorView.showPanel("sources"); |
| 20 var scriptFormatter = InspectorTest.scriptFormatter(); | 11 var scriptFormatter = InspectorTest.scriptFormatter(); |
| 21 var sourceFrame; | 12 var sourceFrame; |
| 22 var formattedSourceFrame; | 13 var formattedSourceFrame; |
| 23 | 14 |
| 24 InspectorTest.runDebuggerTestSuite([ | 15 InspectorTest.runDebuggerTestSuite([ |
| 25 function testBreakpointsSetAndRemoveInFormattedSource(next) | 16 function testBreakpointsSetAndRemoveInFormattedSource(next) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 42 } | 33 } |
| 43 | 34 |
| 44 function pausedInF2(callFrames) | 35 function pausedInF2(callFrames) |
| 45 { | 36 { |
| 46 InspectorTest.dumpBreakpointSidebarPane("while paused in pretty
printed"); | 37 InspectorTest.dumpBreakpointSidebarPane("while paused in pretty
printed"); |
| 47 InspectorTest.removeBreakpoint(formattedSourceFrame, 3); | 38 InspectorTest.removeBreakpoint(formattedSourceFrame, 3); |
| 48 scriptFormatter._discardFormattedUISourceCodeScript(panel.visibl
eView.uiSourceCode()); | 39 scriptFormatter._discardFormattedUISourceCodeScript(panel.visibl
eView.uiSourceCode()); |
| 49 InspectorTest.dumpBreakpointSidebarPane("while paused in raw"); | 40 InspectorTest.dumpBreakpointSidebarPane("while paused in raw"); |
| 50 InspectorTest.resumeExecution(next); | 41 InspectorTest.resumeExecution(next); |
| 51 } | 42 } |
| 52 }, | |
| 53 | |
| 54 function testBreakpointSetInOriginalAndRemovedInFormatted(next) | |
| 55 { | |
| 56 InspectorTest.showScriptSource("script-formatter-breakpoints-2.html"
, didShowScriptSource); | |
| 57 | |
| 58 function didShowScriptSource(frame) | |
| 59 { | |
| 60 sourceFrame = frame; | |
| 61 InspectorTest.addResult("Adding breakpoint."); | |
| 62 InspectorTest.addSniffer(WebInspector.BreakpointManager.Breakpoi
nt.prototype, "_addResolvedLocation", breakpointResolved); | |
| 63 InspectorTest.setBreakpoint(sourceFrame, 11, "", true); | |
| 64 } | |
| 65 | |
| 66 function breakpointResolved() | |
| 67 { | |
| 68 InspectorTest.addResult("Formatting."); | |
| 69 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorActio
n.prototype, "_updateButton", uiSourceCodeScriptFormatted); | |
| 70 scriptFormatter._toggleFormatScriptSource(); | |
| 71 } | |
| 72 | |
| 73 function uiSourceCodeScriptFormatted() | |
| 74 { | |
| 75 InspectorTest.addResult("Removing breakpoint."); | |
| 76 formattedSourceFrame = panel.visibleView; | |
| 77 InspectorTest.removeBreakpoint(formattedSourceFrame, 16); | |
| 78 InspectorTest.addResult("Unformatting."); | |
| 79 scriptFormatter._discardFormattedUISourceCodeScript(panel.visibl
eView.uiSourceCode()); | |
| 80 var breakpoints = WebInspector.breakpointManager._storage._setti
ng.get(); | |
| 81 InspectorTest.assertEquals(breakpoints.length, 0, "There should
not be any breakpoints in the storage."); | |
| 82 next(); | |
| 83 } | |
| 84 } | 43 } |
| 85 ]); | 44 ]); |
| 86 | 45 |
| 87 } | 46 } |
| 88 | |
| 89 </script> | 47 </script> |
| 90 | |
| 91 </head> | 48 </head> |
| 92 | |
| 93 <body onload="runTest()"> | 49 <body onload="runTest()"> |
| 94 <p>Tests the script formatting is working fine with breakpoints. | 50 <p>Tests the script formatting is working fine with breakpoints. |
| 95 </p> | 51 </p> |
| 96 | |
| 97 </body> | 52 </body> |
| 98 </html> | 53 </html> |
| OLD | NEW |