| 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-when-paused.js"></script> | 7 <script src="resources/edit-me-when-paused.js"></script> |
| 8 | 8 |
| 9 <script> | 9 <script> |
| 10 function loadScriptWithSyntaxError() | 10 function loadScriptWithSyntaxError() |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind
(InspectorTest, InspectorTest.resumeExecution.bind(InspectorTest, next))); | 106 InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind
(InspectorTest, InspectorTest.resumeExecution.bind(InspectorTest, next))); |
| 107 } | 107 } |
| 108 }, | 108 }, |
| 109 | 109 |
| 110 function testBreakpointsUpdated(next) | 110 function testBreakpointsUpdated(next) |
| 111 { | 111 { |
| 112 InspectorTest.showScriptSource("edit-me.js", didShowScriptSource); | 112 InspectorTest.showScriptSource("edit-me.js", didShowScriptSource); |
| 113 | 113 |
| 114 function didShowScriptSource(sourceFrame) | 114 function didShowScriptSource(sourceFrame) |
| 115 { | 115 { |
| 116 InspectorTest.addSniffer(sourceFrame, "_addBreakpointDecoration"
, breakpointAdded); | 116 InspectorTest.waitJavaScriptSourceFrameBreakpoints(sourceFrame).
then(breakpointAdded); |
| 117 InspectorTest.setBreakpoint(sourceFrame, 2, "", true); | 117 InspectorTest.setBreakpoint(sourceFrame, 2, "", true); |
| 118 } | 118 } |
| 119 | 119 |
| 120 function breakpointAdded() | 120 function breakpointAdded() |
| 121 { | 121 { |
| 122 replaceInSource(panel.visibleView, "function f()", "function new
FunctionCreatedWithLiveEdit()\n{\n}\nfunction f()", didEditScriptSource); | 122 replaceInSource(panel.visibleView, "function f()", "function new
FunctionCreatedWithLiveEdit()\n{\n}\nfunction f()", didEditScriptSource); |
| 123 } | 123 } |
| 124 | 124 |
| 125 function didEditScriptSource() | 125 function didEditScriptSource() |
| 126 { | 126 { |
| 127 var breakpoints = panel.visibleView._breakpoints; | 127 var breakpoints = panel.visibleView._breakpoints; |
| 128 for (var lineNumber in breakpoints) | 128 for (var lineNumber in breakpoints) |
| 129 InspectorTest.assertEquals("5", lineNumber); | 129 InspectorTest.assertEquals("5", lineNumber); |
| 130 next(); | 130 next(); |
| 131 } | 131 } |
| 132 }, | 132 }, |
| 133 | 133 |
| 134 function testNoCrashWhenLiveEditOnBreakpoint(next) | 134 function testNoCrashWhenLiveEditOnBreakpoint(next) |
| 135 { | 135 { |
| 136 InspectorTest.showScriptSource("edit-me.js", didShowScriptSource); | 136 InspectorTest.showScriptSource("edit-me.js", didShowScriptSource); |
| 137 | 137 |
| 138 var testSourceFrame; | 138 var testSourceFrame; |
| 139 | 139 |
| 140 function didShowScriptSource(sourceFrame) | 140 function didShowScriptSource(sourceFrame) |
| 141 { | 141 { |
| 142 testSourceFrame = sourceFrame; | 142 testSourceFrame = sourceFrame; |
| 143 InspectorTest.addSniffer(sourceFrame, "_addBreakpointDecoration"
, uiBreakpointAdded); | 143 InspectorTest.waitJavaScriptSourceFrameBreakpoints(testSourceFra
me).then(breakpointAdded); |
| 144 InspectorTest.setBreakpoint(sourceFrame, 3, "", true); | 144 InspectorTest.setBreakpoint(sourceFrame, 3, "", true); |
| 145 } | 145 } |
| 146 | 146 |
| 147 function uiBreakpointAdded() { | |
| 148 InspectorTest.addSniffer(testSourceFrame, "_addBreakpointDecorat
ion", breakpointAdded); | |
| 149 } | |
| 150 | |
| 151 function breakpointAdded() | 147 function breakpointAdded() |
| 152 { | 148 { |
| 153 InspectorTest.waitUntilPaused(pausedInF); | 149 InspectorTest.waitUntilPaused(pausedInF); |
| 154 InspectorTest.evaluateInPage("setTimeout(f, 0)"); | 150 InspectorTest.evaluateInPage("setTimeout(f, 0)"); |
| 155 } | 151 } |
| 156 | 152 |
| 157 function pausedInF(callFrames) | 153 function pausedInF(callFrames) |
| 158 { | 154 { |
| 159 replaceInSource(panel.visibleView, "function f()", "function f()
\n", didEditScriptSource); | 155 replaceInSource(panel.visibleView, "function f()", "function f()
\n", didEditScriptSource); |
| 160 } | 156 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 181 | 177 |
| 182 </script> | 178 </script> |
| 183 | 179 |
| 184 </head> | 180 </head> |
| 185 | 181 |
| 186 <body onload="runTest()"> | 182 <body onload="runTest()"> |
| 187 <p>Tests live edit feature.</p> | 183 <p>Tests live edit feature.</p> |
| 188 | 184 |
| 189 </body> | 185 </body> |
| 190 </html> | 186 </html> |
| OLD | NEW |