| 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. |
| 6 let {session, contextGroup, Protocol} = InspectorTest.start('Tests how async pro
mise chains behave when reaching the limit of stacks'); |
| 7 |
| 5 (async function test(){ | 8 (async function test(){ |
| 6 InspectorTest.log('Checks correctness of promise chains when limit hit'); | 9 InspectorTest.log('Checks correctness of promise chains when limit hit'); |
| 7 await Protocol.Runtime.enable(); | 10 await Protocol.Runtime.enable(); |
| 8 await Protocol.Debugger.enable(); | 11 await Protocol.Debugger.enable(); |
| 9 Protocol.Debugger.setAsyncCallStackDepth({maxDepth: 128}); | 12 Protocol.Debugger.setAsyncCallStackDepth({maxDepth: 128}); |
| 10 | 13 |
| 11 await setMaxAsyncTaskStacks(3); | 14 await setMaxAsyncTaskStacks(3); |
| 12 runWithAsyncChainPromise(3, 'console.trace()'); | 15 runWithAsyncChainPromise(3, 'console.trace()'); |
| 13 InspectorTest.logMessage(await Protocol.Runtime.onceConsoleAPICalled()); | 16 InspectorTest.logMessage(await Protocol.Runtime.onceConsoleAPICalled()); |
| 14 | 17 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 42 Protocol.Runtime.evaluate({ | 45 Protocol.Runtime.evaluate({ |
| 43 expression: `Promise.resolve()${then.repeat(len - 1)}${pause}` | 46 expression: `Promise.resolve()${then.repeat(len - 1)}${pause}` |
| 44 }); | 47 }); |
| 45 } | 48 } |
| 46 | 49 |
| 47 async function setMaxAsyncTaskStacks(max) { | 50 async function setMaxAsyncTaskStacks(max) { |
| 48 let expression = `inspector.setMaxAsyncTaskStacks(${max})`; | 51 let expression = `inspector.setMaxAsyncTaskStacks(${max})`; |
| 49 InspectorTest.log(expression); | 52 InspectorTest.log(expression); |
| 50 await Protocol.Runtime.evaluate({expression}); | 53 await Protocol.Runtime.evaluate({expression}); |
| 51 } | 54 } |
| OLD | NEW |