11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ciconst common = require('../common'); 41cb0ef41Sopenharmony_cicommon.skipIfInspectorDisabled(); 51cb0ef41Sopenharmony_ci 61cb0ef41Sopenharmony_ci(async function test() { 71cb0ef41Sopenharmony_ci const assert = require('assert'); 81cb0ef41Sopenharmony_ci const { Session } = require('inspector'); 91cb0ef41Sopenharmony_ci const { promisify } = require('util'); 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_ci const session = new Session(); 121cb0ef41Sopenharmony_ci session.connect(); 131cb0ef41Sopenharmony_ci session.post = promisify(session.post); 141cb0ef41Sopenharmony_ci await assert.rejects( 151cb0ef41Sopenharmony_ci session.post('Runtime.evaluate', { 161cb0ef41Sopenharmony_ci expression: 'for(;;);', 171cb0ef41Sopenharmony_ci timeout: 0 181cb0ef41Sopenharmony_ci }), 191cb0ef41Sopenharmony_ci { 201cb0ef41Sopenharmony_ci code: 'ERR_INSPECTOR_COMMAND', 211cb0ef41Sopenharmony_ci message: 'Inspector error -32000: Execution was terminated' 221cb0ef41Sopenharmony_ci } 231cb0ef41Sopenharmony_ci ); 241cb0ef41Sopenharmony_ci session.disconnect(); 251cb0ef41Sopenharmony_ci})().then(common.mustCall()); 26