Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /fetch/content-encoding/gzip/gzip-body.any.html - WPT Dashboard Interop Dashboard
- /fetch/content-encoding/gzip/gzip-body.any.serviceworker.html - WPT Dashboard Interop Dashboard
- /fetch/content-encoding/gzip/gzip-body.any.sharedworker.html - WPT Dashboard Interop Dashboard
- /fetch/content-encoding/gzip/gzip-body.any.worker.html - WPT Dashboard Interop Dashboard
// META: global=window,worker
const expectedDecompressedSize = 10500;
[
"text",
"octetstream"
].forEach(contentType => {
promise_test(async t => {
let response = await fetch(`resources/foo.${contentType}.gz`);
assert_true(response.ok);
let arrayBuffer = await response.arrayBuffer()
let u8 = new Uint8Array(arrayBuffer);
assert_equals(u8.length, expectedDecompressedSize);
}, `fetched gzip data with content type ${contentType} should be decompressed.`);
});