mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.1 KiB
30 lines
1.1 KiB
'use strict';
|
|
const common = require('../common');
|
|
common.skipIfInspectorDisabled();
|
|
const assert = require('assert');
|
|
const { NodeInstance } = require('../common/inspector-helper.js');
|
|
|
|
async function runTests() {
|
|
const child = new NodeInstance(['--inspect=0'],
|
|
`let c = 0;
|
|
const interval = setInterval(() => {
|
|
console.log(new Object());
|
|
if (c++ === 10)
|
|
clearInterval(interval);
|
|
}, 10);`);
|
|
const session = await child.connectInspectorSession();
|
|
|
|
session.send([
|
|
{ 'method': 'Profiler.setSamplingInterval', 'params': { 'interval': 100 } },
|
|
{ 'method': 'Profiler.enable' },
|
|
{ 'method': 'Runtime.runIfWaitingForDebugger' },
|
|
{ 'method': 'Profiler.start' }]);
|
|
while (await child.nextStderrString() !==
|
|
'Waiting for the debugger to disconnect...');
|
|
await session.send({ 'method': 'Profiler.stop' });
|
|
session.disconnect();
|
|
assert.strictEqual(0, (await child.expectShutdown()).exitCode);
|
|
}
|
|
|
|
common.crashOnUnhandledRejection();
|
|
runTests();
|
|
|