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 stepping is cleared after breakProgram.'); | 5 InspectorTest.log('Checks that stepping is cleared after breakProgram.'); |
6 | 6 |
7 InspectorTest.addScript(` | 7 InspectorTest.addScript(` |
8 function callBreakProgram() { | 8 function callBreakProgram() { |
9 debugger; | 9 debugger; |
10 breakProgram('reason', ''); | 10 inspector.breakProgram('reason', ''); |
11 }`); | 11 }`); |
12 | 12 |
13 InspectorTest.setupScriptMap(); | 13 InspectorTest.setupScriptMap(); |
14 (async function test() { | 14 (async function test() { |
15 Protocol.Debugger.enable(); | 15 Protocol.Debugger.enable(); |
16 Protocol.Runtime.evaluate({expression: 'callBreakProgram();'}); | 16 Protocol.Runtime.evaluate({expression: 'callBreakProgram();'}); |
17 // Should break at this debugger statement, not at end of callBreakProgram. | 17 // Should break at this debugger statement, not at end of callBreakProgram. |
18 Protocol.Runtime.evaluate({expression: 'setTimeout(\'debugger;\', 0);'}); | 18 Protocol.Runtime.evaluate({expression: 'setTimeout(\'debugger;\', 0);'}); |
19 await waitPauseAndDumpLocation(); | 19 await waitPauseAndDumpLocation(); |
20 Protocol.Debugger.stepOver(); | 20 Protocol.Debugger.stepOver(); |
21 await waitPauseAndDumpLocation(); | 21 await waitPauseAndDumpLocation(); |
22 Protocol.Debugger.stepOver(); | 22 Protocol.Debugger.stepOver(); |
23 await waitPauseAndDumpLocation(); | 23 await waitPauseAndDumpLocation(); |
24 Protocol.Debugger.resume(); | 24 Protocol.Debugger.resume(); |
25 await waitPauseAndDumpLocation(); | 25 await waitPauseAndDumpLocation(); |
26 InspectorTest.completeTest(); | 26 InspectorTest.completeTest(); |
27 })(); | 27 })(); |
28 | 28 |
29 async function waitPauseAndDumpLocation() { | 29 async function waitPauseAndDumpLocation() { |
30 var message = await Protocol.Debugger.oncePaused(); | 30 var message = await Protocol.Debugger.oncePaused(); |
31 InspectorTest.log('paused at:'); | 31 InspectorTest.log('paused at:'); |
32 InspectorTest.logSourceLocation(message.params.callFrames[0].location); | 32 InspectorTest.logSourceLocation(message.params.callFrames[0].location); |
33 return message; | 33 return message; |
34 } | 34 } |
OLD | NEW |