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