2017-07-24 16:23:04 +00:00
|
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
|
|
|
|
common.skipIfInspectorDisabled();
|
|
|
|
|
|
|
|
const assert = require('assert');
|
2018-01-16 22:35:54 +00:00
|
|
|
const { NodeInstance } = require('../common/inspector-helper.js');
|
2017-07-24 16:23:04 +00:00
|
|
|
|
|
|
|
async function testBreakpointOnStart(session) {
|
|
|
|
const commands = [
|
|
|
|
{ 'method': 'Runtime.enable' },
|
|
|
|
{ 'method': 'Debugger.enable' },
|
|
|
|
{ 'method': 'Debugger.setPauseOnExceptions',
|
|
|
|
'params': { 'state': 'none' } },
|
|
|
|
{ 'method': 'Debugger.setAsyncCallStackDepth',
|
|
|
|
'params': { 'maxDepth': 0 } },
|
|
|
|
{ 'method': 'Profiler.enable' },
|
|
|
|
{ 'method': 'Profiler.setSamplingInterval',
|
|
|
|
'params': { 'interval': 100 } },
|
|
|
|
{ 'method': 'Debugger.setBlackboxPatterns',
|
|
|
|
'params': { 'patterns': [] } },
|
|
|
|
{ 'method': 'Runtime.runIfWaitingForDebugger' }
|
|
|
|
];
|
|
|
|
|
|
|
|
session.send(commands);
|
2018-08-30 21:59:34 +00:00
|
|
|
await session.waitForBreakOnLine(0, session.scriptURL());
|
2017-07-24 16:23:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
async function runTests() {
|
2020-04-05 20:27:46 +00:00
|
|
|
const child = new NodeInstance(['--inspect', '--inspect-brk']);
|
2017-07-24 16:23:04 +00:00
|
|
|
const session = await child.connectInspectorSession();
|
|
|
|
|
|
|
|
await testBreakpointOnStart(session);
|
|
|
|
await session.runToCompletion();
|
|
|
|
|
2018-10-12 16:55:48 +00:00
|
|
|
assert.strictEqual((await child.expectShutdown()).exitCode, 55);
|
2017-07-24 16:23:04 +00:00
|
|
|
}
|
|
|
|
|
2020-04-05 20:27:46 +00:00
|
|
|
runTests().then(common.mustCall());
|