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 stepping with more then one context group.'); | 5 InspectorTest.log('Checks stepping with more then one context group.'); |
6 | 6 |
| 7 var contextGroup1 = new InspectorTest.ContextGroup(); |
| 8 var session1 = contextGroup1.connect(); |
| 9 session1.setupScriptMap(); |
| 10 |
| 11 let contextGroup2 = new InspectorTest.ContextGroup(); |
| 12 let session2 = contextGroup2.connect(); |
| 13 session2.setupScriptMap(); |
| 14 |
7 (async function test() { | 15 (async function test() { |
8 InspectorTest.setupScriptMap(); | 16 await session1.Protocol.Debugger.enable(); |
9 await Protocol.Debugger.enable(); | 17 await session2.Protocol.Debugger.enable({}); |
10 let contextGroup = InspectorTest.createContextGroup(); | 18 session1.Protocol.Runtime.evaluate({expression: 'debugger'}); |
11 let session = InspectorTest.createSession(contextGroup); | 19 session2.Protocol.Runtime.evaluate({expression: 'setTimeout(() => { debugger }
, 0)'}); |
12 InspectorTest.setupScriptMap(session); | 20 session1.Protocol.Runtime.evaluate({expression: 'setTimeout(() => 42, 0)'}); |
13 await session.Protocol.Debugger.enable({}); | 21 await waitPauseAndDumpLocation(session1); |
14 Protocol.Runtime.evaluate({expression: 'debugger'}); | 22 session1.Protocol.Debugger.stepOver(); |
15 session.Protocol.Runtime.evaluate({expression: 'setTimeout(() => { debugger },
0)'}); | 23 await session1.Protocol.Debugger.oncePaused(); |
16 Protocol.Runtime.evaluate({expression: 'setTimeout(() => 42, 0)'}); | 24 session1.Protocol.Debugger.stepOver(); |
17 await waitPauseAndDumpLocation(InspectorTest.session); | 25 await waitPauseAndDumpLocation(session1); |
18 Protocol.Debugger.stepOver(); | 26 await session2.Protocol.Debugger.disable({}); |
19 await Protocol.Debugger.oncePaused(); | 27 await session1.Protocol.Debugger.disable(); |
20 Protocol.Debugger.stepOver(); | |
21 await waitPauseAndDumpLocation(InspectorTest.session); | |
22 await session.Protocol.Debugger.disable({}); | |
23 await Protocol.Debugger.disable(); | |
24 InspectorTest.completeTest(); | 28 InspectorTest.completeTest(); |
25 })(); | 29 })(); |
26 | 30 |
27 async function waitPauseAndDumpLocation(session) { | 31 async function waitPauseAndDumpLocation(session) { |
28 var message = await session.Protocol.Debugger.oncePaused(); | 32 var message = await session.Protocol.Debugger.oncePaused(); |
29 InspectorTest.log('paused at:'); | 33 InspectorTest.log('paused at:'); |
30 await InspectorTest.logSourceLocation(message.params.callFrames[0].location, s
ession); | 34 await session.logSourceLocation(message.params.callFrames[0].location); |
31 return message; | 35 return message; |
32 } | 36 } |
OLD | NEW |