summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/http-cache/post-patch.any.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/fetch/http-cache/post-patch.any.js')
-rw-r--r--testing/web-platform/tests/fetch/http-cache/post-patch.any.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fetch/http-cache/post-patch.any.js b/testing/web-platform/tests/fetch/http-cache/post-patch.any.js
new file mode 100644
index 0000000000..0a69baa5c6
--- /dev/null
+++ b/testing/web-platform/tests/fetch/http-cache/post-patch.any.js
@@ -0,0 +1,46 @@
+// META: global=window,worker
+// META: title=HTTP Cache - Caching POST and PATCH responses
+// META: timeout=long
+// META: script=/common/utils.js
+// META: script=/common/get-host-info.sub.js
+// META: script=http-cache.js
+
+var tests = [
+ {
+ name: "HTTP cache uses content after PATCH request with response containing Content-Location and cache-allowing header",
+ requests: [
+ {
+ request_method: "PATCH",
+ request_body: "abc",
+ response_status: [200, "OK"],
+ response_headers: [
+ ['Cache-Control', "private, max-age=1000"],
+ ['Content-Location', ""]
+ ],
+ response_body: "abc"
+ },
+ {
+ expected_type: "cached"
+ }
+ ]
+ },
+ {
+ name: "HTTP cache uses content after POST request with response containing Content-Location and cache-allowing header",
+ requests: [
+ {
+ request_method: "POST",
+ request_body: "abc",
+ response_status: [200, "OK"],
+ response_headers: [
+ ['Cache-Control', "private, max-age=1000"],
+ ['Content-Location', ""]
+ ],
+ response_body: "abc"
+ },
+ {
+ expected_type: "cached"
+ }
+ ]
+ }
+];
+run_tests(tests);