| OLD | NEW |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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 // TODO(kozyatinskiy): fix or remove it later. | 5 // TODO(kozyatinskiy): fix or remove it later. |
| 5 InspectorTest.log('Checks that we trim async call chains correctly.'); | 6 let {session, contextGroup, Protocol} = InspectorTest.start('Checks that we trim
async call chains correctly.'); |
| 6 | 7 |
| 7 Protocol.Debugger.enable(); | 8 Protocol.Debugger.enable(); |
| 8 InspectorTest.log('set async chain depth to 8'); | 9 InspectorTest.log('set async chain depth to 8'); |
| 9 Protocol.Debugger.setAsyncCallStackDepth({maxDepth: 8}); | 10 Protocol.Debugger.setAsyncCallStackDepth({maxDepth: 8}); |
| 10 InspectorTest.runAsyncTestSuite([ | 11 InspectorTest.runAsyncTestSuite([ |
| 11 async function testDebuggerPaused() { | 12 async function testDebuggerPaused() { |
| 12 runWithAsyncChain(4, 'debugger;'); | 13 runWithAsyncChain(4, 'debugger;'); |
| 13 dumpAsyncChainLength(await Protocol.Debugger.oncePaused()); | 14 dumpAsyncChainLength(await Protocol.Debugger.oncePaused()); |
| 14 await Protocol.Debugger.resume(); | 15 await Protocol.Debugger.resume(); |
| 15 | 16 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 153 |
| 153 function dumpAsyncChainLength(message) { | 154 function dumpAsyncChainLength(message) { |
| 154 let stackTrace = message.params.asyncStackTrace || message.params.stackTrace.p
arent; | 155 let stackTrace = message.params.asyncStackTrace || message.params.stackTrace.p
arent; |
| 155 let asyncChainCount = 0; | 156 let asyncChainCount = 0; |
| 156 while (stackTrace) { | 157 while (stackTrace) { |
| 157 ++asyncChainCount; | 158 ++asyncChainCount; |
| 158 stackTrace = stackTrace.parent; | 159 stackTrace = stackTrace.parent; |
| 159 } | 160 } |
| 160 InspectorTest.log(`actual async chain len: ${asyncChainCount}`); | 161 InspectorTest.log(`actual async chain len: ${asyncChainCount}`); |
| 161 } | 162 } |
| OLD | NEW |