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