Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit.html

Issue 2526013002: [DevTools] Added inline breakpoints (Closed)
Patch Set: rebased test Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 103
104 function didEditScriptSource() 104 function didEditScriptSource()
105 { 105 {
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 var testSourceFrame;
112 InspectorTest.showScriptSource("edit-me.js", didShowScriptSource); 113 InspectorTest.showScriptSource("edit-me.js", didShowScriptSource);
113 114
114 function didShowScriptSource(sourceFrame) 115 function didShowScriptSource(sourceFrame)
115 { 116 {
117 testSourceFrame = sourceFrame;
118 InspectorTest.prepareSourceFrameForBreakpointTest(sourceFrame);
116 InspectorTest.waitJavaScriptSourceFrameBreakpoints(sourceFrame). then(breakpointAdded); 119 InspectorTest.waitJavaScriptSourceFrameBreakpoints(sourceFrame). then(breakpointAdded);
117 InspectorTest.setBreakpoint(sourceFrame, 2, "", true); 120 InspectorTest.setBreakpoint(sourceFrame, 2, "", true);
118 } 121 }
119 122
120 function breakpointAdded() 123 function breakpointAdded()
121 { 124 {
122 replaceInSource(panel.visibleView, "function f()", "function new FunctionCreatedWithLiveEdit()\n{\n}\nfunction f()", didEditScriptSource); 125 replaceInSource(panel.visibleView, "function f()", "function new FunctionCreatedWithLiveEdit()\n{\n}\nfunction f()", didEditScriptSource);
123 } 126 }
124 127
125 function didEditScriptSource() 128 function didEditScriptSource()
126 { 129 {
127 var breakpoints = panel.visibleView._breakpoints; 130 InspectorTest.waitJavaScriptSourceFrameBreakpoints(testSourceFra me)
128 for (var lineNumber in breakpoints) 131 .then(() => InspectorTest.dumpJavaScriptSourceFrameBreakpoin ts(testSourceFrame))
129 InspectorTest.assertEquals("5", lineNumber); 132 .then(() => Bindings.breakpointManager._allBreakpoints().map (breakpoint => breakpoint.remove()))
130 next(); 133 .then(next);
131 } 134 }
132 }, 135 },
133 136
134 function testNoCrashWhenLiveEditOnBreakpoint(next) 137 function testNoCrashWhenLiveEditOnBreakpoint(next)
135 { 138 {
136 InspectorTest.showScriptSource("edit-me.js", didShowScriptSource); 139 InspectorTest.showScriptSource("edit-me.js", didShowScriptSource);
137 140
138 var testSourceFrame; 141 var testSourceFrame;
139 142
140 function didShowScriptSource(sourceFrame) 143 function didShowScriptSource(sourceFrame)
141 { 144 {
142 testSourceFrame = sourceFrame; 145 testSourceFrame = sourceFrame;
146 InspectorTest.prepareSourceFrameForBreakpointTest(sourceFrame);
143 InspectorTest.waitJavaScriptSourceFrameBreakpoints(testSourceFra me).then(breakpointAdded); 147 InspectorTest.waitJavaScriptSourceFrameBreakpoints(testSourceFra me).then(breakpointAdded);
144 InspectorTest.setBreakpoint(sourceFrame, 3, "", true); 148 InspectorTest.setBreakpoint(sourceFrame, 3, "", true);
145 } 149 }
146 150
147 function breakpointAdded() 151 function breakpointAdded()
148 { 152 {
149 InspectorTest.waitUntilPaused(pausedInF); 153 InspectorTest.waitUntilPaused(pausedInF);
150 InspectorTest.evaluateInPage("setTimeout(f, 0)"); 154 InspectorTest.evaluateInPage("setTimeout(f, 0)");
151 } 155 }
152 156
(...skipping 24 matching lines...) Expand all
177 181
178 </script> 182 </script>
179 183
180 </head> 184 </head>
181 185
182 <body onload="runTest()"> 186 <body onload="runTest()">
183 <p>Tests live edit feature.</p> 187 <p>Tests live edit feature.</p>
184 188
185 </body> 189 </body>
186 </html> 190 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698