bad-gzip-body.any.js (624B)
1 // META: global=window,worker 2 3 promise_test((test) => { 4 return fetch("resources/bad-gzip-body.py").then(res => { 5 assert_equals(res.status, 200); 6 }); 7 }, "Fetching a resource with bad gzip content should still resolve"); 8 9 [ 10 "arrayBuffer", 11 "blob", 12 "bytes", 13 "formData", 14 "json", 15 "text" 16 ].forEach(method => { 17 promise_test(t => { 18 return fetch("resources/bad-gzip-body.py").then(res => { 19 assert_equals(res.status, 200); 20 return promise_rejects_js(t, TypeError, res[method]()); 21 }); 22 }, "Consuming the body of a resource with bad gzip content with " + method + "() should reject"); 23 });