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

Side by Side Diff: test/inspector/debugger/async-stack-for-promise.js

Issue 2648873002: [inspector] added creation frame for async call chains for promises (Closed)
Patch Set: fixed usage of external reference Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 print('Checks that async chains for promises are correct.'); 5 print('Checks that async chains for promises are correct.');
6 6
7 InspectorTest.addScript(` 7 InspectorTest.addScript(`
8 function foo1() { 8 function foo1() {
9 debugger; 9 debugger;
10 } 10 }
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 //# sourceURL=test.js`, 7, 26); 220 //# sourceURL=test.js`, 7, 26);
221 221
222 InspectorTest.setupScriptMap(); 222 InspectorTest.setupScriptMap();
223 Protocol.Debugger.onPaused(message => { 223 Protocol.Debugger.onPaused(message => {
224 InspectorTest.logCallFrames(message.params.callFrames); 224 InspectorTest.logCallFrames(message.params.callFrames);
225 var asyncStackTrace = message.params.asyncStackTrace; 225 var asyncStackTrace = message.params.asyncStackTrace;
226 while (asyncStackTrace) { 226 while (asyncStackTrace) {
227 InspectorTest.log(`-- ${asyncStackTrace.description} --`); 227 InspectorTest.log(`-- ${asyncStackTrace.description} --`);
228 InspectorTest.logCallFrames(asyncStackTrace.callFrames); 228 InspectorTest.logCallFrames(asyncStackTrace.callFrames);
229 if (asyncStackTrace.creationFrame) {
230 InspectorTest.log('--- created in ---');
231 InspectorTest.logCallFrames([asyncStackTrace.creationFrame]);
232 }
229 asyncStackTrace = asyncStackTrace.parent; 233 asyncStackTrace = asyncStackTrace.parent;
230 } 234 }
231 InspectorTest.log(''); 235 InspectorTest.log('');
232 Protocol.Debugger.resume(); 236 Protocol.Debugger.resume();
233 }); 237 });
234 238
235 Protocol.Debugger.enable(); 239 Protocol.Debugger.enable();
236 Protocol.Debugger.setAsyncCallStackDepth({ maxDepth: 128 }); 240 Protocol.Debugger.setAsyncCallStackDepth({ maxDepth: 128 });
237 var testList = [ 241 var testList = [
238 'promise', 242 'promise',
(...skipping 17 matching lines...) Expand all
256 Protocol.Runtime.evaluate({ expression: \`${name}() 260 Protocol.Runtime.evaluate({ expression: \`${name}()
257 //# sourceURL=test${capitalize(name)}.js\`, awaitPromise: true}) 261 //# sourceURL=test${capitalize(name)}.js\`, awaitPromise: true})
258 .then(next); 262 .then(next);
259 }) 263 })
260 `); 264 `);
261 })); 265 }));
262 266
263 function capitalize(string) { 267 function capitalize(string) {
264 return string.charAt(0).toUpperCase() + string.slice(1); 268 return string.charAt(0).toUpperCase() + string.slice(1);
265 } 269 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698