Lines Matching refs:read

105       promise_rejects_exactly(t, error, reader.read())
116 promise_rejects_exactly(t, error, reader.read()),
117 promise_rejects_exactly(t, error, reader.read()),
121 }, label + ': read() twice should give the error each time');
196 assert_equals(typeof reader.read, 'function', 'has a read method');
213 reader.read().then(
214 t.unreached_func('read() should not fulfill'),
215 t.unreached_func('read() should not reject')
220 }, label + ': read() should never settle');
226 reader.read().then(
227 t.unreached_func('read() should not fulfill'),
228 t.unreached_func('read() should not reject')
231 reader.read().then(
232 t.unreached_func('read() should not fulfill'),
233 t.unreached_func('read() should not reject')
238 }, label + ': two read()s should both never settle');
243 assert_not_equals(reader.read(), reader.read(), 'the promises returned should be distinct');
245 }, label + ': read() should return distinct promises each time');
260 const read1 = reader.read();
261 const read2 = reader.read();
269 promise_rejects_js(t, TypeError, read1, 'first read should reject'),
270 promise_rejects_js(t, TypeError, read2, 'second read should reject'),
274 }, label + ': releasing the lock should reject all pending read requests');
282 promise_rejects_js(t, TypeError, reader.read()),
283 promise_rejects_js(t, TypeError, reader.read())
286 }, label + ': releasing the lock should cause further read() calls to reject with a TypeError');
318 return reader.read().then(r => {
319 assert_object_equals(r, { value: undefined, done: true }, 'read()ing from the reader should give a done result');
339 return reader.read().then(v => {
340 assert_object_equals(v, { value: undefined, done: true }, 'read() should fulfill correctly');
343 }, label + ': read() should fulfill with { value: undefined, done: true }');
350 reader.read().then(v => {
351 assert_object_equals(v, { value: undefined, done: true }, 'read() should fulfill correctly');
353 reader.read().then(v => {
354 assert_object_equals(v, { value: undefined, done: true }, 'read() should fulfill correctly');
358 }, label + ': read() multiple times should fulfill with { value: undefined, done: true }');
364 return reader.read().then(() => reader.read()).then(v => {
365 assert_object_equals(v, { value: undefined, done: true }, 'read() should fulfill correctly');
368 }, label + ': read() should work when used within another read() fulfill callback');
443 return promise_rejects_exactly(t, error, reader.read());
445 }, label + ': read() should reject with the error');
456 reader.read().then(r => {
459 reader.read().then(r => {
464 }, label + ': calling read() twice without waiting will eventually give both chunks (sequential)');
470 return reader.read().then(r => {
473 return reader.read().then(r2 => {
478 }, label + ': calling read() twice without waiting will eventually give both chunks (nested)');
483 assert_not_equals(reader.read(), reader.read(), 'the promises returned should be distinct');
485 }, label + ': read() should return distinct promises each time');
495 const promise2 = reader.read().then(r => {
502 const promise3 = reader.read().then(r => {
509 }, label + ': cancel() after a read() should still give that single read result');
520 reader.read().then(r => {
523 reader.read().then(r => {
526 reader.read().then(r => {
531 }, label + ': third read(), without waiting, should give { value: undefined, done: true } (sequential)');
537 return reader.read().then(r => {
540 return reader.read().then(r2 => {
543 return reader.read().then(r3 => {
549 }, label + ': third read(), without waiting, should give { value: undefined, done: true } (nested)');
564 reader.read();
565 reader.read();
570 ': draining the stream via read() should cause the reader closed promise to fulfill, but locked stays true');
584 reader.read();
585 reader.read();
598 promise_rejects_js(t, TypeError, reader.read()),
599 promise_rejects_js(t, TypeError, reader.read()),
600 promise_rejects_js(t, TypeError, reader.read())
603 }, label + ': releasing the lock should cause further read() calls to reject with a TypeError');
615 const promise = reader.read().then(() => {
616 assert_equals(reader.closed, readerClosed, 'reader.closed is the same after read() fulfills');
623 return newReader.read();
626 assert_equals(reader.closed, readerClosed, 'reader.closed is the same after calling read()');