Chromium Code Reviews| 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 testNoCrashWhenUpdateOnBreakpoint(next) | |
|
vsevik
2014/06/10 15:29:56
nit: ..WhenLiveEditOnBreakpoint...
| |
| 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 } | |
| 122 } | 154 } |
| 123 ]); | 155 ]); |
| 124 | 156 |
| 125 function replaceInSource(sourceFrame, string, replacement, callback) | 157 function replaceInSource(sourceFrame, string, replacement, callback) |
| 126 { | 158 { |
| 127 InspectorTest.addSniffer(WebInspector.debuggerModel, "_didEditScriptSour ce", callback); | 159 InspectorTest.addSniffer(WebInspector.debuggerModel, "_didEditScriptSour ce", callback); |
| 128 InspectorTest.replaceInSource(sourceFrame, string, replacement); | 160 InspectorTest.replaceInSource(sourceFrame, string, replacement); |
| 129 InspectorTest.commitSource(sourceFrame); | 161 InspectorTest.commitSource(sourceFrame); |
| 130 | |
| 131 } | 162 } |
| 132 }; | 163 }; |
| 133 | 164 |
| 134 </script> | 165 </script> |
| 135 | 166 |
| 136 </head> | 167 </head> |
| 137 | 168 |
| 138 <body onload="runTest()"> | 169 <body onload="runTest()"> |
| 139 <p>Tests live edit feature.</p> | 170 <p>Tests live edit feature.</p> |
| 140 | 171 |
| 141 </body> | 172 </body> |
| 142 </html> | 173 </html> |
| OLD | NEW |