Automatic update from web-platform-tests Remove ShadowRealm test coverage This intentionally does not make infrastructure or documentation changes, but without implementer support all the ShadowRealm tests add significant noise. Once there is implementer support this can be reverted. -- wpt-commits: e4a4672e9e607fc2b28e7173b83ce4e38ef53071 wpt-pr: 59794
25 lines
858 B
JavaScript
25 lines
858 B
JavaScript
// META: global=window,worker
|
|
|
|
'use strict';
|
|
|
|
const emptyValues = [
|
|
["gzip", new Uint8Array([31, 139, 8, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0])],
|
|
["deflate", new Uint8Array([120, 156, 3, 0, 0, 0, 0, 1])],
|
|
["deflate-raw", new Uint8Array([1, 0, 0, 255, 255])],
|
|
["brotli", new Uint8Array([0xa1, 0x01])],
|
|
];
|
|
|
|
for (const [format, emptyValue] of emptyValues) {
|
|
promise_test(async t => {
|
|
const ds = new DecompressionStream(format);
|
|
const reader = ds.readable.getReader();
|
|
const writer = ds.writable.getWriter();
|
|
const writePromise = writer.write(emptyValue);
|
|
writer.close();
|
|
const { value, done } = await reader.read();
|
|
assert_true(done, "read() should set done");
|
|
assert_equals(value, undefined, "value should be undefined");
|
|
await writePromise;
|
|
}, `decompressing ${format} empty input should work`);
|
|
}
|