| 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="../../../inspector/sources/debugger/resources/unformatted4.js"></sc
ript> | 5 <script src="../../../inspector/sources/debugger/resources/unformatted4.js"></sc
ript> |
| 6 | 6 |
| 7 <script> | 7 <script> |
| 8 | 8 |
| 9 function f1() | 9 function f1() |
| 10 { | 10 { |
| 11 var a=0;var b=1;var c=3;var d=4;var e=5; | 11 var a=0;var b=1;var c=3;var d=4;var e=5; |
| 12 var f=0; | 12 var f=0; |
| 13 return 0; | 13 return 0; |
| 14 } | 14 } |
| 15 | 15 |
| 16 function onload() | 16 function onload() |
| 17 { | 17 { |
| 18 if (window.testRunner) { | 18 if (window.testRunner) { |
| 19 testRunner.waitUntilDone(); | 19 testRunner.waitUntilDone(); |
| 20 testRunner.showWebInspector(); | 20 testRunner.showWebInspector(); |
| 21 } | 21 } |
| 22 runTest(); | 22 runTest(); |
| 23 } | 23 } |
| 24 | 24 |
| 25 var test = function() | 25 var test = function() |
| 26 { | 26 { |
| 27 WebInspector.breakpointManager._storage._breakpoints = {}; | 27 Bindings.breakpointManager._storage._breakpoints = {}; |
| 28 var panel = WebInspector.panels.sources; | 28 var panel = UI.panels.sources; |
| 29 var scriptFormatter; | 29 var scriptFormatter; |
| 30 | 30 |
| 31 InspectorTest.runDebuggerTestSuite([ | 31 InspectorTest.runDebuggerTestSuite([ |
| 32 function testSetup(next) | 32 function testSetup(next) |
| 33 { | 33 { |
| 34 InspectorTest.scriptFormatter().then(function(sf) { | 34 InspectorTest.scriptFormatter().then(function(sf) { |
| 35 scriptFormatter = sf; | 35 scriptFormatter = sf; |
| 36 next(); | 36 next(); |
| 37 }); | 37 }); |
| 38 }, | 38 }, |
| 39 | 39 |
| 40 function testBreakpointSetInOriginalAndRemovedInFormatted(next) | 40 function testBreakpointSetInOriginalAndRemovedInFormatted(next) |
| 41 { | 41 { |
| 42 InspectorTest.showScriptSource("script-formatter-breakpoints-4.html"
, didShowScriptSource); | 42 InspectorTest.showScriptSource("script-formatter-breakpoints-4.html"
, didShowScriptSource); |
| 43 | 43 |
| 44 function didShowScriptSource(sourceFrame) | 44 function didShowScriptSource(sourceFrame) |
| 45 { | 45 { |
| 46 InspectorTest.addResult("Adding breakpoint."); | 46 InspectorTest.addResult("Adding breakpoint."); |
| 47 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBr
eakpoint.prototype, "_addResolvedLocation", breakpointResolved); | 47 InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakp
oint.prototype, "_addResolvedLocation", breakpointResolved); |
| 48 InspectorTest.setBreakpoint(sourceFrame, 11, "", true); | 48 InspectorTest.setBreakpoint(sourceFrame, 11, "", true); |
| 49 } | 49 } |
| 50 | 50 |
| 51 function breakpointResolved() | 51 function breakpointResolved() |
| 52 { | 52 { |
| 53 InspectorTest.addResult("Formatting."); | 53 InspectorTest.addResult("Formatting."); |
| 54 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorActio
n.prototype, "_updateButton", uiSourceCodeScriptFormatted); | 54 InspectorTest.addSniffer(Sources.ScriptFormatterEditorAction.pro
totype, "_updateButton", uiSourceCodeScriptFormatted); |
| 55 scriptFormatter._toggleFormatScriptSource(); | 55 scriptFormatter._toggleFormatScriptSource(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 function uiSourceCodeScriptFormatted() | 58 function uiSourceCodeScriptFormatted() |
| 59 { | 59 { |
| 60 InspectorTest.addResult("Removing breakpoint."); | 60 InspectorTest.addResult("Removing breakpoint."); |
| 61 var formattedSourceFrame = panel.visibleView; | 61 var formattedSourceFrame = panel.visibleView; |
| 62 InspectorTest.removeBreakpoint(formattedSourceFrame, 13); | 62 InspectorTest.removeBreakpoint(formattedSourceFrame, 13); |
| 63 InspectorTest.addResult("Unformatting."); | 63 InspectorTest.addResult("Unformatting."); |
| 64 scriptFormatter._discardFormattedUISourceCodeScript(panel.visibl
eView.uiSourceCode()); | 64 scriptFormatter._discardFormattedUISourceCodeScript(panel.visibl
eView.uiSourceCode()); |
| 65 var breakpoints = WebInspector.breakpointManager._storage._setti
ng.get(); | 65 var breakpoints = Bindings.breakpointManager._storage._setting.g
et(); |
| 66 InspectorTest.assertEquals(breakpoints.length, 0, "There should
not be any breakpoints in the storage."); | 66 InspectorTest.assertEquals(breakpoints.length, 0, "There should
not be any breakpoints in the storage."); |
| 67 next(); | 67 next(); |
| 68 } | 68 } |
| 69 } | 69 } |
| 70 ]); | 70 ]); |
| 71 | 71 |
| 72 } | 72 } |
| 73 </script> | 73 </script> |
| 74 </head> | 74 </head> |
| 75 <body onload="onload()"> | 75 <body onload="onload()"> |
| 76 <p>Tests the script formatting is working fine with breakpoints. | 76 <p>Tests the script formatting is working fine with breakpoints. |
| 77 </p> | 77 </p> |
| 78 </body> | 78 </body> |
| 79 </html> | 79 </html> |
| OLD | NEW |