OLD | NEW |
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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 function reject() { | 216 function reject() { |
217 return Promise.reject().catch(foo1); | 217 return Promise.reject().catch(foo1); |
218 } | 218 } |
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 InspectorTest.logAsyncStackTrace(message.params.asyncStackTrace); |
226 while (asyncStackTrace) { | |
227 InspectorTest.log(`-- ${asyncStackTrace.description} --`); | |
228 InspectorTest.logCallFrames(asyncStackTrace.callFrames); | |
229 asyncStackTrace = asyncStackTrace.parent; | |
230 } | |
231 InspectorTest.log(''); | 226 InspectorTest.log(''); |
232 Protocol.Debugger.resume(); | 227 Protocol.Debugger.resume(); |
233 }); | 228 }); |
234 | 229 |
235 Protocol.Debugger.enable(); | 230 Protocol.Debugger.enable(); |
236 Protocol.Debugger.setAsyncCallStackDepth({ maxDepth: 128 }); | 231 Protocol.Debugger.setAsyncCallStackDepth({ maxDepth: 128 }); |
237 var testList = [ | 232 var testList = [ |
238 'promise', | 233 'promise', |
239 'promiseResolvedBySetTimeout', | 234 'promiseResolvedBySetTimeout', |
240 'promiseAll', | 235 'promiseAll', |
(...skipping 15 matching lines...) Expand all Loading... |
256 Protocol.Runtime.evaluate({ expression: \`${name}() | 251 Protocol.Runtime.evaluate({ expression: \`${name}() |
257 //# sourceURL=test${capitalize(name)}.js\`, awaitPromise: true}) | 252 //# sourceURL=test${capitalize(name)}.js\`, awaitPromise: true}) |
258 .then(next); | 253 .then(next); |
259 }) | 254 }) |
260 `); | 255 `); |
261 })); | 256 })); |
262 | 257 |
263 function capitalize(string) { | 258 function capitalize(string) { |
264 return string.charAt(0).toUpperCase() + string.slice(1); | 259 return string.charAt(0).toUpperCase() + string.slice(1); |
265 } | 260 } |
OLD | NEW |