11cb0ef41Sopenharmony_ci// Flags: --expose-internals 21cb0ef41Sopenharmony_ci'use strict'; 31cb0ef41Sopenharmony_cirequire('../common'); 41cb0ef41Sopenharmony_ciconst assert = require('assert'); 51cb0ef41Sopenharmony_ciconst { getDefaultHighWaterMark } = require('internal/streams/state'); 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ciconst http = require('http'); 81cb0ef41Sopenharmony_ciconst OutgoingMessage = http.OutgoingMessage; 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_ciconst msg = new OutgoingMessage(); 111cb0ef41Sopenharmony_cimsg._implicitHeader = function() {}; 121cb0ef41Sopenharmony_ci 131cb0ef41Sopenharmony_ci// Writes should be buffered until highwatermark 141cb0ef41Sopenharmony_ci// even when no socket is assigned. 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_ciassert.strictEqual(msg.write('asd'), true); 171cb0ef41Sopenharmony_ciwhile (msg.write('asd')); 181cb0ef41Sopenharmony_ciconst highwatermark = msg.writableHighWaterMark || getDefaultHighWaterMark(); 191cb0ef41Sopenharmony_ciassert(msg.outputSize >= highwatermark); 20