1
0
Fork 0
firefox/testing/web-platform/tests/fetch/content-encoding/zstd/bad-zstd-body.https.any.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

22 lines
613 B
JavaScript

// META: global=window,worker
promise_test((test) => {
return fetch("resources/bad-zstd-body.py").then(res => {
assert_equals(res.status, 200);
});
}, "Fetching a resource with bad zstd content should still resolve");
[
"arrayBuffer",
"blob",
"formData",
"json",
"text"
].forEach(method => {
promise_test(t => {
return fetch("resources/bad-zstd-body.py").then(res => {
assert_equals(res.status, 200);
return promise_rejects_js(t, TypeError, res[method]());
});
}, "Consuming the body of a resource with bad zstd content with " + method + "() should reject");
});