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