| Index: test/inspector/debugger/stepping-and-break-program-api.js
|
| diff --git a/test/inspector/debugger/stepping-and-break-program-api.js b/test/inspector/debugger/stepping-and-break-program-api.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4900843fc533fd54066497f7794a0ece6d09398f
|
| --- /dev/null
|
| +++ b/test/inspector/debugger/stepping-and-break-program-api.js
|
| @@ -0,0 +1,34 @@
|
| +// Copyright 2017 the V8 project authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +InspectorTest.log('Checks that stepping is cleared after breakProgram.');
|
| +
|
| +InspectorTest.addScript(`
|
| +function callBreakProgram() {
|
| + debugger;
|
| + breakProgram('reason', '');
|
| +}`);
|
| +
|
| +InspectorTest.setupScriptMap();
|
| +(async function test() {
|
| + Protocol.Debugger.enable();
|
| + Protocol.Runtime.evaluate({expression: 'callBreakProgram();'});
|
| + // Should break at this debugger statement, not at end of callBreakProgram.
|
| + Protocol.Runtime.evaluate({expression: 'setTimeout(\'debugger;\', 0);'});
|
| + await waitPauseAndDumpLocation();
|
| + Protocol.Debugger.stepOver();
|
| + await waitPauseAndDumpLocation();
|
| + Protocol.Debugger.stepOver();
|
| + await waitPauseAndDumpLocation();
|
| + Protocol.Debugger.resume();
|
| + await waitPauseAndDumpLocation();
|
| + InspectorTest.completeTest();
|
| +})();
|
| +
|
| +async function waitPauseAndDumpLocation() {
|
| + var message = await Protocol.Debugger.oncePaused();
|
| + InspectorTest.log('paused at:');
|
| + InspectorTest.logSourceLocation(message.params.callFrames[0].location);
|
| + return message;
|
| +}
|
|
|