11cb0ef41Sopenharmony_ci// META: global=window,worker 21cb0ef41Sopenharmony_ci'use strict'; 31cb0ef41Sopenharmony_ci 41cb0ef41Sopenharmony_cipromise_test(() => { 51cb0ef41Sopenharmony_ci const rs = new ReadableStream({ 61cb0ef41Sopenharmony_ci start(c) { 71cb0ef41Sopenharmony_ci c.enqueue('a'); 81cb0ef41Sopenharmony_ci c.enqueue('b'); 91cb0ef41Sopenharmony_ci c.enqueue('c'); 101cb0ef41Sopenharmony_ci c.close(); 111cb0ef41Sopenharmony_ci } 121cb0ef41Sopenharmony_ci }); 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ci const ts = new TransformStream(); 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_ci const ws = new WritableStream(); 171cb0ef41Sopenharmony_ci 181cb0ef41Sopenharmony_ci return rs.pipeThrough(ts).pipeTo(ws).then(() => { 191cb0ef41Sopenharmony_ci const writer = ws.getWriter(); 201cb0ef41Sopenharmony_ci return writer.closed; 211cb0ef41Sopenharmony_ci }); 221cb0ef41Sopenharmony_ci}, 'Piping through an identity transform stream should close the destination when the source closes'); 23