xref: /third_party/node/test/parallel/test-inspector-not-blocked-on-idle.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_cicommon.skipIfInspectorDisabled();
41cb0ef41Sopenharmony_ciconst { NodeInstance } = require('../common/inspector-helper.js');
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ciasync function runTests() {
71cb0ef41Sopenharmony_ci  const script = 'setInterval(() => {debugger;}, 60000);';
81cb0ef41Sopenharmony_ci  const node = new NodeInstance('--inspect=0', script);
91cb0ef41Sopenharmony_ci  // 1 second wait to make sure the inferior began running the script
101cb0ef41Sopenharmony_ci  await new Promise((resolve) => setTimeout(() => resolve(), 1000));
111cb0ef41Sopenharmony_ci  const session = await node.connectInspectorSession();
121cb0ef41Sopenharmony_ci  await session.send([
131cb0ef41Sopenharmony_ci    { 'method': 'Debugger.enable' },
141cb0ef41Sopenharmony_ci    { 'method': 'Debugger.pause' },
151cb0ef41Sopenharmony_ci  ]);
161cb0ef41Sopenharmony_ci  session.disconnect();
171cb0ef41Sopenharmony_ci  node.kill();
181cb0ef41Sopenharmony_ci}
191cb0ef41Sopenharmony_ci
201cb0ef41Sopenharmony_cirunTests().then(common.mustCall());
21

Indexes created Thu Nov 07 10:32:03 CST 2024