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