Lines Matching refs:read
245 const read = reader.read();
247 await promise_rejects_js(t, TypeError, read, 'pending read must reject');
248 }, 'ReadableStream with byte source: releaseLock() on ReadableStreamDefaultReader must reject pending read()');
256 const read = reader.read(new Uint8Array(1));
258 await promise_rejects_js(t, TypeError, read, 'pending read must reject');
259 }, 'ReadableStream with byte source: releaseLock() on ReadableStreamBYOBReader must reject pending read()');
295 reader.read();
302 }, 'ReadableStream with byte source: Automatic pull() after start() and read()');
349 const p0 = reader.read();
350 const p1 = reader.read();
369 assert_not_equals(value, undefined, 'first read should have a value');
388 assert_not_equals(value, undefined, 'second read should have a value');
433 return reader.read().then(result => {
435 assert_not_equals(value, undefined, 'first read should have a value');
452 return byobReader.read(new Uint8Array(32));
455 assert_not_equals(value, undefined, 'second read should have a value');
487 reader.read(new Uint8Array(8));
494 }, 'ReadableStream with byte source: Automatic pull() after start() and read(view)');
527 const promise = reader.read();
528 assert_equals(pullCount, 1, 'The first pull() should be made on read()');
541 }, 'ReadableStream with byte source: enqueue(), getReader(), then read()');
555 const promise = reader.read().then(result => {
587 return reader.read().then(result => {
596 }, 'ReadableStream with byte source: enqueue() with Uint16Array, getReader(), then read()');
612 return byobReader.read(new Uint8Array(8)).then(result => {
626 return reader.read();
637 }, 'ReadableStream with byte source: enqueue(), read(view) partially, then read()');
655 return reader.read().then(result => {
662 return reader.read();
667 }, 'ReadableStream with byte source: getReader(), enqueue(), close(), then read()');
681 return reader.read().then(result => {
688 return reader.read();
693 }, 'ReadableStream with byte source: enqueue(), close(), getReader(), then read()');
712 return reader.read().then(result => {
747 const p0 = reader.read();
748 const p1 = reader.read();
749 const p2 = reader.read();
757 assert_equals(pullCount, 1, 'pullCount after completion of all read()s');
799 const p0 = reader.read();
800 const p1 = reader.read();
801 const p2 = reader.read();
806 assert_equals(pullCount, 4, 'pullCount after completion of all read()s');
851 return reader.read(new Uint8Array(1)).then(result => {
860 }, 'ReadableStream with byte source: read(view), then respond()');
891 return reader.read(new Uint8Array(1)).then(result => {
900 }, 'ReadableStream with byte source: read(view), then respondWithNewView() with a transferred ArrayBuffer');
927 return reader.read(new Uint8Array(1)).then(() => {
932 }, 'ReadableStream with byte source: read(view), then respond() with too big value');
963 return reader.read(new Uint16Array(2)).then(result => {
975 return reader.read(new Uint8Array(1));
992 }, 'ReadableStream with byte source: respond(3) to read(view) with 2 element Uint16Array enqueues the 1 byte ' +
1008 return reader.read(new Uint8Array(16)).then(result => {
1016 }, 'ReadableStream with byte source: enqueue(), getReader(), then read(view)');
1105 const readPromise = reader.read(new Uint8Array(1)).then(result => {
1117 }, 'ReadableStream with byte source: getReader(), read(view), then cancel()');
1143 assert_equals(pullCount, 0, 'No pull() as no read(view) yet');
1147 const promise = reader.read(new Uint16Array(1)).then(result => {
1186 return reader.read(new Uint8Array(buffer, 8, 8)).then(result => {
1198 }, 'ReadableStream with byte source: enqueue(), getReader(), then read(view) where view.buffer is not fully ' +
1227 return reader.read(new Uint8Array(24)).then(result => {
1238 }, 'ReadableStream with byte source: Multiple enqueue(), getReader(), then read(view)');
1257 return reader.read(new Uint8Array(24)).then(result => {
1267 }, 'ReadableStream with byte source: enqueue(), getReader(), then read(view) with a bigger view');
1287 return reader.read(new Uint8Array(8)).then(result => {
1295 return reader.read(new Uint8Array(8));
1306 }, 'ReadableStream with byte source: enqueue(), getReader(), then read(view) with smaller views');
1336 return reader.read(new Uint16Array(1)).then(result => {
1351 }, 'ReadableStream with byte source: enqueue() 1 byte, getReader(), then read(view) with Uint16Array');
1391 const promise = reader.read(new Uint16Array(2)).then(result => {
1403 const p = reader.read(new Uint16Array(1));
1431 }, 'ReadableStream with byte source: enqueue() 3 byte, getReader(), then read(view) with 2-element Uint16Array');
1448 return promise_rejects_js(t, TypeError, reader.read(new Uint16Array(1)), 'read(view) must fail')
1450 }, 'ReadableStream with byte source: read(view) with Uint16Array on close()-d stream with 1 byte enqueue()-d must ' +
1470 const readPromise = reader.read(new Uint16Array(1));
1474 return promise_rejects_js(t, TypeError, readPromise, 'read(view) must fail')
1476 }, 'ReadableStream with byte source: A stream must be errored if close()-d before fulfilling read(view) with ' +
1540 return reader.read(new Uint8Array(16)).then(result => {
1548 return reader.read(new Uint8Array(16));
1562 }, 'ReadableStream with byte source: read(view), then respond() and close() in pull()');
1596 return reader.read(new Uint32Array(1)).then(result => {
1616 }, 'ReadableStream with byte source: read(view) with Uint32Array, then fill it by multiple respond() calls');
1649 return reader.read(new Uint32Array(1)).then(result => {
1669 }, 'ReadableStream with byte source: read(view) with Uint32Array, then fill it by multiple enqueue() calls');
1691 const p0 = reader.read().then(result => {
1710 const p1 = reader.read().then(result => {
1731 }, 'ReadableStream with byte source: read() twice, then enqueue() twice');
1746 const p0 = reader.read(new Uint8Array(16)).then(result => {
1747 assert_true(result.done, '1st read: done');
1750 assert_equals(view.buffer.byteLength, 16, '1st read: buffer.byteLength');
1751 assert_equals(view.byteOffset, 0, '1st read: byteOffset');
1752 assert_equals(view.byteLength, 0, '1st read: byteLength');
1755 const p1 = reader.read(new Uint8Array(32)).then(result => {
1756 assert_true(result.done, '2nd read: done');
1759 assert_equals(view.buffer.byteLength, 32, '2nd read: buffer.byteLength');
1760 assert_equals(view.byteOffset, 0, '2nd read: byteOffset');
1761 assert_equals(view.byteLength, 0, '2nd read: byteLength');
1768 }, 'ReadableStream with byte source: Multiple read(view), close() and respond()');
1783 const p0 = reader.read(new Uint8Array(16)).then(result => {
1784 assert_false(result.done, '1st read: done');
1787 assert_equals(view.buffer.byteLength, 16, '1st read: buffer.byteLength');
1788 assert_equals(view.byteOffset, 0, '1st read: byteOffset');
1789 assert_equals(view.byteLength, 16, '1st read: byteLength');
1792 const p1 = reader.read(new Uint8Array(16)).then(result => {
1793 assert_false(result.done, '2nd read: done');
1796 assert_equals(view.buffer.byteLength, 16, '2nd read: buffer.byteLength');
1797 assert_equals(view.byteOffset, 0, '2nd read: byteOffset');
1798 assert_equals(view.byteLength, 8, '2nd read: byteLength');
1804 }, 'ReadableStream with byte source: Multiple read(view), big enqueue()');
1822 return reader.read(new Uint8Array(7)).then(result => {
1840 }, 'ReadableStream with byte source: Multiple read(view) and multiple enqueue()');
1853 return promise_rejects_js(t, TypeError, reader.read(), 'read() must fail')
1855 }, 'ReadableStream with byte source: read(view) with passing undefined as view must fail');
1864 return promise_rejects_js(t, TypeError, reader.read({}), 'read(view) must fail');
1865 }, 'ReadableStream with byte source: read(view) with passing an empty object as view must fail');
1875 reader.read({ buffer: new ArrayBuffer(10), byteOffset: 0, byteLength: 10 }),
1876 'read(view) must fail');
1877 }, 'ReadableStream with byte source: Even read(view) with passing ArrayBufferView like object as view must fail');
1890 return promise_rejects_exactly(t, error1, reader.read(), 'read() must fail');
1891 }, 'ReadableStream with byte source: read() on an errored stream');
1905 const promise = promise_rejects_exactly(t, error1, reader.read(), 'read() must fail');
1910 }, 'ReadableStream with byte source: read(), then error()');
1923 return promise_rejects_exactly(t, error1, reader.read(new Uint8Array(1)), 'read() must fail');
1924 }, 'ReadableStream with byte source: read(view) on an errored stream');
1938 const promise = promise_rejects_exactly(t, error1, reader.read(new Uint8Array(1)), 'read() must fail');
1943 }, 'ReadableStream with byte source: read(view), then error()');
1964 const promise = promise_rejects_exactly(t, testError, reader.read(), 'read() must fail');
1983 return promise_rejects_exactly(t, error1, reader.read(), 'read() must fail')
1986 }, 'ReadableStream with byte source: Throwing in pull in response to read() must be ignored if the stream is ' +
2004 return promise_rejects_exactly(t, testError, reader.read(new Uint8Array(1)), 'read(view) must fail')
2007 }, 'ReadableStream with byte source: Throwing in pull in response to read(view) function must error the stream');
2023 return promise_rejects_exactly(t, error1, reader.read(new Uint8Array(1)), 'read(view) must fail')
2026 }, 'ReadableStream with byte source: Throwing in pull in response to read(view) must be ignored if the stream is ' +
2040 return reader.read(view).then(() => {
2056 return reader.read(newView()).then(() => {
2084 const readPromise = reader.read(new Uint8Array(16));
2117 const readPromise = reader.read(new Uint8Array(16));
2142 const read = reader.read(new Uint8Array(16));
2147 await promise_rejects_js(t, TypeError, read, 'pending read should reject');
2148 }, 'pull() resolving should not resolve read()');
2162 const readPromise = rs.getReader().read();
2236 const result = await reader.read(new Uint8Array([4, 5, 6]));
2260 const result = await reader.read(new Uint8Array([4, 5, 6]));
2287 const readPromise = reader.read(new Uint8Array([4, 5, 6]));
2327 const readPromise = reader.read(new Uint8Array([4, 5, 6]));
2367 const read1 = reader1.read();
2385 // read(view) should work after discarding the auto-allocated BYOB request
2387 const read2 = reader2.read(new Uint8Array([4, 5, 6]));
2419 const read1 = reader1.read(new Uint8Array([1, 2, 3]));
2424 // releaseLock() should reject the pending read, but *not* invalidate the BYOB request
2427 const read2 = reader2.read(new Uint8Array([4, 5, 6]));
2431 await promise_rejects_js(t, TypeError, read1, 'pending read must reject after releaseLock()');
2433 // respond() should fulfill the *second* read() request
2443 }, 'ReadableStream with byte source: releaseLock() with pending read(view), read(view) on second reader, respond()');
2456 const read1 = reader1.read(new Uint8Array([1, 2, 3]));
2461 // releaseLock() should reject the pending read, but *not* invalidate the BYOB request
2464 const read2 = reader2.read(new Uint16Array(1));
2468 await promise_rejects_js(t, TypeError, read1, 'pending read must reject after releaseLock()');
2470 // respond(1) should partially fill the second read(), but not yet fulfill it
2474 // second BYOB request should use remaining buffer from the second read()
2479 // second respond(1) should fill the read request and fulfill it
2490 }, 'ReadableStream with byte source: releaseLock() with pending read(view), read(view) on second reader with ' +
2504 const read1 = reader1.read(new Uint8Array([1, 2, 3]));
2509 // releaseLock() should reject the pending read, but *not* invalidate the BYOB request
2512 const read2 = reader2.read(new Uint8Array([4, 5]));
2516 await promise_rejects_js(t, TypeError, read1, 'pending read must reject after releaseLock()');
2518 // respond(3) should fulfill the second read(), and put 1 remaining byte in the queue
2530 // third read() should fulfill with the remaining byte
2531 const result3 = await reader2.read(new Uint8Array([0, 0, 0]));
2535 }, 'ReadableStream with byte source: releaseLock() with pending read(view), read(view) on second reader with ' +
2549 const read1 = reader1.read(new Uint8Array([1, 2, 3]));
2554 // releaseLock() should reject the pending read, but *not* invalidate the BYOB request
2557 const read2 = reader2.read(new Uint8Array([4, 5, 6]));
2559 await promise_rejects_js(t, TypeError, read1, 'pending read must reject after releaseLock()');
2561 // respondWithNewView() should fulfill the *second* read() request
2572 }, 'ReadableStream with byte source: releaseLock() with pending read(view), read(view) on second reader, respondWithNewView()');
2585 const read1 = reader1.read(new Uint8Array([1, 2, 3]));
2590 // releaseLock() should reject the pending read, but *not* invalidate the BYOB request
2593 const read2 = reader2.read(new Uint8Array([4, 5, 6]));
2595 await promise_rejects_js(t, TypeError, read1, 'pending read must reject after releaseLock()');
2597 // enqueue() should fulfill the *second* read() request
2606 }, 'ReadableStream with byte source: releaseLock() with pending read(view), read(view) on second reader, enqueue()');
2619 const read1 = reader1.read(new Uint8Array([1, 2, 3]));
2624 // releaseLock() should reject the pending read, but *not* invalidate the BYOB request
2627 const read2 = reader2.read(new Uint8Array([4, 5, 6]));
2629 await promise_rejects_js(t, TypeError, read1, 'pending read must reject after releaseLock()');
2631 // close() followed by respond(0) should fulfill the second read()
2640 }, 'ReadableStream with byte source: releaseLock() with pending read(view), read(view) on second reader, ' +
2655 const read1 = reader1.read();
2660 // releaseLock() should reject the pending read, but *not* invalidate the BYOB request
2663 const read2 = reader2.read();
2665 await promise_rejects_js(t, TypeError, read1, 'pending read must reject after releaseLock()');
2667 // respond() should fulfill the *second* read() request
2677 }, 'ReadableStream with byte source: autoAllocateChunkSize, releaseLock() with pending read(), read() on second reader, respond()');
2691 const read1 = reader1.read();
2696 // releaseLock() should reject the pending read, but *not* invalidate the BYOB request
2699 const read2 = reader2.read();
2701 await promise_rejects_js(t, TypeError, read1, 'pending read must reject after releaseLock()');
2703 // enqueue() should fulfill the *second* read() request
2712 }, 'ReadableStream with byte source: autoAllocateChunkSize, releaseLock() with pending read(), read() on second reader, enqueue()');
2726 const read1 = reader1.read();
2731 // releaseLock() should reject the pending read, but *not* invalidate the BYOB request
2734 const read2 = reader2.read(new Uint8Array([4, 5, 6]));
2736 await promise_rejects_js(t, TypeError, read1, 'pending read must reject after releaseLock()');
2738 // respond() should fulfill the *second* read() request
2748 }, 'ReadableStream with byte source: autoAllocateChunkSize, releaseLock() with pending read(), read(view) on second reader, respond()');
2762 const read1 = reader1.read();
2767 // releaseLock() should reject the pending read, but *not* invalidate the BYOB request
2770 const read2 = reader2.read(new Uint8Array([4, 5, 6]));
2772 await promise_rejects_js(t, TypeError, read1, 'pending read must reject after releaseLock()');
2774 // enqueue() should fulfill the *second* read() request
2783 }, 'ReadableStream with byte source: autoAllocateChunkSize, releaseLock() with pending read(), read(view) on second reader, enqueue()');
2796 const read1 = reader1.read(new Uint16Array(1));
2801 // respond(1) should partially fill the first read(), but not yet fulfill it
2808 // releaseLock() should reject the pending read, but *not* invalidate the BYOB request
2811 const read2 = reader2.read(new Uint16Array(1));
2815 await promise_rejects_js(t, TypeError, read1, 'pending read must reject after releaseLock()');
2817 // second respond(1) should fill the read request and fulfill it
2830 }, 'ReadableStream with byte source: read(view) with 1 element Uint16Array, respond(1), releaseLock(), read(view) on ' +
2844 const read1 = reader1.read(new Uint16Array(1));
2849 // respond(1) should partially fill the first read(), but not yet fulfill it
2856 // releaseLock() should reject the pending read, but *not* invalidate the BYOB request
2859 const read2 = reader2.read();
2863 await promise_rejects_js(t, TypeError, read1, 'pending read must reject after releaseLock()');
2865 // enqueue() should fulfill the read request and put remaining byte in the queue
2873 const result3 = await reader2.read();
2877 }, 'ReadableStream with byte source: read(view) with 1 element Uint16Array, respond(1), releaseLock(), read() on ' +
2893 const result = await reader.read();
2901 }, 'ReadableStream with byte source: autoAllocateChunkSize, read(), respondWithNewView()');