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/unformatted4.js"></script> | 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() |
| 17 { |
| 18 if (window.testRunner) { |
| 19 testRunner.waitUntilDone(); |
| 20 testRunner.showWebInspector(); |
| 21 } |
| 22 runTest(); |
| 23 } |
| 24 |
16 var test = function() | 25 var test = function() |
17 { | 26 { |
18 WebInspector.breakpointManager._storage._breakpoints = {}; | 27 WebInspector.breakpointManager._storage._breakpoints = {}; |
19 var panel = WebInspector.inspectorView.showPanel("sources"); | 28 var panel = WebInspector.inspectorView.showPanel("sources"); |
20 var scriptFormatter = InspectorTest.scriptFormatter(); | 29 var scriptFormatter = InspectorTest.scriptFormatter(); |
21 | 30 |
22 InspectorTest.runDebuggerTestSuite([ | 31 InspectorTest.runDebuggerTestSuite([ |
23 function testBreakpointSetInOriginalAndRemovedInFormatted(next) | 32 function testBreakpointSetInOriginalAndRemovedInFormatted(next) |
24 { | 33 { |
25 InspectorTest.showScriptSource("script-formatter-breakpoints-4.html"
, didShowScriptSource); | 34 InspectorTest.showScriptSource("script-formatter-breakpoints-4.html"
, didShowScriptSource); |
26 | 35 |
27 function didShowScriptSource(sourceFrame) | 36 function didShowScriptSource(sourceFrame) |
28 { | 37 { |
29 InspectorTest.addResult("Adding breakpoint."); | 38 InspectorTest.addResult("Adding breakpoint."); |
30 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBr
eakpoint.prototype, "_addResolvedLocation", breakpointResolved); | 39 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBr
eakpoint.prototype, "_addResolvedLocation", breakpointResolved); |
31 InspectorTest.setBreakpoint(sourceFrame, 11, "", true); | 40 InspectorTest.setBreakpoint(sourceFrame, 11, "", true); |
32 } | 41 } |
33 | 42 |
34 function breakpointResolved() | 43 function breakpointResolved() |
35 { | 44 { |
36 InspectorTest.addResult("Formatting."); | 45 InspectorTest.addResult("Formatting."); |
37 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorActio
n.prototype, "_updateButton", uiSourceCodeScriptFormatted); | 46 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorActio
n.prototype, "_updateButton", uiSourceCodeScriptFormatted); |
38 scriptFormatter._toggleFormatScriptSource(); | 47 scriptFormatter._toggleFormatScriptSource(); |
39 } | 48 } |
40 | 49 |
41 function uiSourceCodeScriptFormatted() | 50 function uiSourceCodeScriptFormatted() |
42 { | 51 { |
43 InspectorTest.addResult("Removing breakpoint."); | 52 InspectorTest.addResult("Removing breakpoint."); |
44 var formattedSourceFrame = panel.visibleView; | 53 var formattedSourceFrame = panel.visibleView; |
45 InspectorTest.removeBreakpoint(formattedSourceFrame, 16); | 54 InspectorTest.removeBreakpoint(formattedSourceFrame, 19); |
46 InspectorTest.addResult("Unformatting."); | 55 InspectorTest.addResult("Unformatting."); |
47 scriptFormatter._discardFormattedUISourceCodeScript(panel.visibl
eView.uiSourceCode()); | 56 scriptFormatter._discardFormattedUISourceCodeScript(panel.visibl
eView.uiSourceCode()); |
48 var breakpoints = WebInspector.breakpointManager._storage._setti
ng.get(); | 57 var breakpoints = WebInspector.breakpointManager._storage._setti
ng.get(); |
49 InspectorTest.assertEquals(breakpoints.length, 0, "There should
not be any breakpoints in the storage."); | 58 InspectorTest.assertEquals(breakpoints.length, 0, "There should
not be any breakpoints in the storage."); |
50 next(); | 59 next(); |
51 } | 60 } |
52 } | 61 } |
53 ]); | 62 ]); |
54 | 63 |
55 } | 64 } |
56 </script> | 65 </script> |
57 </head> | 66 </head> |
58 <body onload="runTest()"> | 67 <body onload="onload()"> |
59 <p>Tests the script formatting is working fine with breakpoints. | 68 <p>Tests the script formatting is working fine with breakpoints. |
60 </p> | 69 </p> |
61 </body> | 70 </body> |
62 </html> | 71 </html> |
OLD | NEW |