2017-03-13 14:59:43 +00:00
|
|
|
// 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.
|
|
|
|
|
2017-05-19 00:35:45 +00:00
|
|
|
let {session, contextGroup, Protocol} = InspectorTest.start('Checks that stepping is cleared after breakProgram.');
|
2017-03-13 14:59:43 +00:00
|
|
|
|
2017-05-19 00:35:45 +00:00
|
|
|
contextGroup.addScript(`
|
2017-03-13 14:59:43 +00:00
|
|
|
function callBreakProgram() {
|
|
|
|
debugger;
|
2017-04-21 23:41:07 +00:00
|
|
|
inspector.breakProgram('reason', '');
|
2017-03-13 14:59:43 +00:00
|
|
|
}`);
|
|
|
|
|
2017-05-19 00:35:45 +00:00
|
|
|
session.setupScriptMap();
|
2017-03-13 14:59:43 +00:00
|
|
|
(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:');
|
2017-05-19 00:35:45 +00:00
|
|
|
session.logSourceLocation(message.params.callFrames[0].location);
|
2017-03-13 14:59:43 +00:00
|
|
|
return message;
|
|
|
|
}
|