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="../../../http/tests/inspector/live-edit-test.js"></script> | 5 <script src="../../../http/tests/inspector/live-edit-test.js"></script> |
6 <script src="resources/edit-me-when-paused-no-reveal.js"></script> | 6 <script src="resources/edit-me-when-paused-no-reveal.js"></script> |
7 | 7 |
8 <script> | 8 <script> |
9 | 9 |
10 function test() | 10 function test() |
11 { | 11 { |
12 var panel = WebInspector.panels.sources; | 12 var panel = WebInspector.panels.sources; |
13 var sourceFrame; | 13 var sourceFrame; |
14 | 14 |
15 function didStepInto() | 15 function didStepInto() |
16 { | 16 { |
17 InspectorTest.addResult("Did step into"); | 17 InspectorTest.addResult("Did step into"); |
18 } | 18 } |
19 | 19 |
20 InspectorTest.addSniffer(WebInspector.debuggerModel, "stepInto", didStepInto
, true); | 20 InspectorTest.addSniffer(InspectorTest.debuggerModel, "stepInto", didStepInt
o, true); |
21 | 21 |
22 function testLiveEditWhenPausedDoesNotCauseCursorMove(oldText, newText, next
) | 22 function testLiveEditWhenPausedDoesNotCauseCursorMove(oldText, newText, next
) |
23 { | 23 { |
24 InspectorTest.showScriptSource("edit-me-when-paused-no-reveal.js", didSh
owScriptSource); | 24 InspectorTest.showScriptSource("edit-me-when-paused-no-reveal.js", didSh
owScriptSource); |
25 | 25 |
26 function didShowScriptSource(sourceFrame) | 26 function didShowScriptSource(sourceFrame) |
27 { | 27 { |
28 InspectorTest.waitUntilPaused(paused); | 28 InspectorTest.waitUntilPaused(paused); |
29 InspectorTest.setBreakpoint(sourceFrame, 8, "", true); | 29 InspectorTest.setBreakpoint(sourceFrame, 8, "", true); |
30 InspectorTest.evaluateInPage("f1()", didEvaluateInPage); | 30 InspectorTest.evaluateInPage("f1()", didEvaluateInPage); |
31 } | 31 } |
32 | 32 |
33 function paused(callFrames) | 33 function paused(callFrames) |
34 { | 34 { |
35 sourceFrame = panel.visibleView; | 35 sourceFrame = panel.visibleView; |
36 InspectorTest.removeBreakpoint(sourceFrame, 8); | 36 InspectorTest.removeBreakpoint(sourceFrame, 8); |
37 InspectorTest.addSniffer(WebInspector.debuggerModel, "_didEditScript
Source", didEditScriptSource); | 37 InspectorTest.addSniffer(InspectorTest.debuggerModel, "_didEditScrip
tSource", didEditScriptSource); |
38 InspectorTest.replaceInSource(sourceFrame, oldText, newText); | 38 InspectorTest.replaceInSource(sourceFrame, oldText, newText); |
39 InspectorTest.addResult("Moving cursor to (0, 0)."); | 39 InspectorTest.addResult("Moving cursor to (0, 0)."); |
40 sourceFrame.setSelection(WebInspector.TextRange.createFromLocation(0
, 0)); | 40 sourceFrame.setSelection(WebInspector.TextRange.createFromLocation(0
, 0)); |
41 InspectorTest.addResult("Committing live edit."); | 41 InspectorTest.addResult("Committing live edit."); |
42 InspectorTest.commitSource(sourceFrame); | 42 InspectorTest.commitSource(sourceFrame); |
43 } | 43 } |
44 | 44 |
45 function didEditScriptSource() | 45 function didEditScriptSource() |
46 { | 46 { |
47 InspectorTest.resumeExecution(); | 47 InspectorTest.resumeExecution(); |
(...skipping 16 matching lines...) Expand all Loading... |
64 { | 64 { |
65 InspectorTest.waitUntilPaused(paused); | 65 InspectorTest.waitUntilPaused(paused); |
66 InspectorTest.setBreakpoint(sourceFrame, 8, "", true); | 66 InspectorTest.setBreakpoint(sourceFrame, 8, "", true); |
67 InspectorTest.evaluateInPage("f1()", didEvaluateInPage); | 67 InspectorTest.evaluateInPage("f1()", didEvaluateInPage); |
68 } | 68 } |
69 | 69 |
70 function paused(callFrames) | 70 function paused(callFrames) |
71 { | 71 { |
72 sourceFrame = panel.visibleView; | 72 sourceFrame = panel.visibleView; |
73 InspectorTest.removeBreakpoint(sourceFrame, 8); | 73 InspectorTest.removeBreakpoint(sourceFrame, 8); |
74 InspectorTest.addSniffer(WebInspector.debuggerModel, "_didEditScript
Source", didEditScriptSource); | 74 InspectorTest.addSniffer(InspectorTest.debuggerModel, "_didEditScrip
tSource", didEditScriptSource); |
75 InspectorTest.replaceInSource(sourceFrame, oldText, newText); | 75 InspectorTest.replaceInSource(sourceFrame, oldText, newText); |
76 InspectorTest.addResult("Moving cursor to (0, 0)."); | 76 InspectorTest.addResult("Moving cursor to (0, 0)."); |
77 sourceFrame.setSelection(WebInspector.TextRange.createFromLocation(0
, 0)); | 77 sourceFrame.setSelection(WebInspector.TextRange.createFromLocation(0
, 0)); |
78 InspectorTest.addResult("Committing live edit."); | 78 InspectorTest.addResult("Committing live edit."); |
79 InspectorTest.commitSource(sourceFrame); | 79 InspectorTest.commitSource(sourceFrame); |
80 } | 80 } |
81 | 81 |
82 function didEditScriptSource() | 82 function didEditScriptSource() |
83 { | 83 { |
84 InspectorTest.addResult("Stepping into..."); | 84 InspectorTest.addResult("Stepping into..."); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 </script> | 126 </script> |
127 | 127 |
128 </head> | 128 </head> |
129 | 129 |
130 <body onload="runTest()"> | 130 <body onload="runTest()"> |
131 <p>Tests live edit feature.</p> | 131 <p>Tests live edit feature.</p> |
132 | 132 |
133 </body> | 133 </body> |
134 </html> | 134 </html> |
OLD | NEW |