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.js"></script> | 6 <script src="resources/edit-me.js"></script> |
7 <script src="resources/edit-me-syntax-error.js"></script> | 7 <script src="resources/edit-me-syntax-error.js"></script> |
8 <script src="resources/edit-me-when-paused.js"></script> | 8 <script src="resources/edit-me-when-paused.js"></script> |
9 | 9 |
10 <script> | 10 <script> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 replaceInSource(panel.visibleView, "function f()", "function new
FunctionCreatedWithLiveEdit()\n{\n}\nfunction f()", didEditScriptSource); | 112 replaceInSource(panel.visibleView, "function f()", "function new
FunctionCreatedWithLiveEdit()\n{\n}\nfunction f()", didEditScriptSource); |
113 } | 113 } |
114 | 114 |
115 function didEditScriptSource() | 115 function didEditScriptSource() |
116 { | 116 { |
117 var breakpoints = panel.visibleView._breakpoints; | 117 var breakpoints = panel.visibleView._breakpoints; |
118 for (var lineNumber in breakpoints) | 118 for (var lineNumber in breakpoints) |
119 InspectorTest.assertEquals("5", lineNumber); | 119 InspectorTest.assertEquals("5", lineNumber); |
120 next(); | 120 next(); |
121 } | 121 } |
122 }, | |
123 | |
124 function testNoCrashWhenLiveEditOnBreakpoint(next) | |
125 { | |
126 InspectorTest.showScriptSource("edit-me.js", didShowScriptSource); | |
127 | |
128 function didShowScriptSource(sourceFrame) | |
129 { | |
130 InspectorTest.addSniffer(sourceFrame, "_addBreakpointDecoration"
, breakpointAdded); | |
131 InspectorTest.setBreakpoint(sourceFrame, 3, "", true); | |
132 } | |
133 | |
134 function breakpointAdded() | |
135 { | |
136 InspectorTest.waitUntilPaused(pausedInF); | |
137 InspectorTest.evaluateInPageWithTimeout("f()"); | |
138 } | |
139 | |
140 function pausedInF(callFrames) | |
141 { | |
142 replaceInSource(panel.visibleView, "function f()", "function f()
\n", didEditScriptSource); | |
143 } | |
144 | |
145 function didEditScriptSource() | |
146 { | |
147 InspectorTest.resumeExecution(resumed); | |
148 } | |
149 | |
150 function resumed() | |
151 { | |
152 next(); | |
153 } | |
154 } | 122 } |
155 ]); | 123 ]); |
156 | 124 |
157 function replaceInSource(sourceFrame, string, replacement, callback) | 125 function replaceInSource(sourceFrame, string, replacement, callback) |
158 { | 126 { |
159 InspectorTest.addSniffer(WebInspector.debuggerModel, "_didEditScriptSour
ce", callback); | 127 InspectorTest.addSniffer(WebInspector.debuggerModel, "_didEditScriptSour
ce", callback); |
160 InspectorTest.replaceInSource(sourceFrame, string, replacement); | 128 InspectorTest.replaceInSource(sourceFrame, string, replacement); |
161 InspectorTest.commitSource(sourceFrame); | 129 InspectorTest.commitSource(sourceFrame); |
| 130 |
162 } | 131 } |
163 }; | 132 }; |
164 | 133 |
165 </script> | 134 </script> |
166 | 135 |
167 </head> | 136 </head> |
168 | 137 |
169 <body onload="runTest()"> | 138 <body onload="runTest()"> |
170 <p>Tests live edit feature.</p> | 139 <p>Tests live edit feature.</p> |
171 | 140 |
172 </body> | 141 </body> |
173 </html> | 142 </html> |
OLD | NEW |