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 |
5 InspectorTest.log('Checks that we collect obsolete async tasks with async stacks
.'); | 5 let {session, contextGroup, Protocol} = InspectorTest.start('Checks that we coll
ect obsolete async tasks with async stacks.'); |
6 | 6 |
7 InspectorTest.addScript(` | 7 contextGroup.addScript(` |
8 function test() { | 8 function test() { |
9 inspector.setMaxAsyncTaskStacks(128); | 9 inspector.setMaxAsyncTaskStacks(128); |
10 var p = Promise.resolve(); | 10 var p = Promise.resolve(); |
11 | 11 |
12 inspector.dumpAsyncTaskStacksStateForTest(); | 12 inspector.dumpAsyncTaskStacksStateForTest(); |
13 inspector.setMaxAsyncTaskStacks(128); | 13 inspector.setMaxAsyncTaskStacks(128); |
14 inspector.dumpAsyncTaskStacksStateForTest(); | 14 inspector.dumpAsyncTaskStacksStateForTest(); |
15 | 15 |
16 p.then(() => 42).then(() => 239); | 16 p.then(() => 42).then(() => 239); |
17 | 17 |
18 inspector.dumpAsyncTaskStacksStateForTest(); | 18 inspector.dumpAsyncTaskStacksStateForTest(); |
19 inspector.setMaxAsyncTaskStacks(128); | 19 inspector.setMaxAsyncTaskStacks(128); |
20 inspector.dumpAsyncTaskStacksStateForTest(); | 20 inspector.dumpAsyncTaskStacksStateForTest(); |
21 | 21 |
22 setTimeout(() => 42, 0); | 22 setTimeout(() => 42, 0); |
23 | 23 |
24 inspector.dumpAsyncTaskStacksStateForTest(); | 24 inspector.dumpAsyncTaskStacksStateForTest(); |
25 inspector.setMaxAsyncTaskStacks(128); | 25 inspector.setMaxAsyncTaskStacks(128); |
26 inspector.dumpAsyncTaskStacksStateForTest(); | 26 inspector.dumpAsyncTaskStacksStateForTest(); |
27 } | 27 } |
28 `); | 28 `); |
29 | 29 |
30 (async function test() { | 30 (async function test() { |
31 Protocol.Debugger.enable(); | 31 Protocol.Debugger.enable(); |
32 Protocol.Debugger.setAsyncCallStackDepth({maxDepth: 128}); | 32 Protocol.Debugger.setAsyncCallStackDepth({maxDepth: 128}); |
33 await Protocol.Runtime.evaluate({expression: 'test()'}); | 33 await Protocol.Runtime.evaluate({expression: 'test()'}); |
34 InspectorTest.completeTest(); | 34 InspectorTest.completeTest(); |
35 })() | 35 })() |
OLD | NEW |