summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/http-cache/304-update.any.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/fetch/http-cache/304-update.any.js
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/fetch/http-cache/304-update.any.js')
-rw-r--r--testing/web-platform/tests/fetch/http-cache/304-update.any.js146
1 files changed, 146 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fetch/http-cache/304-update.any.js b/testing/web-platform/tests/fetch/http-cache/304-update.any.js
new file mode 100644
index 0000000000..15484f01eb
--- /dev/null
+++ b/testing/web-platform/tests/fetch/http-cache/304-update.any.js
@@ -0,0 +1,146 @@
+// META: global=window,worker
+// META: title=HTTP Cache - 304 Updates
+// 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 updates returned headers from a Last-Modified 304",
+ requests: [
+ {
+ response_headers: [
+ ["Expires", -5000],
+ ["Last-Modified", -3000],
+ ["Test-Header", "A"]
+ ]
+ },
+ {
+ response_headers: [
+ ["Expires", -3000],
+ ["Last-Modified", -3000],
+ ["Test-Header", "B"]
+ ],
+ expected_type: "lm_validated",
+ expected_response_headers: [
+ ["Test-Header", "B"]
+ ]
+ }
+ ]
+ },
+ {
+ name: "HTTP cache updates stored headers from a Last-Modified 304",
+ requests: [
+ {
+ response_headers: [
+ ["Expires", -5000],
+ ["Last-Modified", -3000],
+ ["Test-Header", "A"]
+ ]
+ },
+ {
+ response_headers: [
+ ["Expires", 3000],
+ ["Last-Modified", -3000],
+ ["Test-Header", "B"]
+ ],
+ expected_type: "lm_validated",
+ expected_response_headers: [
+ ["Test-Header", "B"]
+ ],
+ pause_after: true
+ },
+ {
+ expected_type: "cached",
+ expected_response_headers: [
+ ["Test-Header", "B"]
+ ]
+ }
+ ]
+ },
+ {
+ name: "HTTP cache updates returned headers from a ETag 304",
+ requests: [
+ {
+ response_headers: [
+ ["Expires", -5000],
+ ["ETag", "ABC"],
+ ["Test-Header", "A"]
+ ]
+ },
+ {
+ response_headers: [
+ ["Expires", -3000],
+ ["ETag", "ABC"],
+ ["Test-Header", "B"]
+ ],
+ expected_type: "etag_validated",
+ expected_response_headers: [
+ ["Test-Header", "B"]
+ ]
+ }
+ ]
+ },
+ {
+ name: "HTTP cache updates stored headers from a ETag 304",
+ requests: [
+ {
+ response_headers: [
+ ["Expires", -5000],
+ ["ETag", "DEF"],
+ ["Test-Header", "A"]
+ ]
+ },
+ {
+ response_headers: [
+ ["Expires", 3000],
+ ["ETag", "DEF"],
+ ["Test-Header", "B"]
+ ],
+ expected_type: "etag_validated",
+ expected_response_headers: [
+ ["Test-Header", "B"]
+ ],
+ pause_after: true
+ },
+ {
+ expected_type: "cached",
+ expected_response_headers: [
+ ["Test-Header", "B"]
+ ]
+ }
+ ]
+ },
+ {
+ name: "Content-* header",
+ requests: [
+ {
+ response_headers: [
+ ["Expires", -5000],
+ ["ETag", "GHI"],
+ ["Content-Test-Header", "A"]
+ ]
+ },
+ {
+ response_headers: [
+ ["Expires", 3000],
+ ["ETag", "GHI"],
+ ["Content-Test-Header", "B"]
+ ],
+ expected_type: "etag_validated",
+ expected_response_headers: [
+ ["Content-Test-Header", "B"]
+ ],
+ pause_after: true
+ },
+ {
+ expected_type: "cached",
+ expected_response_headers: [
+ ["Content-Test-Header", "B"]
+ ]
+ }
+ ]
+ },
+];
+run_tests(tests);