11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ciconst common = require('../common'); 31cb0ef41Sopenharmony_ciconst assert = require('assert'); 41cb0ef41Sopenharmony_ciconst cp = require('child_process'); 51cb0ef41Sopenharmony_ciconst fixtures = require('../common/fixtures'); 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ciconst fixture = fixtures.path('empty.js'); 81cb0ef41Sopenharmony_ciconst child = cp.fork(fixture); 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_cichild.on('close', common.mustCall((code, signal) => { 111cb0ef41Sopenharmony_ci assert.strictEqual(code, 0); 121cb0ef41Sopenharmony_ci assert.strictEqual(signal, null); 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ci const testError = common.expectsError({ 151cb0ef41Sopenharmony_ci name: 'Error', 161cb0ef41Sopenharmony_ci message: 'Channel closed', 171cb0ef41Sopenharmony_ci code: 'ERR_IPC_CHANNEL_CLOSED' 181cb0ef41Sopenharmony_ci }, 2); 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_ci child.on('error', testError); 211cb0ef41Sopenharmony_ci 221cb0ef41Sopenharmony_ci { 231cb0ef41Sopenharmony_ci const result = child.send('ping'); 241cb0ef41Sopenharmony_ci assert.strictEqual(result, false); 251cb0ef41Sopenharmony_ci } 261cb0ef41Sopenharmony_ci 271cb0ef41Sopenharmony_ci { 281cb0ef41Sopenharmony_ci const result = child.send('pong', testError); 291cb0ef41Sopenharmony_ci assert.strictEqual(result, false); 301cb0ef41Sopenharmony_ci } 311cb0ef41Sopenharmony_ci})); 32