summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/content-encoding/zstd/bad-zstd-body.https.any.js
blob: 3f32e4dfba786511d845c3e913e59b818d0f292b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 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");
});