xref: /third_party/node/test/parallel/test-http-outgoing-buffer.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
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

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