summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/content-encoding/gzip/bad-gzip-body.any.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/fetch/content-encoding/gzip/bad-gzip-body.any.js')
-rw-r--r--testing/web-platform/tests/fetch/content-encoding/gzip/bad-gzip-body.any.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fetch/content-encoding/gzip/bad-gzip-body.any.js b/testing/web-platform/tests/fetch/content-encoding/gzip/bad-gzip-body.any.js
new file mode 100644
index 0000000000..17bc1261a3
--- /dev/null
+++ b/testing/web-platform/tests/fetch/content-encoding/gzip/bad-gzip-body.any.js
@@ -0,0 +1,22 @@
+// META: global=window,worker
+
+promise_test((test) => {
+ return fetch("resources/bad-gzip-body.py").then(res => {
+ assert_equals(res.status, 200);
+ });
+}, "Fetching a resource with bad gzip content should still resolve");
+
+[
+ "arrayBuffer",
+ "blob",
+ "formData",
+ "json",
+ "text"
+].forEach(method => {
+ promise_test(t => {
+ return fetch("resources/bad-gzip-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 gzip content with " + method + "() should reject");
+});