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

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

Issue 329533002: DevTools: Added test that LiveEdit doesn't crash on breakpoint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master2
Patch Set: Created 6 years, 6 months 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
« no previous file with comments | « no previous file | LayoutTests/inspector/sources/debugger/live-edit-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-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
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 var testSourceFrame;
129
130 function didShowScriptSource(sourceFrame)
131 {
132 testSourceFrame = sourceFrame;
133 InspectorTest.addSniffer(sourceFrame, "_addBreakpointDecoration" , uiBreakpointAdded);
134 InspectorTest.setBreakpoint(sourceFrame, 3, "", true);
135 }
136
137 function uiBreakpointAdded() {
138 InspectorTest.addSniffer(testSourceFrame, "_addBreakpointDecorat ion", breakpointAdded);
139 }
140
141 function breakpointAdded()
142 {
143 InspectorTest.waitUntilPaused(pausedInF);
144 InspectorTest.evaluateInPage("setTimeout(f, 0)");
145 }
146
147 function pausedInF(callFrames)
148 {
149 replaceInSource(panel.visibleView, "function f()", "function f() \n", didEditScriptSource);
150 }
151
152 function didEditScriptSource()
153 {
154 InspectorTest.resumeExecution(resumed);
155 }
156
157 function resumed()
158 {
159 next();
160 }
122 } 161 }
123 ]); 162 ]);
124 163
125 function replaceInSource(sourceFrame, string, replacement, callback) 164 function replaceInSource(sourceFrame, string, replacement, callback)
126 { 165 {
127 InspectorTest.addSniffer(WebInspector.debuggerModel, "_didEditScriptSour ce", callback); 166 InspectorTest.addSniffer(WebInspector.debuggerModel, "_didEditScriptSour ce", callback);
128 InspectorTest.replaceInSource(sourceFrame, string, replacement); 167 InspectorTest.replaceInSource(sourceFrame, string, replacement);
129 InspectorTest.commitSource(sourceFrame); 168 InspectorTest.commitSource(sourceFrame);
130
131 } 169 }
132 }; 170 };
133 171
134 </script> 172 </script>
135 173
136 </head> 174 </head>
137 175
138 <body onload="runTest()"> 176 <body onload="runTest()">
139 <p>Tests live edit feature.</p> 177 <p>Tests live edit feature.</p>
140 178
141 </body> 179 </body>
142 </html> 180 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/sources/debugger/live-edit-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698