Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /streams/readable-byte-streams/templated.any.html - WPT Dashboard Interop Dashboard
- /streams/readable-byte-streams/templated.any.serviceworker.html - WPT Dashboard Interop Dashboard
- /streams/readable-byte-streams/templated.any.shadowrealm-in-dedicatedworker.html - WPT Dashboard Interop Dashboard
- /streams/readable-byte-streams/templated.any.shadowrealm-in-shadowrealm.html - WPT Dashboard Interop Dashboard
- /streams/readable-byte-streams/templated.any.shadowrealm-in-sharedworker.html - WPT Dashboard Interop Dashboard
- /streams/readable-byte-streams/templated.any.shadowrealm-in-window.html - WPT Dashboard Interop Dashboard
- /streams/readable-byte-streams/templated.any.sharedworker.html - WPT Dashboard Interop Dashboard
- /streams/readable-byte-streams/templated.any.worker.html - WPT Dashboard Interop Dashboard
- /streams/readable-byte-streams/templated.https.any.shadowrealm-in-audioworklet.html - WPT Dashboard Interop Dashboard
- /streams/readable-byte-streams/templated.https.any.shadowrealm-in-serviceworker.html - WPT Dashboard Interop Dashboard
// META: global=window,worker,shadowrealm
// META: script=../resources/test-utils.js
// META: script=../resources/rs-test-templates.js
'use strict';
templatedRSEmpty('ReadableStream with byte source (empty)', () => {
return new ReadableStream({ type: 'bytes' });
});
templatedRSEmptyReader('ReadableStream with byte source (empty) default reader', () => {
const stream = new ReadableStream({ type: 'bytes' });
const reader = stream.getReader();
return { stream, reader, read: () => reader.read() };
});
templatedRSEmptyReader('ReadableStream with byte source (empty) BYOB reader', () => {
const stream = new ReadableStream({ type: 'bytes' });
const reader = stream.getReader({ mode: 'byob' });
return { stream, reader, read: () => reader.read(new Uint8Array([0])) };
});
templatedRSThrowAfterCloseOrError('ReadableStream with byte source', (extras) => {
return new ReadableStream({ type: 'bytes', ...extras });
});