Lines Matching refs:writer
33 const writer = ws.getWriter();
36 return writeArrayToStream(input, writer)
43 const writer = ws.getWriter();
46 return writeArrayToStream(input, writer)
58 const writer = ws.getWriter();
60 const writePromise = writer.write('a');
76 const writer = ws.getWriter();
78 assert_equals(writer.desiredSize, 1, 'desiredSize should be 1');
80 return writer.ready.then(() => {
81 const writePromise = writer.write('a');
85 assert_equals(writer.desiredSize, 0, 'desiredSize should be 0 after writer.write()');
94 writer.ready.then(value => {
95 assert_equals(resolveSinkWritePromise, undefined, 'sinkWritePromise should be fulfilled before writer.ready');
96 assert_true(writePromiseResolved, 'writePromise should be fulfilled before writer.ready');
98 assert_equals(writer.desiredSize, 1, 'desiredSize should be 1 again');
119 const writer = ws.getWriter();
121 assert_equals(writer.desiredSize, 1, 'desiredSize should be 1');
123 return writer.ready.then(() => {
124 const writePromise = writer.write('a');
126 assert_equals(writer.desiredSize, 0, 'desiredSize should be 0');
128 const writePromise2 = writer.write('b');
130 assert_equals(writer.desiredSize, -1, 'desiredSize should be -1');
132 const closedPromise = writer.close();
134 assert_equals(writer.desiredSize, -1, 'desiredSize should still be -1');
164 const writer = ws.getWriter();
166 return promise_rejects_exactly(t, error1, writer.write('a'),
168 .then(() => promise_rejects_js(t, TypeError, writer.close(), 'close() should be rejected'));
179 const writer = ws.getWriter();
181 return promise_rejects_exactly(t, error2, writer.write('a'),
185 promise_rejects_exactly(t, error1, writer.ready,
186 'writer.ready must reject with the error passed to the controller'),
187 promise_rejects_exactly(t, error1, writer.closed,
188 'writer.closed must reject with the error passed to the controller')
191 }, 'writer.write(), ready and closed reject with the error passed to controller.error() made before sink.write' +
211 const writer = ws.getWriter();
212 return writer.ready.then(() => {
214 writer.write('a');
216 const writePromise = writer.write('a');
233 const writer = new WritableStreamDefaultWriter(stream);
234 return writer.ready.then(() => {
235 writer.write('a');
257 const writer = stream.getWriter();
258 const WritableStreamDefaultWriter = writer.constructor;
261 // If stream.[[writer]] no longer points to |writer| then the closed Promise
263 return Promise.all([writer.close(), writer.closed]);
264 }, 'failing DefaultWriter constructor should not release an existing writer');
272 const writer = ws.getWriter();
274 promise_rejects_exactly(t, error1, writer.ready, 'ready should be rejected'),
275 promise_rejects_exactly(t, error1, writer.write(), 'write() should be rejected')
281 const writer = ws.getWriter();
282 writer.releaseLock();
283 return promise_rejects_js(t, TypeError, writer.write(), 'write should reject');
284 }, 'writing to a released writer should reject the returned promise');