From 3a8e85e3a786da81f4eeb3c95aadcef84e84679e Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 27 Nov 2019 18:55:58 -0500 Subject: [PATCH 001/127] PARTIAL [fetch] Prototype tool for test generation --- ...mic-import-cross-domain.tentative.sub.html | 32 +++ ...amic-import-same-domain.tentative.sub.html | 32 +++ ...via-script-cross-domain.tentative.sub.html | 27 ++ ...-via-script-same-domain.tentative.sub.html | 27 ++ ...tic-import-cross-domain.tentative.sub.html | 36 +++ ...atic-import-same-domain.tentative.sub.html | 36 +++ ...poster-cross-site.tentative.https.sub.html | 34 +++ ...oster-same-origin.tentative.https.sub.html | 34 +++ ...-poster-same-site.tentative.https.sub.html | 34 +++ ...ster-unstrustworthy-url.tentative.sub.html | 34 +++ fetch/metadata/resources/helper.js | 19 ++ fetch/metadata/resources/record-header.py | 3 + fetch/metadata/tools/generate.py | 256 ++++++++++++++++++ 13 files changed, 604 insertions(+) create mode 100644 fetch/metadata/generated/js-module-via-dynamic-import-cross-domain.tentative.sub.html create mode 100644 fetch/metadata/generated/js-module-via-dynamic-import-same-domain.tentative.sub.html create mode 100644 fetch/metadata/generated/js-module-via-script-cross-domain.tentative.sub.html create mode 100644 fetch/metadata/generated/js-module-via-script-same-domain.tentative.sub.html create mode 100644 fetch/metadata/generated/js-module-via-static-import-cross-domain.tentative.sub.html create mode 100644 fetch/metadata/generated/js-module-via-static-import-same-domain.tentative.sub.html create mode 100644 fetch/metadata/generated/video-poster-cross-site.tentative.https.sub.html create mode 100644 fetch/metadata/generated/video-poster-same-origin.tentative.https.sub.html create mode 100644 fetch/metadata/generated/video-poster-same-site.tentative.https.sub.html create mode 100644 fetch/metadata/generated/video-poster-unstrustworthy-url.tentative.sub.html create mode 100755 fetch/metadata/tools/generate.py diff --git a/fetch/metadata/generated/js-module-via-dynamic-import-cross-domain.tentative.sub.html b/fetch/metadata/generated/js-module-via-dynamic-import-cross-domain.tentative.sub.html new file mode 100644 index 00000000000000..be0891ed6fefe7 --- /dev/null +++ b/fetch/metadata/generated/js-module-via-dynamic-import-cross-domain.tentative.sub.html @@ -0,0 +1,32 @@ + + + + + + + + + + + diff --git a/fetch/metadata/generated/js-module-via-dynamic-import-same-domain.tentative.sub.html b/fetch/metadata/generated/js-module-via-dynamic-import-same-domain.tentative.sub.html new file mode 100644 index 00000000000000..c4f886c2dfdce9 --- /dev/null +++ b/fetch/metadata/generated/js-module-via-dynamic-import-same-domain.tentative.sub.html @@ -0,0 +1,32 @@ + + + + + + + + + + + diff --git a/fetch/metadata/generated/js-module-via-script-cross-domain.tentative.sub.html b/fetch/metadata/generated/js-module-via-script-cross-domain.tentative.sub.html new file mode 100644 index 00000000000000..d6ebd59cc957fc --- /dev/null +++ b/fetch/metadata/generated/js-module-via-script-cross-domain.tentative.sub.html @@ -0,0 +1,27 @@ + + + + + + + + + + + diff --git a/fetch/metadata/generated/js-module-via-script-same-domain.tentative.sub.html b/fetch/metadata/generated/js-module-via-script-same-domain.tentative.sub.html new file mode 100644 index 00000000000000..39c62fe3a964cc --- /dev/null +++ b/fetch/metadata/generated/js-module-via-script-same-domain.tentative.sub.html @@ -0,0 +1,27 @@ + + + + + + + + + + + diff --git a/fetch/metadata/generated/js-module-via-static-import-cross-domain.tentative.sub.html b/fetch/metadata/generated/js-module-via-static-import-cross-domain.tentative.sub.html new file mode 100644 index 00000000000000..7564c183031e94 --- /dev/null +++ b/fetch/metadata/generated/js-module-via-static-import-cross-domain.tentative.sub.html @@ -0,0 +1,36 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/generated/js-module-via-static-import-same-domain.tentative.sub.html b/fetch/metadata/generated/js-module-via-static-import-same-domain.tentative.sub.html new file mode 100644 index 00000000000000..10a34b357eeebc --- /dev/null +++ b/fetch/metadata/generated/js-module-via-static-import-same-domain.tentative.sub.html @@ -0,0 +1,36 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/generated/video-poster-cross-site.tentative.https.sub.html b/fetch/metadata/generated/video-poster-cross-site.tentative.https.sub.html new file mode 100644 index 00000000000000..36dd2c9c734f06 --- /dev/null +++ b/fetch/metadata/generated/video-poster-cross-site.tentative.https.sub.html @@ -0,0 +1,34 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-same-origin.tentative.https.sub.html b/fetch/metadata/generated/video-poster-same-origin.tentative.https.sub.html new file mode 100644 index 00000000000000..c85ca9d903751e --- /dev/null +++ b/fetch/metadata/generated/video-poster-same-origin.tentative.https.sub.html @@ -0,0 +1,34 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-same-site.tentative.https.sub.html b/fetch/metadata/generated/video-poster-same-site.tentative.https.sub.html new file mode 100644 index 00000000000000..8c04be62dc2f33 --- /dev/null +++ b/fetch/metadata/generated/video-poster-same-site.tentative.https.sub.html @@ -0,0 +1,34 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-unstrustworthy-url.tentative.sub.html b/fetch/metadata/generated/video-poster-unstrustworthy-url.tentative.sub.html new file mode 100644 index 00000000000000..8f0ab58235ece3 --- /dev/null +++ b/fetch/metadata/generated/video-poster-unstrustworthy-url.tentative.sub.html @@ -0,0 +1,34 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/resources/helper.js b/fetch/metadata/resources/helper.js index a344c94106a11c..0cb9e2b25b438b 100644 --- a/fetch/metadata/resources/helper.js +++ b/fetch/metadata/resources/helper.js @@ -61,3 +61,22 @@ function assert_no_headers(value, tag) { test(t => assert_equals(value.user, ""), `${tag}: sec-fetch-user`); test(t => assert_equals(value.dest, ""), `${tag}: sec-fetch-dest`); } + +function pollForRequestRecording(id) { + return fetch('/fetch/metadata/resources/record-header.py?retrieve&file=' + id) + .then(function(response) { + if (!response.ok) { + throw new Error('Failed to query for recorded headers.'); + } + + return response.text(); + }) + .then(function(text) { + if (text === "No header has been recorded") { + return new Promise((resolve) => setTimeout(resolve, 300)) + .then(() => pollForRequestRecording(id)); + } + + return JSON.parse(text); + }); +} diff --git a/fetch/metadata/resources/record-header.py b/fetch/metadata/resources/record-header.py index 99115475683d50..3f57f6ea01d4dc 100644 --- a/fetch/metadata/resources/record-header.py +++ b/fetch/metadata/resources/record-header.py @@ -129,3 +129,6 @@ def main(request, response): """ + if key.startswith("script"): + response.headers.set("Content-Type", "application/javascript") + return "void 0;" diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py new file mode 100755 index 00000000000000..3335e4e167f9d8 --- /dev/null +++ b/fetch/metadata/tools/generate.py @@ -0,0 +1,256 @@ +#!/usr/bin/env python3 + +import os +import yaml + +HERE = os.path.abspath(os.path.dirname(__file__)) +OUT_DIR = os.path.join(HERE, '..', 'generated') + +templates = { + 'video-poster': ''' + + + + + + + + + +''', + 'js-module-via-script': ''' + + + + + + + + + + +''', + 'js-module-via-static-import': ''' + + + + + + + + + + + +''', + 'js-module-via-dynamic-import': ''' + + + + + + + + + + +''' +} + +cases = { + 'video-poster': ''' +cross-site.tentative.https: + title: something across domains + domain: https://{{hosts[alt][]}}:{{ports[https][0]}} + validation: | + var expected = { + dest: 'image', + mode: 'no-cors', + site: 'cross-site', + user: '' + }; + assert_header_equals(actual, expected); + +same-origin.tentative.https: + title: something across domains + domain: '' + validation: | + var expected = { + dest: 'image', + mode: 'no-cors', + site: 'same-origin', + user: '' + }; + assert_header_equals(actual, expected); + +same-site.tentative.https: + title: something across domains + domain: https://{{domains[www2]}}:{{ports[https][0]}} + validation: | + var expected = { + dest: 'image', + mode: 'no-cors', + site: 'same-site', + user: '' + }; + assert_header_equals(actual, expected); + +unstrustworthy-url.tentative: + title: poster image fetched via an untrustworthy URL + domain: '' + validation: | + var expected = { + dest: '', + mode: '', + site: '', + user: '' + }; + assert_header_equals(actual, expected); +''', + 'js-module-via-script': ''' +same-domain.tentative: + title: something + domain: '' + validation: | + var expected = { + dest: 'script', + mode: '', + site: '', + user: '' + }; + assert_header_equals(actual, expected); + +cross-domain.tentative: + title: something across domains + domain: http://{{domains[www2]}}:{{ports[http][0]}} + validation: | + var expected = { + dest: 'script', + mode: '', + site: '', + user: '' + }; + assert_header_equals(actual, expected); +''', + 'js-module-via-static-import': ''' +same-domain.tentative: + title: something + domain: '' + validation: | + var expected = { + dest: 'script', + mode: '', + site: '', + user: '' + }; + assert_header_equals(actual, expected); + +cross-domain.tentative: + title: something across domains + domain: http://{{domains[www2]}}:{{ports[http][0]}} + validation: | + var expected = { + dest: 'script', + mode: '', + site: '', + user: '' + }; + assert_header_equals(actual, expected); +''', + 'js-module-via-dynamic-import': ''' +same-domain.tentative: + title: something + domain: '' + validation: | + var expected = { + dest: 'script', + mode: '', + site: '', + user: '' + }; + assert_header_equals(actual, expected); + +cross-domain.tentative: + title: something across domains + domain: http://{{domains[www2]}}:{{ports[http][0]}} + validation: | + var expected = { + dest: 'script', + mode: '', + site: '', + user: '' + }; + assert_header_equals(actual, expected); +''' +} + +def main(): + for template_name, template in templates.items(): + c = yaml.safe_load(cases[template_name]) + + for name, values in c.items(): + output_file = os.path.join( + OUT_DIR, template_name + '-' + name + '.sub.html' + ) + + with open(output_file, 'w') as handle: + handle.write(template % values) + +if __name__ == '__main__': + main() From 00180cb1ea1f29d84f45bcc8d3df0282f2f37022 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 29 Nov 2019 18:13:30 -0500 Subject: [PATCH 002/127] Increase veracity --- ...ive.js-module-via-dynamic-import.sub.html} | 2 +- ...n.tentative.js-module-via-script.sub.html} | 2 +- ...tive.js-module-via-static-import.sub.html} | 2 +- ...ite.tentative.https.video-poster.sub.html} | 2 +- ...ive.js-module-via-dynamic-import.sub.html} | 2 +- ...n.tentative.js-module-via-script.sub.html} | 2 +- ...tive.js-module-via-static-import.sub.html} | 2 +- ...gin.tentative.https.video-poster.sub.html} | 2 +- ...ite.tentative.https.video-poster.sub.html} | 2 +- ...orthy-url.tentative.video-poster.sub.html} | 2 +- .../js-module-via-dynamic-import.sub.html.yml | 24 ++ .../cases/js-module-via-script.sub.html.yml | 24 ++ .../js-module-via-static-import.sub.html.yml | 24 ++ .../tools/cases/video-poster.sub.html.yml | 48 ++++ fetch/metadata/tools/generate.py | 265 ++---------------- .../js-module-via-dynamic-import.sub.html | 25 ++ .../templates/js-module-via-script.sub.html | 20 ++ .../js-module-via-static-import.sub.html | 29 ++ .../tools/templates/video-poster.sub.html | 27 ++ 19 files changed, 254 insertions(+), 252 deletions(-) rename fetch/metadata/generated/{js-module-via-dynamic-import-cross-domain.tentative.sub.html => cross-domain.tentative.js-module-via-dynamic-import.sub.html} (98%) rename fetch/metadata/generated/{js-module-via-script-cross-domain.tentative.sub.html => cross-domain.tentative.js-module-via-script.sub.html} (97%) rename fetch/metadata/generated/{js-module-via-static-import-cross-domain.tentative.sub.html => cross-domain.tentative.js-module-via-static-import.sub.html} (98%) rename fetch/metadata/generated/{video-poster-cross-site.tentative.https.sub.html => cross-site.tentative.https.video-poster.sub.html} (99%) rename fetch/metadata/generated/{js-module-via-dynamic-import-same-domain.tentative.sub.html => same-domain.tentative.js-module-via-dynamic-import.sub.html} (98%) rename fetch/metadata/generated/{js-module-via-script-same-domain.tentative.sub.html => same-domain.tentative.js-module-via-script.sub.html} (97%) rename fetch/metadata/generated/{js-module-via-static-import-same-domain.tentative.sub.html => same-domain.tentative.js-module-via-static-import.sub.html} (98%) rename fetch/metadata/generated/{video-poster-same-origin.tentative.https.sub.html => same-origin.tentative.https.video-poster.sub.html} (99%) rename fetch/metadata/generated/{video-poster-same-site.tentative.https.sub.html => same-site.tentative.https.video-poster.sub.html} (99%) rename fetch/metadata/generated/{video-poster-unstrustworthy-url.tentative.sub.html => unstrustworthy-url.tentative.video-poster.sub.html} (99%) create mode 100644 fetch/metadata/tools/cases/js-module-via-dynamic-import.sub.html.yml create mode 100644 fetch/metadata/tools/cases/js-module-via-script.sub.html.yml create mode 100644 fetch/metadata/tools/cases/js-module-via-static-import.sub.html.yml create mode 100644 fetch/metadata/tools/cases/video-poster.sub.html.yml create mode 100644 fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html create mode 100644 fetch/metadata/tools/templates/js-module-via-script.sub.html create mode 100644 fetch/metadata/tools/templates/js-module-via-static-import.sub.html create mode 100644 fetch/metadata/tools/templates/video-poster.sub.html diff --git a/fetch/metadata/generated/js-module-via-dynamic-import-cross-domain.tentative.sub.html b/fetch/metadata/generated/cross-domain.tentative.js-module-via-dynamic-import.sub.html similarity index 98% rename from fetch/metadata/generated/js-module-via-dynamic-import-cross-domain.tentative.sub.html rename to fetch/metadata/generated/cross-domain.tentative.js-module-via-dynamic-import.sub.html index be0891ed6fefe7..cb14134af5c06c 100644 --- a/fetch/metadata/generated/js-module-via-dynamic-import-cross-domain.tentative.sub.html +++ b/fetch/metadata/generated/cross-domain.tentative.js-module-via-dynamic-import.sub.html @@ -1,4 +1,4 @@ - + diff --git a/fetch/metadata/generated/js-module-via-script-cross-domain.tentative.sub.html b/fetch/metadata/generated/cross-domain.tentative.js-module-via-script.sub.html similarity index 97% rename from fetch/metadata/generated/js-module-via-script-cross-domain.tentative.sub.html rename to fetch/metadata/generated/cross-domain.tentative.js-module-via-script.sub.html index d6ebd59cc957fc..6fe1ed1e07a4e8 100644 --- a/fetch/metadata/generated/js-module-via-script-cross-domain.tentative.sub.html +++ b/fetch/metadata/generated/cross-domain.tentative.js-module-via-script.sub.html @@ -1,4 +1,4 @@ - + diff --git a/fetch/metadata/generated/js-module-via-static-import-cross-domain.tentative.sub.html b/fetch/metadata/generated/cross-domain.tentative.js-module-via-static-import.sub.html similarity index 98% rename from fetch/metadata/generated/js-module-via-static-import-cross-domain.tentative.sub.html rename to fetch/metadata/generated/cross-domain.tentative.js-module-via-static-import.sub.html index 7564c183031e94..33a5e733da70bb 100644 --- a/fetch/metadata/generated/js-module-via-static-import-cross-domain.tentative.sub.html +++ b/fetch/metadata/generated/cross-domain.tentative.js-module-via-static-import.sub.html @@ -1,4 +1,4 @@ - + diff --git a/fetch/metadata/generated/video-poster-cross-site.tentative.https.sub.html b/fetch/metadata/generated/cross-site.tentative.https.video-poster.sub.html similarity index 99% rename from fetch/metadata/generated/video-poster-cross-site.tentative.https.sub.html rename to fetch/metadata/generated/cross-site.tentative.https.video-poster.sub.html index 36dd2c9c734f06..a69d0fa048fb58 100644 --- a/fetch/metadata/generated/video-poster-cross-site.tentative.https.sub.html +++ b/fetch/metadata/generated/cross-site.tentative.https.video-poster.sub.html @@ -31,4 +31,4 @@ }, 'something across domains'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/js-module-via-dynamic-import-same-domain.tentative.sub.html b/fetch/metadata/generated/same-domain.tentative.js-module-via-dynamic-import.sub.html similarity index 98% rename from fetch/metadata/generated/js-module-via-dynamic-import-same-domain.tentative.sub.html rename to fetch/metadata/generated/same-domain.tentative.js-module-via-dynamic-import.sub.html index c4f886c2dfdce9..2ea5086759e09b 100644 --- a/fetch/metadata/generated/js-module-via-dynamic-import-same-domain.tentative.sub.html +++ b/fetch/metadata/generated/same-domain.tentative.js-module-via-dynamic-import.sub.html @@ -1,4 +1,4 @@ - + diff --git a/fetch/metadata/generated/js-module-via-script-same-domain.tentative.sub.html b/fetch/metadata/generated/same-domain.tentative.js-module-via-script.sub.html similarity index 97% rename from fetch/metadata/generated/js-module-via-script-same-domain.tentative.sub.html rename to fetch/metadata/generated/same-domain.tentative.js-module-via-script.sub.html index 39c62fe3a964cc..eaf14ea2226e06 100644 --- a/fetch/metadata/generated/js-module-via-script-same-domain.tentative.sub.html +++ b/fetch/metadata/generated/same-domain.tentative.js-module-via-script.sub.html @@ -1,4 +1,4 @@ - + diff --git a/fetch/metadata/generated/js-module-via-static-import-same-domain.tentative.sub.html b/fetch/metadata/generated/same-domain.tentative.js-module-via-static-import.sub.html similarity index 98% rename from fetch/metadata/generated/js-module-via-static-import-same-domain.tentative.sub.html rename to fetch/metadata/generated/same-domain.tentative.js-module-via-static-import.sub.html index 10a34b357eeebc..38840fa4f38902 100644 --- a/fetch/metadata/generated/js-module-via-static-import-same-domain.tentative.sub.html +++ b/fetch/metadata/generated/same-domain.tentative.js-module-via-static-import.sub.html @@ -1,4 +1,4 @@ - + diff --git a/fetch/metadata/generated/video-poster-same-origin.tentative.https.sub.html b/fetch/metadata/generated/same-origin.tentative.https.video-poster.sub.html similarity index 99% rename from fetch/metadata/generated/video-poster-same-origin.tentative.https.sub.html rename to fetch/metadata/generated/same-origin.tentative.https.video-poster.sub.html index c85ca9d903751e..5a35d076fe08fd 100644 --- a/fetch/metadata/generated/video-poster-same-origin.tentative.https.sub.html +++ b/fetch/metadata/generated/same-origin.tentative.https.video-poster.sub.html @@ -31,4 +31,4 @@ }, 'something across domains'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/video-poster-same-site.tentative.https.sub.html b/fetch/metadata/generated/same-site.tentative.https.video-poster.sub.html similarity index 99% rename from fetch/metadata/generated/video-poster-same-site.tentative.https.sub.html rename to fetch/metadata/generated/same-site.tentative.https.video-poster.sub.html index 8c04be62dc2f33..037e255c71e600 100644 --- a/fetch/metadata/generated/video-poster-same-site.tentative.https.sub.html +++ b/fetch/metadata/generated/same-site.tentative.https.video-poster.sub.html @@ -31,4 +31,4 @@ }, 'something across domains'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/video-poster-unstrustworthy-url.tentative.sub.html b/fetch/metadata/generated/unstrustworthy-url.tentative.video-poster.sub.html similarity index 99% rename from fetch/metadata/generated/video-poster-unstrustworthy-url.tentative.sub.html rename to fetch/metadata/generated/unstrustworthy-url.tentative.video-poster.sub.html index 8f0ab58235ece3..9082adfffa3dd6 100644 --- a/fetch/metadata/generated/video-poster-unstrustworthy-url.tentative.sub.html +++ b/fetch/metadata/generated/unstrustworthy-url.tentative.video-poster.sub.html @@ -31,4 +31,4 @@ }, 'poster image fetched via an untrustworthy URL'); - \ No newline at end of file + diff --git a/fetch/metadata/tools/cases/js-module-via-dynamic-import.sub.html.yml b/fetch/metadata/tools/cases/js-module-via-dynamic-import.sub.html.yml new file mode 100644 index 00000000000000..43be05c3e0790d --- /dev/null +++ b/fetch/metadata/tools/cases/js-module-via-dynamic-import.sub.html.yml @@ -0,0 +1,24 @@ +--- +same-domain.tentative: + title: something + domain: '' + validation: | + var expected = { + dest: 'script', + mode: '', + site: '', + user: '' + }; + assert_header_equals(actual, expected); + +cross-domain.tentative: + title: something across domains + domain: http://{{domains[www2]}}:{{ports[http][0]}} + validation: | + var expected = { + dest: 'script', + mode: '', + site: '', + user: '' + }; + assert_header_equals(actual, expected); diff --git a/fetch/metadata/tools/cases/js-module-via-script.sub.html.yml b/fetch/metadata/tools/cases/js-module-via-script.sub.html.yml new file mode 100644 index 00000000000000..43be05c3e0790d --- /dev/null +++ b/fetch/metadata/tools/cases/js-module-via-script.sub.html.yml @@ -0,0 +1,24 @@ +--- +same-domain.tentative: + title: something + domain: '' + validation: | + var expected = { + dest: 'script', + mode: '', + site: '', + user: '' + }; + assert_header_equals(actual, expected); + +cross-domain.tentative: + title: something across domains + domain: http://{{domains[www2]}}:{{ports[http][0]}} + validation: | + var expected = { + dest: 'script', + mode: '', + site: '', + user: '' + }; + assert_header_equals(actual, expected); diff --git a/fetch/metadata/tools/cases/js-module-via-static-import.sub.html.yml b/fetch/metadata/tools/cases/js-module-via-static-import.sub.html.yml new file mode 100644 index 00000000000000..43be05c3e0790d --- /dev/null +++ b/fetch/metadata/tools/cases/js-module-via-static-import.sub.html.yml @@ -0,0 +1,24 @@ +--- +same-domain.tentative: + title: something + domain: '' + validation: | + var expected = { + dest: 'script', + mode: '', + site: '', + user: '' + }; + assert_header_equals(actual, expected); + +cross-domain.tentative: + title: something across domains + domain: http://{{domains[www2]}}:{{ports[http][0]}} + validation: | + var expected = { + dest: 'script', + mode: '', + site: '', + user: '' + }; + assert_header_equals(actual, expected); diff --git a/fetch/metadata/tools/cases/video-poster.sub.html.yml b/fetch/metadata/tools/cases/video-poster.sub.html.yml new file mode 100644 index 00000000000000..13540181d46e78 --- /dev/null +++ b/fetch/metadata/tools/cases/video-poster.sub.html.yml @@ -0,0 +1,48 @@ +--- +cross-site.tentative.https: + title: something across domains + domain: https://{{hosts[alt][]}}:{{ports[https][0]}} + validation: | + var expected = { + dest: 'image', + mode: 'no-cors', + site: 'cross-site', + user: '' + }; + assert_header_equals(actual, expected); + +same-origin.tentative.https: + title: something across domains + domain: '' + validation: | + var expected = { + dest: 'image', + mode: 'no-cors', + site: 'same-origin', + user: '' + }; + assert_header_equals(actual, expected); + +same-site.tentative.https: + title: something across domains + domain: https://{{domains[www2]}}:{{ports[https][0]}} + validation: | + var expected = { + dest: 'image', + mode: 'no-cors', + site: 'same-site', + user: '' + }; + assert_header_equals(actual, expected); + +unstrustworthy-url.tentative: + title: poster image fetched via an untrustworthy URL + domain: '' + validation: | + var expected = { + dest: '', + mode: '', + site: '', + user: '' + }; + assert_header_equals(actual, expected); diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index 3335e4e167f9d8..343f597dc39f16 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -4,253 +4,34 @@ import yaml HERE = os.path.abspath(os.path.dirname(__file__)) -OUT_DIR = os.path.join(HERE, '..', 'generated') +OUT_DIR = os.path.normpath(os.path.join(HERE, '..', 'generated')) +TEMPLATES_DIR = os.path.join(HERE, 'templates') +CASES_DIR = os.path.join(HERE, 'cases') -templates = { - 'video-poster': ''' - - - - - - - - - -''', - 'js-module-via-script': ''' - - - - - - - - - - -''', - 'js-module-via-static-import': ''' - - - - - - - - - - - -''', - 'js-module-via-dynamic-import': ''' - - - - - - - - - - -''' -} +def main(templates_directory, cases_directory, out_directory): + for name, path in find_templates(templates_directory): + with open(path, 'r') as handle: + template = handle.read() -cases = { - 'video-poster': ''' -cross-site.tentative.https: - title: something across domains - domain: https://{{hosts[alt][]}}:{{ports[https][0]}} - validation: | - var expected = { - dest: 'image', - mode: 'no-cors', - site: 'cross-site', - user: '' - }; - assert_header_equals(actual, expected); + case_path = path.replace(templates_directory, cases_directory) + '.yml' -same-origin.tentative.https: - title: something across domains - domain: '' - validation: | - var expected = { - dest: 'image', - mode: 'no-cors', - site: 'same-origin', - user: '' - }; - assert_header_equals(actual, expected); + with open(case_path, 'r') as handle: + cases = yaml.safe_load(handle.read()) -same-site.tentative.https: - title: something across domains - domain: https://{{domains[www2]}}:{{ports[https][0]}} - validation: | - var expected = { - dest: 'image', - mode: 'no-cors', - site: 'same-site', - user: '' - }; - assert_header_equals(actual, expected); + for case in cases: + out_file_name = os.path.join( + out_directory, '{}.{}'.format(case, name) + ) -unstrustworthy-url.tentative: - title: poster image fetched via an untrustworthy URL - domain: '' - validation: | - var expected = { - dest: '', - mode: '', - site: '', - user: '' - }; - assert_header_equals(actual, expected); -''', - 'js-module-via-script': ''' -same-domain.tentative: - title: something - domain: '' - validation: | - var expected = { - dest: 'script', - mode: '', - site: '', - user: '' - }; - assert_header_equals(actual, expected); - -cross-domain.tentative: - title: something across domains - domain: http://{{domains[www2]}}:{{ports[http][0]}} - validation: | - var expected = { - dest: 'script', - mode: '', - site: '', - user: '' - }; - assert_header_equals(actual, expected); -''', - 'js-module-via-static-import': ''' -same-domain.tentative: - title: something - domain: '' - validation: | - var expected = { - dest: 'script', - mode: '', - site: '', - user: '' - }; - assert_header_equals(actual, expected); - -cross-domain.tentative: - title: something across domains - domain: http://{{domains[www2]}}:{{ports[http][0]}} - validation: | - var expected = { - dest: 'script', - mode: '', - site: '', - user: '' - }; - assert_header_equals(actual, expected); -''', - 'js-module-via-dynamic-import': ''' -same-domain.tentative: - title: something - domain: '' - validation: | - var expected = { - dest: 'script', - mode: '', - site: '', - user: '' - }; - assert_header_equals(actual, expected); - -cross-domain.tentative: - title: something across domains - domain: http://{{domains[www2]}}:{{ports[http][0]}} - validation: | - var expected = { - dest: 'script', - mode: '', - site: '', - user: '' - }; - assert_header_equals(actual, expected); -''' -} - -def main(): - for template_name, template in templates.items(): - c = yaml.safe_load(cases[template_name]) - - for name, values in c.items(): - output_file = os.path.join( - OUT_DIR, template_name + '-' + name + '.sub.html' - ) - - with open(output_file, 'w') as handle: - handle.write(template % values) + with open(out_file_name, 'w') as handle: + handle.write(template % cases[case]) if __name__ == '__main__': - main() + main(TEMPLATES_DIR, CASES_DIR, OUT_DIR) diff --git a/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html b/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html new file mode 100644 index 00000000000000..8e105c017da850 --- /dev/null +++ b/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html @@ -0,0 +1,25 @@ + + + + + + + + + + + diff --git a/fetch/metadata/tools/templates/js-module-via-script.sub.html b/fetch/metadata/tools/templates/js-module-via-script.sub.html new file mode 100644 index 00000000000000..294f144fee3670 --- /dev/null +++ b/fetch/metadata/tools/templates/js-module-via-script.sub.html @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/fetch/metadata/tools/templates/js-module-via-static-import.sub.html b/fetch/metadata/tools/templates/js-module-via-static-import.sub.html new file mode 100644 index 00000000000000..eda649a7d4c43b --- /dev/null +++ b/fetch/metadata/tools/templates/js-module-via-static-import.sub.html @@ -0,0 +1,29 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/tools/templates/video-poster.sub.html b/fetch/metadata/tools/templates/video-poster.sub.html new file mode 100644 index 00000000000000..7357a917a31852 --- /dev/null +++ b/fetch/metadata/tools/templates/video-poster.sub.html @@ -0,0 +1,27 @@ + + + + + + + + + + + From cc555e47520dc7cb53efef1e80e2f65b546e4a2f Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 29 Nov 2019 21:55:50 -0500 Subject: [PATCH 003/127] Replace some test with generated equivalents --- ...-cross-site.tentative.https.image.sub.html | 36 +++++++++ ...same-origin.tentative.https.image.sub.html | 36 +++++++++ ...e-same-site.tentative.https.image.sub.html | 36 +++++++++ ...-cross-site.tentative.https.image.sub.html | 36 +++++++++ ...oss-site-redirect.tentative.https.sub.html | 77 ------------------- ...direct-cross-site.tentative.https.sub.html | 36 --------- fetch/metadata/tools/cases/image.sub.html.yml | 52 +++++++++++++ fetch/metadata/tools/templates/image.sub.html | 29 +++++++ 8 files changed, 225 insertions(+), 113 deletions(-) create mode 100644 fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html create mode 100644 fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html create mode 100644 fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html create mode 100644 fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html delete mode 100644 fetch/metadata/redirect/cross-site-redirect.tentative.https.sub.html delete mode 100644 fetch/metadata/redirect/multiple-redirect-cross-site.tentative.https.sub.html create mode 100644 fetch/metadata/tools/cases/image.sub.html.yml create mode 100644 fetch/metadata/tools/templates/image.sub.html diff --git a/fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html new file mode 100644 index 00000000000000..01f03595eeb17d --- /dev/null +++ b/fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html @@ -0,0 +1,36 @@ + + + + + + + + + + + diff --git a/fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html new file mode 100644 index 00000000000000..38e290806c9595 --- /dev/null +++ b/fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html @@ -0,0 +1,36 @@ + + + + + + + + + + + diff --git a/fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html new file mode 100644 index 00000000000000..2100bf46ee2e43 --- /dev/null +++ b/fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html @@ -0,0 +1,36 @@ + + + + + + + + + + + diff --git a/fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html new file mode 100644 index 00000000000000..710b0043073dd0 --- /dev/null +++ b/fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html @@ -0,0 +1,36 @@ + + + + + + + + + + + diff --git a/fetch/metadata/redirect/cross-site-redirect.tentative.https.sub.html b/fetch/metadata/redirect/cross-site-redirect.tentative.https.sub.html deleted file mode 100644 index 827eb982e47f3f..00000000000000 --- a/fetch/metadata/redirect/cross-site-redirect.tentative.https.sub.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - diff --git a/fetch/metadata/redirect/multiple-redirect-cross-site.tentative.https.sub.html b/fetch/metadata/redirect/multiple-redirect-cross-site.tentative.https.sub.html deleted file mode 100644 index fc986aaf4fdcff..00000000000000 --- a/fetch/metadata/redirect/multiple-redirect-cross-site.tentative.https.sub.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - diff --git a/fetch/metadata/tools/cases/image.sub.html.yml b/fetch/metadata/tools/cases/image.sub.html.yml new file mode 100644 index 00000000000000..07067ec4903de6 --- /dev/null +++ b/fetch/metadata/tools/cases/image.sub.html.yml @@ -0,0 +1,52 @@ +--- +redirect-cross-site-same-origin.tentative.https: + domain: https://{{hosts[alt][www]}}:{{ports[https][0]}}/xhr/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}} + title: Cross-Site -> Same-Origin redirect + validation: | + let expected = { + site: "cross-site", + user: "", + mode: "no-cors", + dest: "image" + }; + assert_header_equals(actual, expected, "Cross-Site -> Same-Origin redirect"); + +redirect-cross-site-same-site.tentative.https: + domain: https://{{hosts[alt][www]}}:{{ports[https][0]}}/xhr/resources/redirect.py?location=https://{{hosts[][www]}}:{{ports[https][0]}} + title: Cross-Site -> Same-Site redirect + validation: | + let expected = { + site: "cross-site", + user: "", + mode: "no-cors", + dest: "image" + }; + assert_header_equals(actual, expected, "Cross-Site -> Same-Site redirect"); + +redirect-cross-site-cross-site.tentative.https: + domain: https://{{hosts[alt][www]}}:{{ports[https][0]}}/xhr/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}} + title: Cross-Site -> Cross-Site redirect + validation: | + let expected = { + site: "cross-site", + user: "", + mode: "no-cors", + dest: "image" + }; + assert_header_equals(actual, expected, "Cross-Site -> Cross-Site redirect"); + +redirect-multiple-cross-site.tentative.https: + # same-origin -> cross-site -> same-origin + domain: "\ + https://{{host}}:{{ports[https][0]}}/xhr/resources/redirect.py?location=\ + https://{{hosts[alt][www]}}:{{ports[https][0]}}/xhr/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + title: Same-Origin -> Cross-Site -> Same-Origin redirect + validation: | + let expected = { + site: "cross-site", + user: "", + mode: "no-cors", + dest: "image" + }; + assert_header_equals(actual, expected, "Same-Origin -> Cross-Site -> Same-Origin redirect"); diff --git a/fetch/metadata/tools/templates/image.sub.html b/fetch/metadata/tools/templates/image.sub.html new file mode 100644 index 00000000000000..362a28a8ecd505 --- /dev/null +++ b/fetch/metadata/tools/templates/image.sub.html @@ -0,0 +1,29 @@ + + + + + + + + + + + From 936571ebf38d5a1fd361e22c047303f593f8089f Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 4 Dec 2019 12:47:47 -0500 Subject: [PATCH 004/127] Correct metadata --- ...cross-domain.tentative.js-module-via-dynamic-import.sub.html | 2 +- .../cross-domain.tentative.js-module-via-script.sub.html | 2 +- .../cross-domain.tentative.js-module-via-static-import.sub.html | 2 +- .../generated/cross-site.tentative.https.video-poster.sub.html | 2 +- ...edirect-cross-site-cross-site.tentative.https.image.sub.html | 2 +- ...direct-cross-site-same-origin.tentative.https.image.sub.html | 2 +- ...redirect-cross-site-same-site.tentative.https.image.sub.html | 2 +- .../redirect-multiple-cross-site.tentative.https.image.sub.html | 2 +- .../same-domain.tentative.js-module-via-dynamic-import.sub.html | 2 +- .../same-domain.tentative.js-module-via-script.sub.html | 2 +- .../same-domain.tentative.js-module-via-static-import.sub.html | 2 +- .../generated/same-origin.tentative.https.video-poster.sub.html | 2 +- .../generated/same-site.tentative.https.video-poster.sub.html | 2 +- .../unstrustworthy-url.tentative.video-poster.sub.html | 2 +- fetch/metadata/tools/templates/image.sub.html | 2 +- .../tools/templates/js-module-via-dynamic-import.sub.html | 2 +- fetch/metadata/tools/templates/js-module-via-script.sub.html | 2 +- .../tools/templates/js-module-via-static-import.sub.html | 2 +- fetch/metadata/tools/templates/video-poster.sub.html | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/fetch/metadata/generated/cross-domain.tentative.js-module-via-dynamic-import.sub.html b/fetch/metadata/generated/cross-domain.tentative.js-module-via-dynamic-import.sub.html index cb14134af5c06c..86b72d833759c1 100644 --- a/fetch/metadata/generated/cross-domain.tentative.js-module-via-dynamic-import.sub.html +++ b/fetch/metadata/generated/cross-domain.tentative.js-module-via-dynamic-import.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/generated/cross-domain.tentative.js-module-via-script.sub.html b/fetch/metadata/generated/cross-domain.tentative.js-module-via-script.sub.html index 6fe1ed1e07a4e8..b6c56e0f21e6c5 100644 --- a/fetch/metadata/generated/cross-domain.tentative.js-module-via-script.sub.html +++ b/fetch/metadata/generated/cross-domain.tentative.js-module-via-script.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/generated/cross-domain.tentative.js-module-via-static-import.sub.html b/fetch/metadata/generated/cross-domain.tentative.js-module-via-static-import.sub.html index 33a5e733da70bb..96ae9be2fd28cc 100644 --- a/fetch/metadata/generated/cross-domain.tentative.js-module-via-static-import.sub.html +++ b/fetch/metadata/generated/cross-domain.tentative.js-module-via-static-import.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/generated/cross-site.tentative.https.video-poster.sub.html b/fetch/metadata/generated/cross-site.tentative.https.video-poster.sub.html index a69d0fa048fb58..01d93725ea278a 100644 --- a/fetch/metadata/generated/cross-site.tentative.https.video-poster.sub.html +++ b/fetch/metadata/generated/cross-site.tentative.https.video-poster.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html index 01f03595eeb17d..543100f6ee9e06 100644 --- a/fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html +++ b/fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html index 38e290806c9595..31d98f549eed92 100644 --- a/fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html +++ b/fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html index 2100bf46ee2e43..44eff7c1786e7a 100644 --- a/fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html +++ b/fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html index 710b0043073dd0..eda4838f35ff7c 100644 --- a/fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html +++ b/fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/generated/same-domain.tentative.js-module-via-dynamic-import.sub.html b/fetch/metadata/generated/same-domain.tentative.js-module-via-dynamic-import.sub.html index 2ea5086759e09b..dcb5e95936788a 100644 --- a/fetch/metadata/generated/same-domain.tentative.js-module-via-dynamic-import.sub.html +++ b/fetch/metadata/generated/same-domain.tentative.js-module-via-dynamic-import.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/generated/same-domain.tentative.js-module-via-script.sub.html b/fetch/metadata/generated/same-domain.tentative.js-module-via-script.sub.html index eaf14ea2226e06..e354534133ab00 100644 --- a/fetch/metadata/generated/same-domain.tentative.js-module-via-script.sub.html +++ b/fetch/metadata/generated/same-domain.tentative.js-module-via-script.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/generated/same-domain.tentative.js-module-via-static-import.sub.html b/fetch/metadata/generated/same-domain.tentative.js-module-via-static-import.sub.html index 38840fa4f38902..125b272ce0ef55 100644 --- a/fetch/metadata/generated/same-domain.tentative.js-module-via-static-import.sub.html +++ b/fetch/metadata/generated/same-domain.tentative.js-module-via-static-import.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/generated/same-origin.tentative.https.video-poster.sub.html b/fetch/metadata/generated/same-origin.tentative.https.video-poster.sub.html index 5a35d076fe08fd..2667de1ebe5397 100644 --- a/fetch/metadata/generated/same-origin.tentative.https.video-poster.sub.html +++ b/fetch/metadata/generated/same-origin.tentative.https.video-poster.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/generated/same-site.tentative.https.video-poster.sub.html b/fetch/metadata/generated/same-site.tentative.https.video-poster.sub.html index 037e255c71e600..a8bd60603a5370 100644 --- a/fetch/metadata/generated/same-site.tentative.https.video-poster.sub.html +++ b/fetch/metadata/generated/same-site.tentative.https.video-poster.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/generated/unstrustworthy-url.tentative.video-poster.sub.html b/fetch/metadata/generated/unstrustworthy-url.tentative.video-poster.sub.html index 9082adfffa3dd6..10284961b7f46e 100644 --- a/fetch/metadata/generated/unstrustworthy-url.tentative.video-poster.sub.html +++ b/fetch/metadata/generated/unstrustworthy-url.tentative.video-poster.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/tools/templates/image.sub.html b/fetch/metadata/tools/templates/image.sub.html index 362a28a8ecd505..6a030b99a76700 100644 --- a/fetch/metadata/tools/templates/image.sub.html +++ b/fetch/metadata/tools/templates/image.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html b/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html index 8e105c017da850..f65c93209d9394 100644 --- a/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html +++ b/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/tools/templates/js-module-via-script.sub.html b/fetch/metadata/tools/templates/js-module-via-script.sub.html index 294f144fee3670..21ec058a6cf3bc 100644 --- a/fetch/metadata/tools/templates/js-module-via-script.sub.html +++ b/fetch/metadata/tools/templates/js-module-via-script.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/tools/templates/js-module-via-static-import.sub.html b/fetch/metadata/tools/templates/js-module-via-static-import.sub.html index eda649a7d4c43b..6a7371aba31889 100644 --- a/fetch/metadata/tools/templates/js-module-via-static-import.sub.html +++ b/fetch/metadata/tools/templates/js-module-via-static-import.sub.html @@ -1,7 +1,7 @@ - + diff --git a/fetch/metadata/tools/templates/video-poster.sub.html b/fetch/metadata/tools/templates/video-poster.sub.html index 7357a917a31852..339d6e37e9d41d 100644 --- a/fetch/metadata/tools/templates/video-poster.sub.html +++ b/fetch/metadata/tools/templates/video-poster.sub.html @@ -1,7 +1,7 @@ - + From 5421a2b39f25776af82c2602c4c316bad488be5c Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 4 Dec 2019 14:53:48 -0500 Subject: [PATCH 005/127] Start to almost experiment with iteration --- fetch/metadata/generated/case-name.many.html | 1 + fetch/metadata/tools/cases/many.html.yml | 6 ++++++ fetch/metadata/tools/generate.py | 11 ++++++++--- fetch/metadata/tools/templates/many.html | 19 +++++++++++++++++++ 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 fetch/metadata/generated/case-name.many.html create mode 100644 fetch/metadata/tools/cases/many.html.yml create mode 100644 fetch/metadata/tools/templates/many.html diff --git a/fetch/metadata/generated/case-name.many.html b/fetch/metadata/generated/case-name.many.html new file mode 100644 index 00000000000000..111e7a57a0824e --- /dev/null +++ b/fetch/metadata/generated/case-name.many.html @@ -0,0 +1 @@ +this will be difficult \ No newline at end of file diff --git a/fetch/metadata/tools/cases/many.html.yml b/fetch/metadata/tools/cases/many.html.yml new file mode 100644 index 00000000000000..52f7837717b740 --- /dev/null +++ b/fetch/metadata/tools/cases/many.html.yml @@ -0,0 +1,6 @@ +--- +case-name: + title: Test title! + subtests: + - foo: hello + - foo: goodbye diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index 343f597dc39f16..ab7c77333f8548 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -15,6 +15,11 @@ def find_templates(starting_directory): continue yield file_name, os.path.join(directory, file_name) +def expand(template, case): + if 'subtests' not in case: + return template % case + return 'this will be difficult' + def main(templates_directory, cases_directory, out_directory): for name, path in find_templates(templates_directory): with open(path, 'r') as handle: @@ -25,13 +30,13 @@ def main(templates_directory, cases_directory, out_directory): with open(case_path, 'r') as handle: cases = yaml.safe_load(handle.read()) - for case in cases: + for case_name in cases: out_file_name = os.path.join( - out_directory, '{}.{}'.format(case, name) + out_directory, '{}.{}'.format(case_name, name) ) with open(out_file_name, 'w') as handle: - handle.write(template % cases[case]) + handle.write(expand(template, cases[case_name])) if __name__ == '__main__': main(TEMPLATES_DIR, CASES_DIR, OUT_DIR) diff --git a/fetch/metadata/tools/templates/many.html b/fetch/metadata/tools/templates/many.html new file mode 100644 index 00000000000000..80603bca2f691d --- /dev/null +++ b/fetch/metadata/tools/templates/many.html @@ -0,0 +1,19 @@ + + + + + %(title)s + + + + + + From deeb5cbc6a0e81e9b7b87db671891aa86236c03a Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 5 Dec 2019 15:00:12 -0500 Subject: [PATCH 006/127] Introduce Jinja --- fetch/metadata/generated/case-name.many.html | 24 ++++++++++++++++++- ...tive.js-module-via-dynamic-import.sub.html | 2 +- ...in.tentative.js-module-via-script.sub.html | 2 +- ...ative.js-module-via-static-import.sub.html | 2 +- ...site.tentative.https.video-poster.sub.html | 2 +- ...-cross-site.tentative.https.image.sub.html | 2 +- ...same-origin.tentative.https.image.sub.html | 2 +- ...e-same-site.tentative.https.image.sub.html | 2 +- ...-cross-site.tentative.https.image.sub.html | 2 +- ...tive.js-module-via-dynamic-import.sub.html | 2 +- ...in.tentative.js-module-via-script.sub.html | 2 +- ...ative.js-module-via-static-import.sub.html | 2 +- ...igin.tentative.https.video-poster.sub.html | 2 +- ...site.tentative.https.video-poster.sub.html | 2 +- ...worthy-url.tentative.video-poster.sub.html | 2 +- fetch/metadata/tools/generate.py | 11 ++++----- fetch/metadata/tools/requirements.txt | 3 +++ fetch/metadata/tools/templates/image.sub.html | 6 ++--- .../js-module-via-dynamic-import.sub.html | 6 ++--- .../templates/js-module-via-script.sub.html | 6 ++--- .../js-module-via-static-import.sub.html | 6 ++--- fetch/metadata/tools/templates/many.html | 6 ++--- .../tools/templates/video-poster.sub.html | 6 ++--- 23 files changed, 62 insertions(+), 40 deletions(-) create mode 100644 fetch/metadata/tools/requirements.txt diff --git a/fetch/metadata/generated/case-name.many.html b/fetch/metadata/generated/case-name.many.html index 111e7a57a0824e..779c323d4e35fe 100644 --- a/fetch/metadata/generated/case-name.many.html +++ b/fetch/metadata/generated/case-name.many.html @@ -1 +1,23 @@ -this will be difficult \ No newline at end of file + + + + + %(title)s + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/cross-domain.tentative.js-module-via-dynamic-import.sub.html b/fetch/metadata/generated/cross-domain.tentative.js-module-via-dynamic-import.sub.html index 86b72d833759c1..0f23a5e3df316a 100644 --- a/fetch/metadata/generated/cross-domain.tentative.js-module-via-dynamic-import.sub.html +++ b/fetch/metadata/generated/cross-domain.tentative.js-module-via-dynamic-import.sub.html @@ -29,4 +29,4 @@ }, 'something across domains'); - + \ No newline at end of file diff --git a/fetch/metadata/generated/cross-domain.tentative.js-module-via-script.sub.html b/fetch/metadata/generated/cross-domain.tentative.js-module-via-script.sub.html index b6c56e0f21e6c5..2048b3741f07cf 100644 --- a/fetch/metadata/generated/cross-domain.tentative.js-module-via-script.sub.html +++ b/fetch/metadata/generated/cross-domain.tentative.js-module-via-script.sub.html @@ -24,4 +24,4 @@ }); }, 'something across domains'); - + \ No newline at end of file diff --git a/fetch/metadata/generated/cross-domain.tentative.js-module-via-static-import.sub.html b/fetch/metadata/generated/cross-domain.tentative.js-module-via-static-import.sub.html index 96ae9be2fd28cc..ec6c096a93535b 100644 --- a/fetch/metadata/generated/cross-domain.tentative.js-module-via-static-import.sub.html +++ b/fetch/metadata/generated/cross-domain.tentative.js-module-via-static-import.sub.html @@ -33,4 +33,4 @@ }); }, 'something across domains'); - + \ No newline at end of file diff --git a/fetch/metadata/generated/cross-site.tentative.https.video-poster.sub.html b/fetch/metadata/generated/cross-site.tentative.https.video-poster.sub.html index 01d93725ea278a..9f7019d8c062d4 100644 --- a/fetch/metadata/generated/cross-site.tentative.https.video-poster.sub.html +++ b/fetch/metadata/generated/cross-site.tentative.https.video-poster.sub.html @@ -31,4 +31,4 @@ }, 'something across domains'); - + \ No newline at end of file diff --git a/fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html index 543100f6ee9e06..f853d33edda8fb 100644 --- a/fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html +++ b/fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html @@ -33,4 +33,4 @@ }, 'Cross-Site -> Cross-Site redirect'); - + \ No newline at end of file diff --git a/fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html index 31d98f549eed92..e29b6a54e3916d 100644 --- a/fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html +++ b/fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html @@ -33,4 +33,4 @@ }, 'Cross-Site -> Same-Origin redirect'); - + \ No newline at end of file diff --git a/fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html index 44eff7c1786e7a..5ca8d9318faad3 100644 --- a/fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html +++ b/fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html @@ -33,4 +33,4 @@ }, 'Cross-Site -> Same-Site redirect'); - + \ No newline at end of file diff --git a/fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html index eda4838f35ff7c..e11629439de2f9 100644 --- a/fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html +++ b/fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html @@ -33,4 +33,4 @@ }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); - + \ No newline at end of file diff --git a/fetch/metadata/generated/same-domain.tentative.js-module-via-dynamic-import.sub.html b/fetch/metadata/generated/same-domain.tentative.js-module-via-dynamic-import.sub.html index dcb5e95936788a..61061e539bae7f 100644 --- a/fetch/metadata/generated/same-domain.tentative.js-module-via-dynamic-import.sub.html +++ b/fetch/metadata/generated/same-domain.tentative.js-module-via-dynamic-import.sub.html @@ -29,4 +29,4 @@ }, 'something'); - + \ No newline at end of file diff --git a/fetch/metadata/generated/same-domain.tentative.js-module-via-script.sub.html b/fetch/metadata/generated/same-domain.tentative.js-module-via-script.sub.html index e354534133ab00..cd72af33bfbab3 100644 --- a/fetch/metadata/generated/same-domain.tentative.js-module-via-script.sub.html +++ b/fetch/metadata/generated/same-domain.tentative.js-module-via-script.sub.html @@ -24,4 +24,4 @@ }); }, 'something'); - + \ No newline at end of file diff --git a/fetch/metadata/generated/same-domain.tentative.js-module-via-static-import.sub.html b/fetch/metadata/generated/same-domain.tentative.js-module-via-static-import.sub.html index 125b272ce0ef55..99846868117ef9 100644 --- a/fetch/metadata/generated/same-domain.tentative.js-module-via-static-import.sub.html +++ b/fetch/metadata/generated/same-domain.tentative.js-module-via-static-import.sub.html @@ -33,4 +33,4 @@ }); }, 'something'); - + \ No newline at end of file diff --git a/fetch/metadata/generated/same-origin.tentative.https.video-poster.sub.html b/fetch/metadata/generated/same-origin.tentative.https.video-poster.sub.html index 2667de1ebe5397..4d9e2a6ceb0d9d 100644 --- a/fetch/metadata/generated/same-origin.tentative.https.video-poster.sub.html +++ b/fetch/metadata/generated/same-origin.tentative.https.video-poster.sub.html @@ -31,4 +31,4 @@ }, 'something across domains'); - + \ No newline at end of file diff --git a/fetch/metadata/generated/same-site.tentative.https.video-poster.sub.html b/fetch/metadata/generated/same-site.tentative.https.video-poster.sub.html index a8bd60603a5370..21b6828d9d5c01 100644 --- a/fetch/metadata/generated/same-site.tentative.https.video-poster.sub.html +++ b/fetch/metadata/generated/same-site.tentative.https.video-poster.sub.html @@ -31,4 +31,4 @@ }, 'something across domains'); - + \ No newline at end of file diff --git a/fetch/metadata/generated/unstrustworthy-url.tentative.video-poster.sub.html b/fetch/metadata/generated/unstrustworthy-url.tentative.video-poster.sub.html index 10284961b7f46e..52a1c1329a5117 100644 --- a/fetch/metadata/generated/unstrustworthy-url.tentative.video-poster.sub.html +++ b/fetch/metadata/generated/unstrustworthy-url.tentative.video-poster.sub.html @@ -31,4 +31,4 @@ }, 'poster image fetched via an untrustworthy URL'); - + \ No newline at end of file diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index ab7c77333f8548..253b01030903c0 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 import os + +from jinja2 import Template import yaml HERE = os.path.abspath(os.path.dirname(__file__)) @@ -15,15 +17,10 @@ def find_templates(starting_directory): continue yield file_name, os.path.join(directory, file_name) -def expand(template, case): - if 'subtests' not in case: - return template % case - return 'this will be difficult' - def main(templates_directory, cases_directory, out_directory): for name, path in find_templates(templates_directory): with open(path, 'r') as handle: - template = handle.read() + template = Template(handle.read(), variable_start_string='[%', variable_end_string='%]') case_path = path.replace(templates_directory, cases_directory) + '.yml' @@ -36,7 +33,7 @@ def main(templates_directory, cases_directory, out_directory): ) with open(out_file_name, 'w') as handle: - handle.write(expand(template, cases[case_name])) + handle.write(template.render(**cases[case_name])) if __name__ == '__main__': main(TEMPLATES_DIR, CASES_DIR, OUT_DIR) diff --git a/fetch/metadata/tools/requirements.txt b/fetch/metadata/tools/requirements.txt new file mode 100644 index 00000000000000..c28e0a8b96f501 --- /dev/null +++ b/fetch/metadata/tools/requirements.txt @@ -0,0 +1,3 @@ +Jinja2==2.10.3 +MarkupSafe==1.1.1 +PyYAML==5.2 diff --git a/fetch/metadata/tools/templates/image.sub.html b/fetch/metadata/tools/templates/image.sub.html index 6a030b99a76700..c042afd28c4f09 100644 --- a/fetch/metadata/tools/templates/image.sub.html +++ b/fetch/metadata/tools/templates/image.sub.html @@ -14,16 +14,16 @@ return new Promise((resolve) => { const image = document.createElement('img'); - image.src = '%(domain)s' + path; + image.src = '[%domain%]' + path; image.onload = image.onerror = resolve; }) .then(() => fetch(path + '&retrieve')) .then((response) => response.text()) .then((text) => JSON.parse(text)) .then((actual) => { -%(validation)s +[%validation%] }); - }, '%(title)s'); + }, '[%title%]'); diff --git a/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html b/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html index f65c93209d9394..8b39afc1ab4efb 100644 --- a/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html +++ b/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html @@ -13,13 +13,13 @@ promise_test(async function() { const id = 'script-{{uuid()}}'; await import( - '%(domain)s/fetch/metadata/resources/record-header.py?file=' + id + '[%domain%]/fetch/metadata/resources/record-header.py?file=' + id ); const response = await fetch( '/fetch/metadata/resources/record-header.py?retrieve&file=' + id ); const actual = JSON.parse(await response.text()); -%(validation)s - }, '%(title)s'); +[%validation%] + }, '[%title%]'); diff --git a/fetch/metadata/tools/templates/js-module-via-script.sub.html b/fetch/metadata/tools/templates/js-module-via-script.sub.html index 21ec058a6cf3bc..1efef7d35f5ca4 100644 --- a/fetch/metadata/tools/templates/js-module-via-script.sub.html +++ b/fetch/metadata/tools/templates/js-module-via-script.sub.html @@ -6,15 +6,15 @@ + src="[%domain%]/fetch/metadata/resources/record-header.py?file=script-{{$id:uuid()}}"> diff --git a/fetch/metadata/tools/templates/js-module-via-static-import.sub.html b/fetch/metadata/tools/templates/js-module-via-static-import.sub.html index 6a7371aba31889..b4df960250835c 100644 --- a/fetch/metadata/tools/templates/js-module-via-static-import.sub.html +++ b/fetch/metadata/tools/templates/js-module-via-static-import.sub.html @@ -9,7 +9,7 @@ window.moduleExecuted = new Promise((resolve) => window.resolve = resolve); @@ -22,8 +22,8 @@ .then((response) => response.text()) .then((text) => { const actual = JSON.parse(text); -%(validation)s +[%validation%] }); - }, '%(title)s'); + }, '[%title%]'); diff --git a/fetch/metadata/tools/templates/many.html b/fetch/metadata/tools/templates/many.html index 80603bca2f691d..ab7f488fe28477 100644 --- a/fetch/metadata/tools/templates/many.html +++ b/fetch/metadata/tools/templates/many.html @@ -10,10 +10,10 @@ diff --git a/fetch/metadata/tools/templates/video-poster.sub.html b/fetch/metadata/tools/templates/video-poster.sub.html index 339d6e37e9d41d..71ebefa7acef3b 100644 --- a/fetch/metadata/tools/templates/video-poster.sub.html +++ b/fetch/metadata/tools/templates/video-poster.sub.html @@ -13,15 +13,15 @@ var id = 'image-{{uuid()}}'; video.setAttribute( 'poster', - '%(domain)s/fetch/metadata/resources/record-header.py?file=' + id + '[%domain%]/fetch/metadata/resources/record-header.py?file=' + id ); document.body.appendChild(video); return pollForRequestRecording(id) .then(function(actual) { -%(validation)s +[%validation%] }); - }, '%(title)s'); + }, '[%title%]'); From 27721977d6b23e136aeed7097d9de1ffc78fcfde Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 5 Dec 2019 20:02:52 -0500 Subject: [PATCH 007/127] Redo kind of --- ...-cross-site.tentative.https.image.sub.html | 36 --- ...same-origin.tentative.https.image.sub.html | 36 --- ...e-same-site.tentative.https.image.sub.html | 36 --- ...-cross-site.tentative.https.image.sub.html | 36 --- .../redirect.tentative.image.sub.html | 215 ++++++++++++++++++ fetch/metadata/tools/cases/image.sub.html.yml | 87 ++++--- fetch/metadata/tools/templates/image.sub.html | 35 ++- 7 files changed, 278 insertions(+), 203 deletions(-) delete mode 100644 fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html delete mode 100644 fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html delete mode 100644 fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html delete mode 100644 fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html create mode 100644 fetch/metadata/generated/redirect.tentative.image.sub.html diff --git a/fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html deleted file mode 100644 index f853d33edda8fb..00000000000000 --- a/fetch/metadata/generated/redirect-cross-site-cross-site.tentative.https.image.sub.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html deleted file mode 100644 index e29b6a54e3916d..00000000000000 --- a/fetch/metadata/generated/redirect-cross-site-same-origin.tentative.https.image.sub.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html deleted file mode 100644 index 5ca8d9318faad3..00000000000000 --- a/fetch/metadata/generated/redirect-cross-site-same-site.tentative.https.image.sub.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html b/fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html deleted file mode 100644 index e11629439de2f9..00000000000000 --- a/fetch/metadata/generated/redirect-multiple-cross-site.tentative.https.image.sub.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/redirect.tentative.image.sub.html b/fetch/metadata/generated/redirect.tentative.image.sub.html new file mode 100644 index 00000000000000..44652e1855d5b0 --- /dev/null +++ b/fetch/metadata/generated/redirect.tentative.image.sub.html @@ -0,0 +1,215 @@ + + + + + Fetch metadata request headers, redirection on images + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/cases/image.sub.html.yml b/fetch/metadata/tools/cases/image.sub.html.yml index 07067ec4903de6..efb53c60c3eac3 100644 --- a/fetch/metadata/tools/cases/image.sub.html.yml +++ b/fetch/metadata/tools/cases/image.sub.html.yml @@ -1,52 +1,43 @@ --- -redirect-cross-site-same-origin.tentative.https: - domain: https://{{hosts[alt][www]}}:{{ports[https][0]}}/xhr/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}} - title: Cross-Site -> Same-Origin redirect - validation: | - let expected = { - site: "cross-site", - user: "", - mode: "no-cors", - dest: "image" - }; - assert_header_equals(actual, expected, "Cross-Site -> Same-Origin redirect"); +redirect.tentative: + title: Fetch metadata request headers, redirection on images + requests: + - title: Cross-Site -> Same-Origin redirect + pathPrefix: chain('HTTPS_REMOTE_ORIGIN', 'HTTPS_ORIGIN') + expectations: + sec-fetch-site: cross-site + sec-fetch-user: NULL + sec-fetch-mode: no-cors + sec-fetch-dest: image -redirect-cross-site-same-site.tentative.https: - domain: https://{{hosts[alt][www]}}:{{ports[https][0]}}/xhr/resources/redirect.py?location=https://{{hosts[][www]}}:{{ports[https][0]}} - title: Cross-Site -> Same-Site redirect - validation: | - let expected = { - site: "cross-site", - user: "", - mode: "no-cors", - dest: "image" - }; - assert_header_equals(actual, expected, "Cross-Site -> Same-Site redirect"); + - title: Cross-Site -> Same-Site redirect + pathPrefix: chain('HTTPS_REMOTE_ORIGIN', 'AUTHENTICATED_ORIGIN') + expectations: + sec-fetch-site: cross-site + sec-fetch-user: NULL + sec-fetch-mode: no-cors + sec-fetch-dest: image -redirect-cross-site-cross-site.tentative.https: - domain: https://{{hosts[alt][www]}}:{{ports[https][0]}}/xhr/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}} - title: Cross-Site -> Cross-Site redirect - validation: | - let expected = { - site: "cross-site", - user: "", - mode: "no-cors", - dest: "image" - }; - assert_header_equals(actual, expected, "Cross-Site -> Cross-Site redirect"); + - title: Cross-Site -> Cross-Site redirect + pathPrefix: chain('HTTPS_REMOTE_ORIGIN', 'HTTPS_REMOTE_ORIGIN') + expectations: + sec-fetch-site: cross-site + sec-fetch-user: NULL + sec-fetch-mode: no-cors + sec-fetch-dest: image -redirect-multiple-cross-site.tentative.https: - # same-origin -> cross-site -> same-origin - domain: "\ - https://{{host}}:{{ports[https][0]}}/xhr/resources/redirect.py?location=\ - https://{{hosts[alt][www]}}:{{ports[https][0]}}/xhr/resources/redirect.py?location=\ - https://{{host}}:{{ports[https][0]}}" - title: Same-Origin -> Cross-Site -> Same-Origin redirect - validation: | - let expected = { - site: "cross-site", - user: "", - mode: "no-cors", - dest: "image" - }; - assert_header_equals(actual, expected, "Same-Origin -> Cross-Site -> Same-Origin redirect"); + - title: Same-Origin -> Cross-Site -> Same-Origin redirect + pathPrefix: chain('HTTPS_ORIGIN', 'HTTPS_REMOTE_ORIGIN', 'HTTPS_ORIGIN') + expectations: + sec-fetch-site: cross-site + sec-fetch-user: NULL + sec-fetch-mode: no-cors + sec-fetch-dest: image + + - title: HTTPS downgrade-upgrade + pathPrefix: chain('HTTPS_ORIGIN', 'HTTP_ORIGIN', 'HTTPS_ORIGIN') + expectations: + sec-fetch-site: cross-site + sec-fetch-user: NULL + sec-fetch-mode: no-cors + sec-fetch-dest: image diff --git a/fetch/metadata/tools/templates/image.sub.html b/fetch/metadata/tools/templates/image.sub.html index c042afd28c4f09..600e4fdfe5e9ea 100644 --- a/fetch/metadata/tools/templates/image.sub.html +++ b/fetch/metadata/tools/templates/image.sub.html @@ -2,28 +2,41 @@ + [%title%] - + + From 6e781b626164357999db6f9f6ac84302ef0bec03 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 6 Dec 2019 12:22:52 -0500 Subject: [PATCH 008/127] Parameterize script tags --- fetch/metadata/tools/cases/image.sub.html.yml | 3 +++ fetch/metadata/tools/templates/image.sub.html | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fetch/metadata/tools/cases/image.sub.html.yml b/fetch/metadata/tools/cases/image.sub.html.yml index efb53c60c3eac3..b5916ea759482e 100644 --- a/fetch/metadata/tools/cases/image.sub.html.yml +++ b/fetch/metadata/tools/cases/image.sub.html.yml @@ -1,6 +1,9 @@ --- redirect.tentative: title: Fetch metadata request headers, redirection on images + scripts: + - /common/get-host-info.sub.js + - /fetch/metadata/resources/helper.sub.js requests: - title: Cross-Site -> Same-Origin redirect pathPrefix: chain('HTTPS_REMOTE_ORIGIN', 'HTTPS_ORIGIN') diff --git a/fetch/metadata/tools/templates/image.sub.html b/fetch/metadata/tools/templates/image.sub.html index 600e4fdfe5e9ea..4a34f479ef66bd 100644 --- a/fetch/metadata/tools/templates/image.sub.html +++ b/fetch/metadata/tools/templates/image.sub.html @@ -5,8 +5,9 @@ [%title%] - - + {%- for script in scripts %} + + {%- endfor %} - - - - - \ No newline at end of file diff --git a/fetch/metadata/tools/cases/many.html.yml b/fetch/metadata/tools/cases/many.html.yml deleted file mode 100644 index 52f7837717b740..00000000000000 --- a/fetch/metadata/tools/cases/many.html.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -case-name: - title: Test title! - subtests: - - foo: hello - - foo: goodbye diff --git a/fetch/metadata/tools/templates/many.html b/fetch/metadata/tools/templates/many.html deleted file mode 100644 index ab7f488fe28477..00000000000000 --- a/fetch/metadata/tools/templates/many.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - %(title)s - - - - - - From 342923a9eedb25924bfee54c8390fbeebbcaea3b Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 6 Dec 2019 15:08:52 -0500 Subject: [PATCH 010/127] Add tests for Application Cache manifest download --- ...tentative.appcache-manifest.sub.https.html | 222 ++++++++++++++++++ .../resources/appcache-iframe.sub.html | 15 ++ .../appcache-manifest.sub.https.html | 66 ++++++ 3 files changed, 303 insertions(+) create mode 100644 fetch/metadata/generated/redirect.tentative.appcache-manifest.sub.https.html create mode 100644 fetch/metadata/resources/appcache-iframe.sub.html create mode 100644 fetch/metadata/tools/templates/appcache-manifest.sub.https.html diff --git a/fetch/metadata/generated/redirect.tentative.appcache-manifest.sub.https.html b/fetch/metadata/generated/redirect.tentative.appcache-manifest.sub.https.html new file mode 100644 index 00000000000000..c7a9f40dd927f9 --- /dev/null +++ b/fetch/metadata/generated/redirect.tentative.appcache-manifest.sub.https.html @@ -0,0 +1,222 @@ + + + + + Fetch metadata request headers, redirection on AppCache manifest + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/resources/appcache-iframe.sub.html b/fetch/metadata/resources/appcache-iframe.sub.html new file mode 100644 index 00000000000000..cea9a4feaec4d7 --- /dev/null +++ b/fetch/metadata/resources/appcache-iframe.sub.html @@ -0,0 +1,15 @@ + + + + diff --git a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html new file mode 100644 index 00000000000000..2e3e05318b1ff1 --- /dev/null +++ b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html @@ -0,0 +1,66 @@ + + + + + [%title%] + + + {%- for script in scripts %} + + {%- endfor %} + + + + From c0c5aee5aa86feabeb2f4c090182da9a0494dd9b Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 6 Dec 2019 15:11:24 -0500 Subject: [PATCH 011/127] Reduce repetition in generated output --- .../redirect.tentative.image.sub.html | 38 +++++++------------ fetch/metadata/tools/templates/image.sub.html | 15 +++++--- 2 files changed, 23 insertions(+), 30 deletions(-) diff --git a/fetch/metadata/generated/redirect.tentative.image.sub.html b/fetch/metadata/generated/redirect.tentative.image.sub.html index 44652e1855d5b0..9404a107f3e9f3 100644 --- a/fetch/metadata/generated/redirect.tentative.image.sub.html +++ b/fetch/metadata/generated/redirect.tentative.image.sub.html @@ -11,13 +11,17 @@ - + - + + {%- for script in scripts %} {%- endfor %} diff --git a/fetch/metadata/tools/templates/image.sub.html b/fetch/metadata/tools/templates/image.sub.html index 1148006ba52293..54ccf9a86c86b5 100644 --- a/fetch/metadata/tools/templates/image.sub.html +++ b/fetch/metadata/tools/templates/image.sub.html @@ -5,6 +5,7 @@ [%title%] + {%- for script in scripts %} {%- endfor %} From 0cc2c848d19c911755cb93e63b824bf207b7aa6f Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 6 Dec 2019 16:04:48 -0500 Subject: [PATCH 014/127] Check in resource --- fetch/metadata/resources/helper.sub.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 fetch/metadata/resources/helper.sub.js diff --git a/fetch/metadata/resources/helper.sub.js b/fetch/metadata/resources/helper.sub.js new file mode 100644 index 00000000000000..714abadc104da0 --- /dev/null +++ b/fetch/metadata/resources/helper.sub.js @@ -0,0 +1,26 @@ +function test_eventual_property(title, name, expected, thenable) { + promise_test(() => { + return thenable + .then((object) => { + if (expected === null) { + assert_not_own_property(object, name); + } else { + assert_own_property(expected, 'value'); + assert_equals(object[name], expected.value); + } + }); + }, title + ' - ' + name); +} + +function chain(...domains) { + const redir = '/fetch/api/resources/redirect.py?location='; + const hostInfo = get_host_info(); + + return function(path) { + let full = hostInfo[domains.pop()] + path; + for (const domain of domains.reverse()) { + full = hostInfo[domain] + redir + encodeURIComponent(full); + } + return full; + } +} From d67f78e604e1077b7f46be1b1a1d79e1a480e431 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 6 Dec 2019 19:39:10 -0500 Subject: [PATCH 015/127] Add some tests for form submission This is getting ugly --- ...nsecure.tentative.form-submission.sub.html | 124 +++++++++ ...t.https.tentative.form-submission.sub.html | 242 ++++++++++++++++++ fetch/metadata/resources/helper.sub.js | 10 + .../tools/cases/form-submission.sub.html.yml | 63 +++++ .../tools/templates/form-submission.sub.html | 75 ++++++ 5 files changed, 514 insertions(+) create mode 100644 fetch/metadata/generated/insecure.tentative.form-submission.sub.html create mode 100644 fetch/metadata/generated/redirect.https.tentative.form-submission.sub.html create mode 100644 fetch/metadata/tools/cases/form-submission.sub.html.yml create mode 100644 fetch/metadata/tools/templates/form-submission.sub.html diff --git a/fetch/metadata/generated/insecure.tentative.form-submission.sub.html b/fetch/metadata/generated/insecure.tentative.form-submission.sub.html new file mode 100644 index 00000000000000..05142ecab4b0c5 --- /dev/null +++ b/fetch/metadata/generated/insecure.tentative.form-submission.sub.html @@ -0,0 +1,124 @@ + + + + + Fetch metadata request headers - form submission from an insecure context + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/redirect.https.tentative.form-submission.sub.html b/fetch/metadata/generated/redirect.https.tentative.form-submission.sub.html new file mode 100644 index 00000000000000..9e033633ca61ce --- /dev/null +++ b/fetch/metadata/generated/redirect.https.tentative.form-submission.sub.html @@ -0,0 +1,242 @@ + + + + + Fetch metadata request headers, redirection on form submission + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/resources/helper.sub.js b/fetch/metadata/resources/helper.sub.js index 714abadc104da0..f6dac62ee4107d 100644 --- a/fetch/metadata/resources/helper.sub.js +++ b/fetch/metadata/resources/helper.sub.js @@ -24,3 +24,13 @@ function chain(...domains) { return full; } } + +let series = (() => { + let latest; + + return (operation) => { + const next = (latest || Promise.resolve()).then(operation); + latest = next.catch(() => {}); + return next; + }; +})(); diff --git a/fetch/metadata/tools/cases/form-submission.sub.html.yml b/fetch/metadata/tools/cases/form-submission.sub.html.yml new file mode 100644 index 00000000000000..b2d2da5eaecca7 --- /dev/null +++ b/fetch/metadata/tools/cases/form-submission.sub.html.yml @@ -0,0 +1,63 @@ +--- +insecure.tentative: + title: Fetch metadata request headers - form submission from an insecure context + requests: + - title: GET + method: GET + expectations: + sec-fetch-site: NULL + sec-fetch-user: NULL + sec-fetch-mode: NULL + sec-fetch-dest: NULL + - title: POST + method: POST + expectations: + sec-fetch-site: NULL + sec-fetch-user: NULL + sec-fetch-mode: NULL + sec-fetch-dest: NULL + +redirect.https.tentative: + title: Fetch metadata request headers, redirection on form submission + scripts: + - /common/get-host-info.sub.js + requests: + - title: Cross-Site -> Same-Origin redirect + pathPrefix: chain('HTTPS_REMOTE_ORIGIN', 'HTTPS_ORIGIN') + expectations: + sec-fetch-site: cross-site + sec-fetch-user: NULL + sec-fetch-mode: navigate + sec-fetch-dest: document + + - title: Cross-Site -> Same-Site redirect + pathPrefix: chain('HTTPS_REMOTE_ORIGIN', 'AUTHENTICATED_ORIGIN') + expectations: + sec-fetch-site: cross-site + sec-fetch-user: NULL + sec-fetch-mode: navigate + sec-fetch-dest: document + + - title: Cross-Site -> Cross-Site redirect + pathPrefix: chain('HTTPS_REMOTE_ORIGIN', 'HTTPS_REMOTE_ORIGIN') + expectations: + sec-fetch-site: cross-site + sec-fetch-user: NULL + sec-fetch-mode: navigate + sec-fetch-dest: document + + - title: Same-Origin -> Cross-Site -> Same-Origin redirect + pathPrefix: chain('HTTPS_ORIGIN', 'HTTPS_REMOTE_ORIGIN', 'HTTPS_ORIGIN') + expectations: + sec-fetch-site: cross-site + sec-fetch-user: NULL + sec-fetch-mode: navigate + sec-fetch-dest: document + + - title: HTTPS downgrade-upgrade + pathPrefix: chain('HTTPS_ORIGIN', 'HTTP_ORIGIN', 'HTTPS_ORIGIN') + expectations: + sec-fetch-site: cross-site + sec-fetch-user: NULL + sec-fetch-mode: navigate + sec-fetch-dest: document diff --git a/fetch/metadata/tools/templates/form-submission.sub.html b/fetch/metadata/tools/templates/form-submission.sub.html new file mode 100644 index 00000000000000..d400ef2d6e110e --- /dev/null +++ b/fetch/metadata/tools/templates/form-submission.sub.html @@ -0,0 +1,75 @@ + + + + + [%title%] + + + + {%- for script in scripts %} + + {%- endfor %} + + + + From aaa25442dd34ff841f322c07a32ed6d30311ed25 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 6 Dec 2019 20:16:07 -0500 Subject: [PATCH 016/127] Extend template This can't be the answer --- .../generated/insecure.tentative.form-submission.sub.html | 4 ++-- fetch/metadata/tools/templates/form-submission.sub.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fetch/metadata/generated/insecure.tentative.form-submission.sub.html b/fetch/metadata/generated/insecure.tentative.form-submission.sub.html index 05142ecab4b0c5..e7cc70c0ded9f2 100644 --- a/fetch/metadata/generated/insecure.tentative.form-submission.sub.html +++ b/fetch/metadata/generated/insecure.tentative.form-submission.sub.html @@ -46,7 +46,7 @@ const path = '/fetch/metadata/resources/record-headers.py'; const key = '{{uuid()}}'; const headers = series(() => - induceRequest('', key, (path)) + induceRequest('', key, location.origin+(path)) ) .then(() => fetch(path + '?retrieve&key=' + key)) .then((response) => response.text()) @@ -85,7 +85,7 @@ const path = '/fetch/metadata/resources/record-headers.py'; const key = '{{uuid()}}'; const headers = series(() => - induceRequest('', key, (path)) + induceRequest('', key, location.origin+(path)) ) .then(() => fetch(path + '?retrieve&key=' + key)) .then((response) => response.text()) diff --git a/fetch/metadata/tools/templates/form-submission.sub.html b/fetch/metadata/tools/templates/form-submission.sub.html index d400ef2d6e110e..3b14138b2f97f3 100644 --- a/fetch/metadata/tools/templates/form-submission.sub.html +++ b/fetch/metadata/tools/templates/form-submission.sub.html @@ -50,7 +50,7 @@ const path = '/fetch/metadata/resources/record-headers.py'; const key = '{{uuid()}}'; const headers = series(() => - induceRequest('[%method%]', key, [%request.pathPrefix%](path)) + induceRequest('[%method%]', key, [%request.pathPrefix | default("location.origin+")%](path)) ) .then(() => fetch(path + '?retrieve&key=' + key)) .then((response) => response.text()) From 83b8c462989effb6b2e3e8a10d688c406f756f00 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 6 Dec 2019 20:52:06 -0500 Subject: [PATCH 017/127] Improve names of generated tests --- ...> appcache-manifest-redirect.tentative.sub.https.html} | 0 ...b.html => form-submission-insecure.tentative.sub.html} | 0 ... => form-submission-redirect.https.tentative.sub.html} | 0 ...e.image.sub.html => image-redirect.tentative.sub.html} | 0 ...le-via-dynamic-import-cross-domain.tentative.sub.html} | 0 ...ule-via-dynamic-import-same-domain.tentative.sub.html} | 0 ... js-module-via-script-cross-domain.tentative.sub.html} | 0 ...> js-module-via-script-same-domain.tentative.sub.html} | 0 ...ule-via-static-import-cross-domain.tentative.sub.html} | 0 ...dule-via-static-import-same-domain.tentative.sub.html} | 0 ...l => video-poster-cross-site.tentative.https.sub.html} | 0 ... => video-poster-same-origin.tentative.https.sub.html} | 0 ...ml => video-poster-same-site.tentative.https.sub.html} | 0 ...=> video-poster-unstrustworthy-url.tentative.sub.html} | 0 fetch/metadata/tools/generate.py | 8 ++++++-- 15 files changed, 6 insertions(+), 2 deletions(-) rename fetch/metadata/generated/{redirect.tentative.appcache-manifest.sub.https.html => appcache-manifest-redirect.tentative.sub.https.html} (100%) rename fetch/metadata/generated/{insecure.tentative.form-submission.sub.html => form-submission-insecure.tentative.sub.html} (100%) rename fetch/metadata/generated/{redirect.https.tentative.form-submission.sub.html => form-submission-redirect.https.tentative.sub.html} (100%) rename fetch/metadata/generated/{redirect.tentative.image.sub.html => image-redirect.tentative.sub.html} (100%) rename fetch/metadata/generated/{cross-domain.tentative.js-module-via-dynamic-import.sub.html => js-module-via-dynamic-import-cross-domain.tentative.sub.html} (100%) rename fetch/metadata/generated/{same-domain.tentative.js-module-via-dynamic-import.sub.html => js-module-via-dynamic-import-same-domain.tentative.sub.html} (100%) rename fetch/metadata/generated/{cross-domain.tentative.js-module-via-script.sub.html => js-module-via-script-cross-domain.tentative.sub.html} (100%) rename fetch/metadata/generated/{same-domain.tentative.js-module-via-script.sub.html => js-module-via-script-same-domain.tentative.sub.html} (100%) rename fetch/metadata/generated/{cross-domain.tentative.js-module-via-static-import.sub.html => js-module-via-static-import-cross-domain.tentative.sub.html} (100%) rename fetch/metadata/generated/{same-domain.tentative.js-module-via-static-import.sub.html => js-module-via-static-import-same-domain.tentative.sub.html} (100%) rename fetch/metadata/generated/{cross-site.tentative.https.video-poster.sub.html => video-poster-cross-site.tentative.https.sub.html} (100%) rename fetch/metadata/generated/{same-origin.tentative.https.video-poster.sub.html => video-poster-same-origin.tentative.https.sub.html} (100%) rename fetch/metadata/generated/{same-site.tentative.https.video-poster.sub.html => video-poster-same-site.tentative.https.sub.html} (100%) rename fetch/metadata/generated/{unstrustworthy-url.tentative.video-poster.sub.html => video-poster-unstrustworthy-url.tentative.sub.html} (100%) diff --git a/fetch/metadata/generated/redirect.tentative.appcache-manifest.sub.https.html b/fetch/metadata/generated/appcache-manifest-redirect.tentative.sub.https.html similarity index 100% rename from fetch/metadata/generated/redirect.tentative.appcache-manifest.sub.https.html rename to fetch/metadata/generated/appcache-manifest-redirect.tentative.sub.https.html diff --git a/fetch/metadata/generated/insecure.tentative.form-submission.sub.html b/fetch/metadata/generated/form-submission-insecure.tentative.sub.html similarity index 100% rename from fetch/metadata/generated/insecure.tentative.form-submission.sub.html rename to fetch/metadata/generated/form-submission-insecure.tentative.sub.html diff --git a/fetch/metadata/generated/redirect.https.tentative.form-submission.sub.html b/fetch/metadata/generated/form-submission-redirect.https.tentative.sub.html similarity index 100% rename from fetch/metadata/generated/redirect.https.tentative.form-submission.sub.html rename to fetch/metadata/generated/form-submission-redirect.https.tentative.sub.html diff --git a/fetch/metadata/generated/redirect.tentative.image.sub.html b/fetch/metadata/generated/image-redirect.tentative.sub.html similarity index 100% rename from fetch/metadata/generated/redirect.tentative.image.sub.html rename to fetch/metadata/generated/image-redirect.tentative.sub.html diff --git a/fetch/metadata/generated/cross-domain.tentative.js-module-via-dynamic-import.sub.html b/fetch/metadata/generated/js-module-via-dynamic-import-cross-domain.tentative.sub.html similarity index 100% rename from fetch/metadata/generated/cross-domain.tentative.js-module-via-dynamic-import.sub.html rename to fetch/metadata/generated/js-module-via-dynamic-import-cross-domain.tentative.sub.html diff --git a/fetch/metadata/generated/same-domain.tentative.js-module-via-dynamic-import.sub.html b/fetch/metadata/generated/js-module-via-dynamic-import-same-domain.tentative.sub.html similarity index 100% rename from fetch/metadata/generated/same-domain.tentative.js-module-via-dynamic-import.sub.html rename to fetch/metadata/generated/js-module-via-dynamic-import-same-domain.tentative.sub.html diff --git a/fetch/metadata/generated/cross-domain.tentative.js-module-via-script.sub.html b/fetch/metadata/generated/js-module-via-script-cross-domain.tentative.sub.html similarity index 100% rename from fetch/metadata/generated/cross-domain.tentative.js-module-via-script.sub.html rename to fetch/metadata/generated/js-module-via-script-cross-domain.tentative.sub.html diff --git a/fetch/metadata/generated/same-domain.tentative.js-module-via-script.sub.html b/fetch/metadata/generated/js-module-via-script-same-domain.tentative.sub.html similarity index 100% rename from fetch/metadata/generated/same-domain.tentative.js-module-via-script.sub.html rename to fetch/metadata/generated/js-module-via-script-same-domain.tentative.sub.html diff --git a/fetch/metadata/generated/cross-domain.tentative.js-module-via-static-import.sub.html b/fetch/metadata/generated/js-module-via-static-import-cross-domain.tentative.sub.html similarity index 100% rename from fetch/metadata/generated/cross-domain.tentative.js-module-via-static-import.sub.html rename to fetch/metadata/generated/js-module-via-static-import-cross-domain.tentative.sub.html diff --git a/fetch/metadata/generated/same-domain.tentative.js-module-via-static-import.sub.html b/fetch/metadata/generated/js-module-via-static-import-same-domain.tentative.sub.html similarity index 100% rename from fetch/metadata/generated/same-domain.tentative.js-module-via-static-import.sub.html rename to fetch/metadata/generated/js-module-via-static-import-same-domain.tentative.sub.html diff --git a/fetch/metadata/generated/cross-site.tentative.https.video-poster.sub.html b/fetch/metadata/generated/video-poster-cross-site.tentative.https.sub.html similarity index 100% rename from fetch/metadata/generated/cross-site.tentative.https.video-poster.sub.html rename to fetch/metadata/generated/video-poster-cross-site.tentative.https.sub.html diff --git a/fetch/metadata/generated/same-origin.tentative.https.video-poster.sub.html b/fetch/metadata/generated/video-poster-same-origin.tentative.https.sub.html similarity index 100% rename from fetch/metadata/generated/same-origin.tentative.https.video-poster.sub.html rename to fetch/metadata/generated/video-poster-same-origin.tentative.https.sub.html diff --git a/fetch/metadata/generated/same-site.tentative.https.video-poster.sub.html b/fetch/metadata/generated/video-poster-same-site.tentative.https.sub.html similarity index 100% rename from fetch/metadata/generated/same-site.tentative.https.video-poster.sub.html rename to fetch/metadata/generated/video-poster-same-site.tentative.https.sub.html diff --git a/fetch/metadata/generated/unstrustworthy-url.tentative.video-poster.sub.html b/fetch/metadata/generated/video-poster-unstrustworthy-url.tentative.sub.html similarity index 100% rename from fetch/metadata/generated/unstrustworthy-url.tentative.video-poster.sub.html rename to fetch/metadata/generated/video-poster-unstrustworthy-url.tentative.sub.html diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index 253b01030903c0..024021af55b861 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -17,8 +17,12 @@ def find_templates(starting_directory): continue yield file_name, os.path.join(directory, file_name) +def test_name(template_name, case_name): + prefix, suffix = template_name.split('.', 1) + return '{}-{}.{}'.format(prefix, case_name, suffix) + def main(templates_directory, cases_directory, out_directory): - for name, path in find_templates(templates_directory): + for template_name, path in find_templates(templates_directory): with open(path, 'r') as handle: template = Template(handle.read(), variable_start_string='[%', variable_end_string='%]') @@ -29,7 +33,7 @@ def main(templates_directory, cases_directory, out_directory): for case_name in cases: out_file_name = os.path.join( - out_directory, '{}.{}'.format(case_name, name) + out_directory, test_name(template_name, case_name) ) with open(out_file_name, 'w') as handle: From 3d253d107002a43e35bb2b422aeef4b64ad98849 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 9 Dec 2019 16:40:36 -0500 Subject: [PATCH 018/127] Refactor heavily --- ...manifest-redirect.tentative.sub.https.html | 222 ---------------- ...est-sec-fetch-mode-redirect.sub.https.html | 100 ++++++++ ...c-fetch-site-redirect.https.sub.https.html | 100 ++++++++ ...orm-submission-insecure.tentative.sub.html | 124 --------- ...bmission-redirect.https.tentative.sub.html | 242 ------------------ ...ubmission-sec-fetch-mode-redirect.sub.html | 110 ++++++++ ...ion-sec-fetch-site-redirect.https.sub.html | 110 ++++++++ .../image-redirect.tentative.sub.html | 203 --------------- .../image-sec-fetch-mode-redirect.sub.html | 81 ++++++ ...age-sec-fetch-site-redirect.https.sub.html | 81 ++++++ ...mic-import-cross-domain.tentative.sub.html | 32 --- ...amic-import-same-domain.tentative.sub.html | 32 --- ...ic-import-sec-fetch-mode-redirect.sub.html | 71 +++++ ...ort-sec-fetch-site-redirect.https.sub.html | 71 +++++ ...via-script-cross-domain.tentative.sub.html | 27 -- ...-via-script-same-domain.tentative.sub.html | 27 -- ...ia-script-sec-fetch-mode-redirect.sub.html | 84 ++++++ ...ipt-sec-fetch-site-redirect.https.sub.html | 84 ++++++ ...tic-import-cross-domain.tentative.sub.html | 36 --- ...atic-import-same-domain.tentative.sub.html | 36 --- ...ic-import-sec-fetch-mode-redirect.sub.html | 102 ++++++++ ...ort-sec-fetch-site-redirect.https.sub.html | 102 ++++++++ ...poster-cross-site.tentative.https.sub.html | 34 --- ...oster-same-origin.tentative.https.sub.html | 34 --- ...-poster-same-site.tentative.https.sub.html | 34 --- ...eo-poster-sec-fetch-mode-redirect.sub.html | 86 +++++++ ...ter-sec-fetch-site-redirect.https.sub.html | 86 +++++++ ...ster-unstrustworthy-url.tentative.sub.html | 34 --- fetch/metadata/resources/es-module.sub.js | 1 + fetch/metadata/resources/helper.js | 8 +- fetch/metadata/resources/helper.sub.js | 36 --- fetch/metadata/resources/record-headers.py | 47 ++++ .../resources/redirectTestHelper.sub.js | 2 +- .../tools/cases/form-submission.sub.html.yml | 63 ----- fetch/metadata/tools/cases/image.sub.html.yml | 45 ---- .../js-module-via-dynamic-import.sub.html.yml | 24 -- .../cases/js-module-via-script.sub.html.yml | 24 -- .../js-module-via-static-import.sub.html.yml | 24 -- fetch/metadata/tools/cases/master.yml | 74 ++++++ .../tools/cases/video-poster.sub.html.yml | 48 ---- fetch/metadata/tools/generate.py | 22 +- .../appcache-manifest.sub.https.html | 33 +-- .../tools/templates/form-submission.sub.html | 35 +-- fetch/metadata/tools/templates/image.sub.html | 33 +-- .../js-module-via-dynamic-import.sub.html | 33 ++- .../templates/js-module-via-script.sub.html | 39 ++- .../js-module-via-static-import.sub.html | 52 ++-- .../tools/templates/video-poster.sub.html | 35 ++- 48 files changed, 1559 insertions(+), 1504 deletions(-) delete mode 100644 fetch/metadata/generated/appcache-manifest-redirect.tentative.sub.https.html create mode 100644 fetch/metadata/generated/appcache-manifest-sec-fetch-mode-redirect.sub.https.html create mode 100644 fetch/metadata/generated/appcache-manifest-sec-fetch-site-redirect.https.sub.https.html delete mode 100644 fetch/metadata/generated/form-submission-insecure.tentative.sub.html delete mode 100644 fetch/metadata/generated/form-submission-redirect.https.tentative.sub.html create mode 100644 fetch/metadata/generated/form-submission-sec-fetch-mode-redirect.sub.html create mode 100644 fetch/metadata/generated/form-submission-sec-fetch-site-redirect.https.sub.html delete mode 100644 fetch/metadata/generated/image-redirect.tentative.sub.html create mode 100644 fetch/metadata/generated/image-sec-fetch-mode-redirect.sub.html create mode 100644 fetch/metadata/generated/image-sec-fetch-site-redirect.https.sub.html delete mode 100644 fetch/metadata/generated/js-module-via-dynamic-import-cross-domain.tentative.sub.html delete mode 100644 fetch/metadata/generated/js-module-via-dynamic-import-same-domain.tentative.sub.html create mode 100644 fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-redirect.sub.html create mode 100644 fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-site-redirect.https.sub.html delete mode 100644 fetch/metadata/generated/js-module-via-script-cross-domain.tentative.sub.html delete mode 100644 fetch/metadata/generated/js-module-via-script-same-domain.tentative.sub.html create mode 100644 fetch/metadata/generated/js-module-via-script-sec-fetch-mode-redirect.sub.html create mode 100644 fetch/metadata/generated/js-module-via-script-sec-fetch-site-redirect.https.sub.html delete mode 100644 fetch/metadata/generated/js-module-via-static-import-cross-domain.tentative.sub.html delete mode 100644 fetch/metadata/generated/js-module-via-static-import-same-domain.tentative.sub.html create mode 100644 fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-redirect.sub.html create mode 100644 fetch/metadata/generated/js-module-via-static-import-sec-fetch-site-redirect.https.sub.html delete mode 100644 fetch/metadata/generated/video-poster-cross-site.tentative.https.sub.html delete mode 100644 fetch/metadata/generated/video-poster-same-origin.tentative.https.sub.html delete mode 100644 fetch/metadata/generated/video-poster-same-site.tentative.https.sub.html create mode 100644 fetch/metadata/generated/video-poster-sec-fetch-mode-redirect.sub.html create mode 100644 fetch/metadata/generated/video-poster-sec-fetch-site-redirect.https.sub.html delete mode 100644 fetch/metadata/generated/video-poster-unstrustworthy-url.tentative.sub.html create mode 100644 fetch/metadata/resources/es-module.sub.js delete mode 100644 fetch/metadata/resources/helper.sub.js create mode 100644 fetch/metadata/resources/record-headers.py delete mode 100644 fetch/metadata/tools/cases/form-submission.sub.html.yml delete mode 100644 fetch/metadata/tools/cases/image.sub.html.yml delete mode 100644 fetch/metadata/tools/cases/js-module-via-dynamic-import.sub.html.yml delete mode 100644 fetch/metadata/tools/cases/js-module-via-script.sub.html.yml delete mode 100644 fetch/metadata/tools/cases/js-module-via-static-import.sub.html.yml create mode 100644 fetch/metadata/tools/cases/master.yml delete mode 100644 fetch/metadata/tools/cases/video-poster.sub.html.yml diff --git a/fetch/metadata/generated/appcache-manifest-redirect.tentative.sub.https.html b/fetch/metadata/generated/appcache-manifest-redirect.tentative.sub.https.html deleted file mode 100644 index e7d30ec8694871..00000000000000 --- a/fetch/metadata/generated/appcache-manifest-redirect.tentative.sub.https.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - Fetch metadata request headers, redirection on AppCache manifest - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode-redirect.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode-redirect.sub.https.html new file mode 100644 index 00000000000000..16d4e6b0329190 --- /dev/null +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode-redirect.sub.https.html @@ -0,0 +1,100 @@ + + + + + Fetch Metadata - redirection + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site-redirect.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site-redirect.https.sub.https.html new file mode 100644 index 00000000000000..035e18521ab9b0 --- /dev/null +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site-redirect.https.sub.https.html @@ -0,0 +1,100 @@ + + + + + Fetch Metadata - redirection + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-insecure.tentative.sub.html b/fetch/metadata/generated/form-submission-insecure.tentative.sub.html deleted file mode 100644 index e7cc70c0ded9f2..00000000000000 --- a/fetch/metadata/generated/form-submission-insecure.tentative.sub.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Fetch metadata request headers - form submission from an insecure context - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-redirect.https.tentative.sub.html b/fetch/metadata/generated/form-submission-redirect.https.tentative.sub.html deleted file mode 100644 index 9e033633ca61ce..00000000000000 --- a/fetch/metadata/generated/form-submission-redirect.https.tentative.sub.html +++ /dev/null @@ -1,242 +0,0 @@ - - - - - Fetch metadata request headers, redirection on form submission - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-mode-redirect.sub.html new file mode 100644 index 00000000000000..6022d932551a04 --- /dev/null +++ b/fetch/metadata/generated/form-submission-sec-fetch-mode-redirect.sub.html @@ -0,0 +1,110 @@ + + + + + Fetch Metadata - redirection + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-site-redirect.https.sub.html new file mode 100644 index 00000000000000..2769179b89df8c --- /dev/null +++ b/fetch/metadata/generated/form-submission-sec-fetch-site-redirect.https.sub.html @@ -0,0 +1,110 @@ + + + + + Fetch Metadata - redirection + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/image-redirect.tentative.sub.html b/fetch/metadata/generated/image-redirect.tentative.sub.html deleted file mode 100644 index 8c9462adff0521..00000000000000 --- a/fetch/metadata/generated/image-redirect.tentative.sub.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - Fetch metadata request headers, redirection on images - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/image-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/image-sec-fetch-mode-redirect.sub.html new file mode 100644 index 00000000000000..f73acae31aa49b --- /dev/null +++ b/fetch/metadata/generated/image-sec-fetch-mode-redirect.sub.html @@ -0,0 +1,81 @@ + + + + + Fetch Metadata - redirection + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/image-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/image-sec-fetch-site-redirect.https.sub.html new file mode 100644 index 00000000000000..d4cf6de3165abb --- /dev/null +++ b/fetch/metadata/generated/image-sec-fetch-site-redirect.https.sub.html @@ -0,0 +1,81 @@ + + + + + Fetch Metadata - redirection + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-dynamic-import-cross-domain.tentative.sub.html b/fetch/metadata/generated/js-module-via-dynamic-import-cross-domain.tentative.sub.html deleted file mode 100644 index 0f23a5e3df316a..00000000000000 --- a/fetch/metadata/generated/js-module-via-dynamic-import-cross-domain.tentative.sub.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-dynamic-import-same-domain.tentative.sub.html b/fetch/metadata/generated/js-module-via-dynamic-import-same-domain.tentative.sub.html deleted file mode 100644 index 61061e539bae7f..00000000000000 --- a/fetch/metadata/generated/js-module-via-dynamic-import-same-domain.tentative.sub.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-redirect.sub.html new file mode 100644 index 00000000000000..1fec5a1ab4082c --- /dev/null +++ b/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-redirect.sub.html @@ -0,0 +1,71 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-site-redirect.https.sub.html new file mode 100644 index 00000000000000..e59e116b46573b --- /dev/null +++ b/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-site-redirect.https.sub.html @@ -0,0 +1,71 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-script-cross-domain.tentative.sub.html b/fetch/metadata/generated/js-module-via-script-cross-domain.tentative.sub.html deleted file mode 100644 index 2048b3741f07cf..00000000000000 --- a/fetch/metadata/generated/js-module-via-script-cross-domain.tentative.sub.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-script-same-domain.tentative.sub.html b/fetch/metadata/generated/js-module-via-script-same-domain.tentative.sub.html deleted file mode 100644 index cd72af33bfbab3..00000000000000 --- a/fetch/metadata/generated/js-module-via-script-same-domain.tentative.sub.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-redirect.sub.html new file mode 100644 index 00000000000000..3ddfad375134cb --- /dev/null +++ b/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-redirect.sub.html @@ -0,0 +1,84 @@ + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-script-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/js-module-via-script-sec-fetch-site-redirect.https.sub.html new file mode 100644 index 00000000000000..f718a1d9315775 --- /dev/null +++ b/fetch/metadata/generated/js-module-via-script-sec-fetch-site-redirect.https.sub.html @@ -0,0 +1,84 @@ + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-static-import-cross-domain.tentative.sub.html b/fetch/metadata/generated/js-module-via-static-import-cross-domain.tentative.sub.html deleted file mode 100644 index ec6c096a93535b..00000000000000 --- a/fetch/metadata/generated/js-module-via-static-import-cross-domain.tentative.sub.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-static-import-same-domain.tentative.sub.html b/fetch/metadata/generated/js-module-via-static-import-same-domain.tentative.sub.html deleted file mode 100644 index 99846868117ef9..00000000000000 --- a/fetch/metadata/generated/js-module-via-static-import-same-domain.tentative.sub.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-redirect.sub.html new file mode 100644 index 00000000000000..39b86fbc7e0a48 --- /dev/null +++ b/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-redirect.sub.html @@ -0,0 +1,102 @@ + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-static-import-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/js-module-via-static-import-sec-fetch-site-redirect.https.sub.html new file mode 100644 index 00000000000000..543740c2be48ef --- /dev/null +++ b/fetch/metadata/generated/js-module-via-static-import-sec-fetch-site-redirect.https.sub.html @@ -0,0 +1,102 @@ + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-cross-site.tentative.https.sub.html b/fetch/metadata/generated/video-poster-cross-site.tentative.https.sub.html deleted file mode 100644 index 9f7019d8c062d4..00000000000000 --- a/fetch/metadata/generated/video-poster-cross-site.tentative.https.sub.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-same-origin.tentative.https.sub.html b/fetch/metadata/generated/video-poster-same-origin.tentative.https.sub.html deleted file mode 100644 index 4d9e2a6ceb0d9d..00000000000000 --- a/fetch/metadata/generated/video-poster-same-origin.tentative.https.sub.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-same-site.tentative.https.sub.html b/fetch/metadata/generated/video-poster-same-site.tentative.https.sub.html deleted file mode 100644 index 21b6828d9d5c01..00000000000000 --- a/fetch/metadata/generated/video-poster-same-site.tentative.https.sub.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-mode-redirect.sub.html new file mode 100644 index 00000000000000..ef8ee7127b7887 --- /dev/null +++ b/fetch/metadata/generated/video-poster-sec-fetch-mode-redirect.sub.html @@ -0,0 +1,86 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site-redirect.https.sub.html new file mode 100644 index 00000000000000..e717941a6972af --- /dev/null +++ b/fetch/metadata/generated/video-poster-sec-fetch-site-redirect.https.sub.html @@ -0,0 +1,86 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-unstrustworthy-url.tentative.sub.html b/fetch/metadata/generated/video-poster-unstrustworthy-url.tentative.sub.html deleted file mode 100644 index 52a1c1329a5117..00000000000000 --- a/fetch/metadata/generated/video-poster-unstrustworthy-url.tentative.sub.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/resources/es-module.sub.js b/fetch/metadata/resources/es-module.sub.js new file mode 100644 index 00000000000000..f9668a3dc67807 --- /dev/null +++ b/fetch/metadata/resources/es-module.sub.js @@ -0,0 +1 @@ +import '{{GET[moduleId]}}'; diff --git a/fetch/metadata/resources/helper.js b/fetch/metadata/resources/helper.js index 0cb9e2b25b438b..66c9945c638bec 100644 --- a/fetch/metadata/resources/helper.js +++ b/fetch/metadata/resources/helper.js @@ -63,7 +63,7 @@ function assert_no_headers(value, tag) { } function pollForRequestRecording(id) { - return fetch('/fetch/metadata/resources/record-header.py?retrieve&file=' + id) + return fetch('/fetch/metadata/resources/record-headers.py?retrieve&key=' + id) .then(function(response) { if (!response.ok) { throw new Error('Failed to query for recorded headers.'); @@ -72,11 +72,13 @@ function pollForRequestRecording(id) { return response.text(); }) .then(function(text) { - if (text === "No header has been recorded") { + var value = JSON.parse(text); + + if (value === 'No request has been recorded') { return new Promise((resolve) => setTimeout(resolve, 300)) .then(() => pollForRequestRecording(id)); } - return JSON.parse(text); + return value; }); } diff --git a/fetch/metadata/resources/helper.sub.js b/fetch/metadata/resources/helper.sub.js deleted file mode 100644 index f6dac62ee4107d..00000000000000 --- a/fetch/metadata/resources/helper.sub.js +++ /dev/null @@ -1,36 +0,0 @@ -function test_eventual_property(title, name, expected, thenable) { - promise_test(() => { - return thenable - .then((object) => { - if (expected === null) { - assert_not_own_property(object, name); - } else { - assert_own_property(expected, 'value'); - assert_equals(object[name], expected.value); - } - }); - }, title + ' - ' + name); -} - -function chain(...domains) { - const redir = '/fetch/api/resources/redirect.py?location='; - const hostInfo = get_host_info(); - - return function(path) { - let full = hostInfo[domains.pop()] + path; - for (const domain of domains.reverse()) { - full = hostInfo[domain] + redir + encodeURIComponent(full); - } - return full; - } -} - -let series = (() => { - let latest; - - return (operation) => { - const next = (latest || Promise.resolve()).then(operation); - latest = next.catch(() => {}); - return next; - }; -})(); diff --git a/fetch/metadata/resources/record-headers.py b/fetch/metadata/resources/record-headers.py new file mode 100644 index 00000000000000..54d2666877f757 --- /dev/null +++ b/fetch/metadata/resources/record-headers.py @@ -0,0 +1,47 @@ +import os +import uuid +import hashlib +import time +import json + +def main(request, response): + ## Get the query parameter (key) from URL ## + ## Tests will record POST requests (CSP Report) and GET (rest) ## + if request.GET: + key = request.GET['key'] + elif request.POST: + key = request.POST['key'] + + ## Convert the key from String to UUID valid String ## + testId = hashlib.md5(key).hexdigest() + + ## Handle the header retrieval request ## + if 'retrieve' in request.GET: + response.writer.write_status(200) + response.writer.end_headers() + try: + headers = request.server.stash.take(testId) + response.writer.write(headers) + except (KeyError, ValueError) as e: + response.writer.write(json.dumps("No request has been recorded")) + pass + + response.close_connection = True + + ## Record incoming fetch metadata header value + else: + try: + request.server.stash.put(testId, json.dumps(request.headers)) + except KeyError: + ## The header is already recorded or it doesn't exist + pass + + ## Prevent the browser from caching returned responses and allow CORS ## + response.headers.set("Access-Control-Allow-Origin", "*") + response.headers.set("Cache-Control", "no-cache, no-store, must-revalidate") + response.headers.set("Pragma", "no-cache") + response.headers.set("Expires", "0") + if "mime" in request.GET: + response.headers.set("Content-Type", request.GET.first("mime")) + + return request.GET.first("body", "") diff --git a/fetch/metadata/resources/redirectTestHelper.sub.js b/fetch/metadata/resources/redirectTestHelper.sub.js index e5547e7ac7931f..3b34000155897a 100644 --- a/fetch/metadata/resources/redirectTestHelper.sub.js +++ b/fetch/metadata/resources/redirectTestHelper.sub.js @@ -23,7 +23,7 @@ let insecureTestURL = 'http://{{host}}:{{ports[http][0]}}/fetch/metadata/'; // simulate us downgrading then upgrading again during the same redirect chain. function MultipleRedirectTo(partialPath) { let finalURL = insecureRedirectURL + encodeURIComponent(secureTestURL + partialPath); - return insecureRedirectURL + encodeURIComponent(finalURL); + return secureRedirectURL + encodeURIComponent(finalURL); } // Helper to craft an URL that will go from HTTP => HTTPS to simulate upgrading a diff --git a/fetch/metadata/tools/cases/form-submission.sub.html.yml b/fetch/metadata/tools/cases/form-submission.sub.html.yml deleted file mode 100644 index b2d2da5eaecca7..00000000000000 --- a/fetch/metadata/tools/cases/form-submission.sub.html.yml +++ /dev/null @@ -1,63 +0,0 @@ ---- -insecure.tentative: - title: Fetch metadata request headers - form submission from an insecure context - requests: - - title: GET - method: GET - expectations: - sec-fetch-site: NULL - sec-fetch-user: NULL - sec-fetch-mode: NULL - sec-fetch-dest: NULL - - title: POST - method: POST - expectations: - sec-fetch-site: NULL - sec-fetch-user: NULL - sec-fetch-mode: NULL - sec-fetch-dest: NULL - -redirect.https.tentative: - title: Fetch metadata request headers, redirection on form submission - scripts: - - /common/get-host-info.sub.js - requests: - - title: Cross-Site -> Same-Origin redirect - pathPrefix: chain('HTTPS_REMOTE_ORIGIN', 'HTTPS_ORIGIN') - expectations: - sec-fetch-site: cross-site - sec-fetch-user: NULL - sec-fetch-mode: navigate - sec-fetch-dest: document - - - title: Cross-Site -> Same-Site redirect - pathPrefix: chain('HTTPS_REMOTE_ORIGIN', 'AUTHENTICATED_ORIGIN') - expectations: - sec-fetch-site: cross-site - sec-fetch-user: NULL - sec-fetch-mode: navigate - sec-fetch-dest: document - - - title: Cross-Site -> Cross-Site redirect - pathPrefix: chain('HTTPS_REMOTE_ORIGIN', 'HTTPS_REMOTE_ORIGIN') - expectations: - sec-fetch-site: cross-site - sec-fetch-user: NULL - sec-fetch-mode: navigate - sec-fetch-dest: document - - - title: Same-Origin -> Cross-Site -> Same-Origin redirect - pathPrefix: chain('HTTPS_ORIGIN', 'HTTPS_REMOTE_ORIGIN', 'HTTPS_ORIGIN') - expectations: - sec-fetch-site: cross-site - sec-fetch-user: NULL - sec-fetch-mode: navigate - sec-fetch-dest: document - - - title: HTTPS downgrade-upgrade - pathPrefix: chain('HTTPS_ORIGIN', 'HTTP_ORIGIN', 'HTTPS_ORIGIN') - expectations: - sec-fetch-site: cross-site - sec-fetch-user: NULL - sec-fetch-mode: navigate - sec-fetch-dest: document diff --git a/fetch/metadata/tools/cases/image.sub.html.yml b/fetch/metadata/tools/cases/image.sub.html.yml deleted file mode 100644 index 9c7038f1acc4f2..00000000000000 --- a/fetch/metadata/tools/cases/image.sub.html.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -redirect.tentative: - title: Fetch metadata request headers, redirection on images - scripts: - - /common/get-host-info.sub.js - requests: - - title: Cross-Site -> Same-Origin redirect - pathPrefix: chain('HTTPS_REMOTE_ORIGIN', 'HTTPS_ORIGIN') - expectations: - sec-fetch-site: cross-site - sec-fetch-user: NULL - sec-fetch-mode: no-cors - sec-fetch-dest: image - - - title: Cross-Site -> Same-Site redirect - pathPrefix: chain('HTTPS_REMOTE_ORIGIN', 'AUTHENTICATED_ORIGIN') - expectations: - sec-fetch-site: cross-site - sec-fetch-user: NULL - sec-fetch-mode: no-cors - sec-fetch-dest: image - - - title: Cross-Site -> Cross-Site redirect - pathPrefix: chain('HTTPS_REMOTE_ORIGIN', 'HTTPS_REMOTE_ORIGIN') - expectations: - sec-fetch-site: cross-site - sec-fetch-user: NULL - sec-fetch-mode: no-cors - sec-fetch-dest: image - - - title: Same-Origin -> Cross-Site -> Same-Origin redirect - pathPrefix: chain('HTTPS_ORIGIN', 'HTTPS_REMOTE_ORIGIN', 'HTTPS_ORIGIN') - expectations: - sec-fetch-site: cross-site - sec-fetch-user: NULL - sec-fetch-mode: no-cors - sec-fetch-dest: image - - - title: HTTPS downgrade-upgrade - pathPrefix: chain('HTTPS_ORIGIN', 'HTTP_ORIGIN', 'HTTPS_ORIGIN') - expectations: - sec-fetch-site: cross-site - sec-fetch-user: NULL - sec-fetch-mode: no-cors - sec-fetch-dest: image diff --git a/fetch/metadata/tools/cases/js-module-via-dynamic-import.sub.html.yml b/fetch/metadata/tools/cases/js-module-via-dynamic-import.sub.html.yml deleted file mode 100644 index 43be05c3e0790d..00000000000000 --- a/fetch/metadata/tools/cases/js-module-via-dynamic-import.sub.html.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -same-domain.tentative: - title: something - domain: '' - validation: | - var expected = { - dest: 'script', - mode: '', - site: '', - user: '' - }; - assert_header_equals(actual, expected); - -cross-domain.tentative: - title: something across domains - domain: http://{{domains[www2]}}:{{ports[http][0]}} - validation: | - var expected = { - dest: 'script', - mode: '', - site: '', - user: '' - }; - assert_header_equals(actual, expected); diff --git a/fetch/metadata/tools/cases/js-module-via-script.sub.html.yml b/fetch/metadata/tools/cases/js-module-via-script.sub.html.yml deleted file mode 100644 index 43be05c3e0790d..00000000000000 --- a/fetch/metadata/tools/cases/js-module-via-script.sub.html.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -same-domain.tentative: - title: something - domain: '' - validation: | - var expected = { - dest: 'script', - mode: '', - site: '', - user: '' - }; - assert_header_equals(actual, expected); - -cross-domain.tentative: - title: something across domains - domain: http://{{domains[www2]}}:{{ports[http][0]}} - validation: | - var expected = { - dest: 'script', - mode: '', - site: '', - user: '' - }; - assert_header_equals(actual, expected); diff --git a/fetch/metadata/tools/cases/js-module-via-static-import.sub.html.yml b/fetch/metadata/tools/cases/js-module-via-static-import.sub.html.yml deleted file mode 100644 index 43be05c3e0790d..00000000000000 --- a/fetch/metadata/tools/cases/js-module-via-static-import.sub.html.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -same-domain.tentative: - title: something - domain: '' - validation: | - var expected = { - dest: 'script', - mode: '', - site: '', - user: '' - }; - assert_header_equals(actual, expected); - -cross-domain.tentative: - title: something across domains - domain: http://{{domains[www2]}}:{{ports[http][0]}} - validation: | - var expected = { - dest: 'script', - mode: '', - site: '', - user: '' - }; - assert_header_equals(actual, expected); diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml new file mode 100644 index 00000000000000..2482b20bf80a6d --- /dev/null +++ b/fetch/metadata/tools/cases/master.yml @@ -0,0 +1,74 @@ +--- +- templates: '*' + file_name_part: sec-fetch-site-redirect.https + title: Fetch Metadata - redirection + headerName: sec-fetch-site + requests: + - description: Cross-Site -> Same-Origin + pathPrefix: "\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: cross-site + + - description: Cross-Site -> Same-Site + pathPrefix: "\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{domains[www2]}}:{{ports[https][0]}}" + expected: cross-site + + - description: Cross-Site -> Cross-Site + pathPrefix: "\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{hosts[alt][]}}:{{ports[https][0]}}" + expected: cross-site + + - description: Same-Origin -> Cross-Site -> Same-Origin + pathPrefix: "\ + https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: cross-site + + - description: HTTPS downgrade-upgrade + pathPrefix: "\ + https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: cross-site + +- templates: '*' + file_name_part: sec-fetch-mode-redirect + title: Fetch Metadata - redirection + headerName: sec-fetch-mode + requests: + - description: Cross-Site -> Same-Origin + pathPrefix: "\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: no-cors + + - description: Cross-Site -> Same-Site + pathPrefix: "\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{domains[www]}}:{{ports[https][0]}}" + expected: no-cors + + - description: Cross-Site -> Cross-Site + pathPrefix: "\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{hosts[alt][]}}:{{ports[https][0]}}" + expected: no-cors + + - description: Same-Origin -> Cross-Site -> Same-Origin + pathPrefix: "\ + https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: no-cors + + - description: HTTPS downgrade-upgrade + pathPrefix: "\ + https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: no-cors diff --git a/fetch/metadata/tools/cases/video-poster.sub.html.yml b/fetch/metadata/tools/cases/video-poster.sub.html.yml deleted file mode 100644 index 13540181d46e78..00000000000000 --- a/fetch/metadata/tools/cases/video-poster.sub.html.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -cross-site.tentative.https: - title: something across domains - domain: https://{{hosts[alt][]}}:{{ports[https][0]}} - validation: | - var expected = { - dest: 'image', - mode: 'no-cors', - site: 'cross-site', - user: '' - }; - assert_header_equals(actual, expected); - -same-origin.tentative.https: - title: something across domains - domain: '' - validation: | - var expected = { - dest: 'image', - mode: 'no-cors', - site: 'same-origin', - user: '' - }; - assert_header_equals(actual, expected); - -same-site.tentative.https: - title: something across domains - domain: https://{{domains[www2]}}:{{ports[https][0]}} - validation: | - var expected = { - dest: 'image', - mode: 'no-cors', - site: 'same-site', - user: '' - }; - assert_header_equals(actual, expected); - -unstrustworthy-url.tentative: - title: poster image fetched via an untrustworthy URL - domain: '' - validation: | - var expected = { - dest: '', - mode: '', - site: '', - user: '' - }; - assert_header_equals(actual, expected); diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index 024021af55b861..c7fed13d6398b0 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -8,7 +8,7 @@ HERE = os.path.abspath(os.path.dirname(__file__)) OUT_DIR = os.path.normpath(os.path.join(HERE, '..', 'generated')) TEMPLATES_DIR = os.path.join(HERE, 'templates') -CASES_DIR = os.path.join(HERE, 'cases') +CASES = os.path.join(HERE, 'cases', 'master.yml') def find_templates(starting_directory): for directory, subdirectories, file_names in os.walk(starting_directory): @@ -17,27 +17,31 @@ def find_templates(starting_directory): continue yield file_name, os.path.join(directory, file_name) +# template_name | case_name | test_name +# --------------------|------------|---------- +# template.html | case | template-case.html +# template.html | case.sub | template-case.sub.html +# template.https.html | case | template-case.https.html +# template.sub.html | case.https | template-case.https.sub.html def test_name(template_name, case_name): prefix, suffix = template_name.split('.', 1) return '{}-{}.{}'.format(prefix, case_name, suffix) -def main(templates_directory, cases_directory, out_directory): +def main(templates_directory, cases_file, out_directory): for template_name, path in find_templates(templates_directory): with open(path, 'r') as handle: template = Template(handle.read(), variable_start_string='[%', variable_end_string='%]') - case_path = path.replace(templates_directory, cases_directory) + '.yml' - - with open(case_path, 'r') as handle: + with open(cases_file, 'r') as handle: cases = yaml.safe_load(handle.read()) - for case_name in cases: + for case in cases: out_file_name = os.path.join( - out_directory, test_name(template_name, case_name) + out_directory, test_name(template_name, case['file_name_part']) ) with open(out_file_name, 'w') as handle: - handle.write(template.render(**cases[case_name])) + handle.write(template.render(**case)) if __name__ == '__main__': - main(TEMPLATES_DIR, CASES_DIR, OUT_DIR) + main(TEMPLATES_DIR, CASES, OUT_DIR) diff --git a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html index 968511c10a75cd..955f91930bf0e3 100644 --- a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html +++ b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html @@ -5,10 +5,6 @@ [%title%] - - {%- for script in scripts %} - - {%- endfor %} diff --git a/fetch/metadata/tools/templates/form-submission.sub.html b/fetch/metadata/tools/templates/form-submission.sub.html index 3b14138b2f97f3..f88400f82f1ddf 100644 --- a/fetch/metadata/tools/templates/form-submission.sub.html +++ b/fetch/metadata/tools/templates/form-submission.sub.html @@ -5,7 +5,6 @@ [%title%] - {%- for script in scripts %} {%- endfor %} @@ -17,8 +16,8 @@ const win = window.open(); const inputs = [ ['key', key], - ['body', ` diff --git a/fetch/metadata/tools/templates/image.sub.html b/fetch/metadata/tools/templates/image.sub.html index 54ccf9a86c86b5..a1cb2fface3cd5 100644 --- a/fetch/metadata/tools/templates/image.sub.html +++ b/fetch/metadata/tools/templates/image.sub.html @@ -5,10 +5,6 @@ [%title%] - - {%- for script in scripts %} - - {%- endfor %} diff --git a/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html b/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html index 8b39afc1ab4efb..11e953257a8f2d 100644 --- a/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html +++ b/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html @@ -6,20 +6,25 @@ - - diff --git a/fetch/metadata/tools/templates/js-module-via-script.sub.html b/fetch/metadata/tools/templates/js-module-via-script.sub.html index 1efef7d35f5ca4..aebb7518d69009 100644 --- a/fetch/metadata/tools/templates/js-module-via-script.sub.html +++ b/fetch/metadata/tools/templates/js-module-via-script.sub.html @@ -5,16 +5,39 @@ - diff --git a/fetch/metadata/tools/templates/js-module-via-static-import.sub.html b/fetch/metadata/tools/templates/js-module-via-static-import.sub.html index b4df960250835c..13d9c8ae8d7556 100644 --- a/fetch/metadata/tools/templates/js-module-via-static-import.sub.html +++ b/fetch/metadata/tools/templates/js-module-via-static-import.sub.html @@ -5,25 +5,45 @@ - - diff --git a/fetch/metadata/tools/templates/video-poster.sub.html b/fetch/metadata/tools/templates/video-poster.sub.html index 71ebefa7acef3b..1e9b3e8d0b31a2 100644 --- a/fetch/metadata/tools/templates/video-poster.sub.html +++ b/fetch/metadata/tools/templates/video-poster.sub.html @@ -8,20 +8,35 @@ From 43eba8ee245640a63d8878e6ba3152cdf9e940ea Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 9 Dec 2019 16:56:54 -0500 Subject: [PATCH 019/127] Improve test titles --- .../appcache-manifest-sec-fetch-mode-redirect.sub.https.html | 2 +- ...ache-manifest-sec-fetch-site-redirect.https.sub.https.html | 2 +- .../form-submission-sec-fetch-mode-redirect.sub.html | 2 +- .../form-submission-sec-fetch-site-redirect.https.sub.html | 2 +- .../metadata/generated/image-sec-fetch-mode-redirect.sub.html | 2 +- .../generated/image-sec-fetch-site-redirect.https.sub.html | 2 +- .../js-module-via-script-sec-fetch-mode-redirect.sub.html | 1 + ...s-module-via-script-sec-fetch-site-redirect.https.sub.html | 1 + ...-module-via-static-import-sec-fetch-mode-redirect.sub.html | 1 + ...e-via-static-import-sec-fetch-site-redirect.https.sub.html | 1 + .../generated/video-poster-sec-fetch-mode-redirect.sub.html | 1 + .../video-poster-sec-fetch-site-redirect.https.sub.html | 1 + fetch/metadata/tools/cases/master.yml | 4 ++-- fetch/metadata/tools/templates/js-module-via-script.sub.html | 1 + .../tools/templates/js-module-via-static-import.sub.html | 1 + fetch/metadata/tools/templates/video-poster.sub.html | 1 + 16 files changed, 17 insertions(+), 8 deletions(-) diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode-redirect.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode-redirect.sub.https.html index 16d4e6b0329190..931576b1802732 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode-redirect.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode-redirect.sub.https.html @@ -2,7 +2,7 @@ - Fetch Metadata - redirection + Fetch Metadata - Sec-Fetch-Mode - redirection diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site-redirect.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site-redirect.https.sub.https.html index 035e18521ab9b0..f66f56529463fb 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site-redirect.https.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site-redirect.https.sub.https.html @@ -2,7 +2,7 @@ - Fetch Metadata - redirection + Fetch Metadata - Sec-Fetch-Site - redirection diff --git a/fetch/metadata/generated/form-submission-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-mode-redirect.sub.html index 6022d932551a04..b9e682ea63aea2 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-mode-redirect.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-mode-redirect.sub.html @@ -2,7 +2,7 @@ - Fetch Metadata - redirection + Fetch Metadata - Sec-Fetch-Mode - redirection diff --git a/fetch/metadata/generated/form-submission-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-site-redirect.https.sub.html index 2769179b89df8c..496739e7b86959 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-site-redirect.https.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-site-redirect.https.sub.html @@ -2,7 +2,7 @@ - Fetch Metadata - redirection + Fetch Metadata - Sec-Fetch-Site - redirection diff --git a/fetch/metadata/generated/image-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/image-sec-fetch-mode-redirect.sub.html index f73acae31aa49b..6b34152656c988 100644 --- a/fetch/metadata/generated/image-sec-fetch-mode-redirect.sub.html +++ b/fetch/metadata/generated/image-sec-fetch-mode-redirect.sub.html @@ -2,7 +2,7 @@ - Fetch Metadata - redirection + Fetch Metadata - Sec-Fetch-Mode - redirection diff --git a/fetch/metadata/generated/image-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/image-sec-fetch-site-redirect.https.sub.html index d4cf6de3165abb..d2b17eaa478bae 100644 --- a/fetch/metadata/generated/image-sec-fetch-site-redirect.https.sub.html +++ b/fetch/metadata/generated/image-sec-fetch-site-redirect.https.sub.html @@ -2,7 +2,7 @@ - Fetch Metadata - redirection + Fetch Metadata - Sec-Fetch-Site - redirection diff --git a/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-redirect.sub.html index 3ddfad375134cb..8a522c47f27c93 100644 --- a/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-redirect.sub.html +++ b/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-redirect.sub.html @@ -2,6 +2,7 @@ + Fetch Metadata - Sec-Fetch-Mode - redirection diff --git a/fetch/metadata/generated/js-module-via-script-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/js-module-via-script-sec-fetch-site-redirect.https.sub.html index f718a1d9315775..d5b57a2075738d 100644 --- a/fetch/metadata/generated/js-module-via-script-sec-fetch-site-redirect.https.sub.html +++ b/fetch/metadata/generated/js-module-via-script-sec-fetch-site-redirect.https.sub.html @@ -2,6 +2,7 @@ + Fetch Metadata - Sec-Fetch-Site - redirection diff --git a/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-redirect.sub.html index 39b86fbc7e0a48..c286743247f116 100644 --- a/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-redirect.sub.html +++ b/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-redirect.sub.html @@ -2,6 +2,7 @@ + Fetch Metadata - Sec-Fetch-Mode - redirection diff --git a/fetch/metadata/generated/js-module-via-static-import-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/js-module-via-static-import-sec-fetch-site-redirect.https.sub.html index 543740c2be48ef..c87d54f831d44f 100644 --- a/fetch/metadata/generated/js-module-via-static-import-sec-fetch-site-redirect.https.sub.html +++ b/fetch/metadata/generated/js-module-via-static-import-sec-fetch-site-redirect.https.sub.html @@ -2,6 +2,7 @@ + Fetch Metadata - Sec-Fetch-Site - redirection diff --git a/fetch/metadata/generated/video-poster-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-mode-redirect.sub.html index ef8ee7127b7887..051ee592d4144f 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-mode-redirect.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-mode-redirect.sub.html @@ -2,6 +2,7 @@ + Fetch Metadata - Sec-Fetch-Mode - redirection diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site-redirect.https.sub.html index e717941a6972af..d6ba662c9cf302 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-site-redirect.https.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-site-redirect.https.sub.html @@ -2,6 +2,7 @@ + Fetch Metadata - Sec-Fetch-Site - redirection diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 2482b20bf80a6d..728b25f4c5730b 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -1,7 +1,7 @@ --- - templates: '*' file_name_part: sec-fetch-site-redirect.https - title: Fetch Metadata - redirection + title: Fetch Metadata - Sec-Fetch-Site - redirection headerName: sec-fetch-site requests: - description: Cross-Site -> Same-Origin @@ -38,7 +38,7 @@ - templates: '*' file_name_part: sec-fetch-mode-redirect - title: Fetch Metadata - redirection + title: Fetch Metadata - Sec-Fetch-Mode - redirection headerName: sec-fetch-mode requests: - description: Cross-Site -> Same-Origin diff --git a/fetch/metadata/tools/templates/js-module-via-script.sub.html b/fetch/metadata/tools/templates/js-module-via-script.sub.html index aebb7518d69009..01dbf34d8b0740 100644 --- a/fetch/metadata/tools/templates/js-module-via-script.sub.html +++ b/fetch/metadata/tools/templates/js-module-via-script.sub.html @@ -2,6 +2,7 @@ + [%title%] diff --git a/fetch/metadata/tools/templates/js-module-via-static-import.sub.html b/fetch/metadata/tools/templates/js-module-via-static-import.sub.html index 13d9c8ae8d7556..cc3d1ab3a07962 100644 --- a/fetch/metadata/tools/templates/js-module-via-static-import.sub.html +++ b/fetch/metadata/tools/templates/js-module-via-static-import.sub.html @@ -2,6 +2,7 @@ + [%title%] diff --git a/fetch/metadata/tools/templates/video-poster.sub.html b/fetch/metadata/tools/templates/video-poster.sub.html index 1e9b3e8d0b31a2..c0c45f0cc37898 100644 --- a/fetch/metadata/tools/templates/video-poster.sub.html +++ b/fetch/metadata/tools/templates/video-poster.sub.html @@ -2,6 +2,7 @@ + [%title%] From 431c69dac5292dff1cc7cec921a721a54b72cdf9 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 9 Dec 2019 17:44:58 -0500 Subject: [PATCH 020/127] Split form submission --- ...form-get-sec-fetch-mode-redirect.sub.html} | 40 +++---- ...et-sec-fetch-site-redirect.https.sub.html} | 40 +++---- ...form-post-sec-fetch-mode-redirect.sub.html | 104 ++++++++++++++++++ ...ost-sec-fetch-site-redirect.https.sub.html | 104 ++++++++++++++++++ ...-submission.sub.html => form-get.sub.html} | 12 +- .../tools/templates/form-post.sub.html | 66 +++++++++++ 6 files changed, 313 insertions(+), 53 deletions(-) rename fetch/metadata/generated/{form-submission-sec-fetch-mode-redirect.sub.html => form-get-sec-fetch-mode-redirect.sub.html} (59%) rename fetch/metadata/generated/{form-submission-sec-fetch-site-redirect.https.sub.html => form-get-sec-fetch-site-redirect.https.sub.html} (59%) create mode 100644 fetch/metadata/generated/form-post-sec-fetch-mode-redirect.sub.html create mode 100644 fetch/metadata/generated/form-post-sec-fetch-site-redirect.https.sub.html rename fetch/metadata/tools/templates/{form-submission.sub.html => form-get.sub.html} (82%) create mode 100644 fetch/metadata/tools/templates/form-post.sub.html diff --git a/fetch/metadata/generated/form-submission-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/form-get-sec-fetch-mode-redirect.sub.html similarity index 59% rename from fetch/metadata/generated/form-submission-sec-fetch-mode-redirect.sub.html rename to fetch/metadata/generated/form-get-sec-fetch-mode-redirect.sub.html index b9e682ea63aea2..d8c6e1bfb7b2cb 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-mode-redirect.sub.html +++ b/fetch/metadata/generated/form-get-sec-fetch-mode-redirect.sub.html @@ -9,10 +9,9 @@ + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/form-post-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/form-post-sec-fetch-site-redirect.https.sub.html new file mode 100644 index 00000000000000..02fa8f5231b84d --- /dev/null +++ b/fetch/metadata/generated/form-post-sec-fetch-site-redirect.https.sub.html @@ -0,0 +1,104 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/templates/form-submission.sub.html b/fetch/metadata/tools/templates/form-get.sub.html similarity index 82% rename from fetch/metadata/tools/templates/form-submission.sub.html rename to fetch/metadata/tools/templates/form-get.sub.html index f88400f82f1ddf..b34672f4a5b19e 100644 --- a/fetch/metadata/tools/templates/form-submission.sub.html +++ b/fetch/metadata/tools/templates/form-get.sub.html @@ -12,10 +12,9 @@ + + {%- for script in scripts %} + + {%- endfor %} + + + + From dada5a7b0fb0bf64fecd10264fa80dd4b6e4b12b Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 9 Dec 2019 18:32:20 -0500 Subject: [PATCH 021/127] Support POST redirection --- fetch/api/resources/redirect.py | 2 ++ .../generated/form-post-sec-fetch-mode-redirect.sub.html | 1 + .../form-post-sec-fetch-site-redirect.https.sub.html | 1 + fetch/metadata/resources/record-headers.py | 6 +++--- fetch/metadata/tools/templates/form-post.sub.html | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fetch/api/resources/redirect.py b/fetch/api/resources/redirect.py index eb5c98dd52ff8b..1f392eeeff0f19 100644 --- a/fetch/api/resources/redirect.py +++ b/fetch/api/resources/redirect.py @@ -33,6 +33,8 @@ def main(request, response): if "redirect_status" in request.GET: status = int(request.GET['redirect_status']) + elif "redirect_status" in request.POST: + status = int(request.POST['redirect_status']) stashed_data['count'] += 1 diff --git a/fetch/metadata/generated/form-post-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/form-post-sec-fetch-mode-redirect.sub.html index 8fb8ba507d3e9d..0f6e60fb9861a0 100644 --- a/fetch/metadata/generated/form-post-sec-fetch-mode-redirect.sub.html +++ b/fetch/metadata/generated/form-post-sec-fetch-mode-redirect.sub.html @@ -12,6 +12,7 @@ function induceRequest(path) { const win = window.open(); const inputs = [ + ['redirect_status', '307'], ['body', ` @@ -48,7 +48,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'navigate'); }); }, 'sec-fetch-mode - Cross-Site -> Same-Origin'); @@ -60,7 +60,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'navigate'); }); }, 'sec-fetch-mode - Cross-Site -> Same-Site'); @@ -72,7 +72,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'navigate'); }); }, 'sec-fetch-mode - Cross-Site -> Cross-Site'); @@ -84,7 +84,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'navigate'); }); }, 'sec-fetch-mode - Same-Origin -> Cross-Site -> Same-Origin'); @@ -96,7 +96,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'navigate'); }); }, 'sec-fetch-mode - HTTPS downgrade-upgrade'); diff --git a/fetch/metadata/generated/form-post-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/form-post-sec-fetch-mode-navigate-redirect.sub.html similarity index 91% rename from fetch/metadata/generated/form-post-sec-fetch-mode-redirect.sub.html rename to fetch/metadata/generated/form-post-sec-fetch-mode-navigate-redirect.sub.html index 0f6e60fb9861a0..8505055ce836d7 100644 --- a/fetch/metadata/generated/form-post-sec-fetch-mode-redirect.sub.html +++ b/fetch/metadata/generated/form-post-sec-fetch-mode-navigate-redirect.sub.html @@ -2,7 +2,7 @@ - Fetch Metadata - Sec-Fetch-Mode - redirection + Fetch Metadata - Sec-Fetch-Mode - navigation redirection @@ -49,7 +49,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'navigate'); }); }, 'sec-fetch-mode - Cross-Site -> Same-Origin'); @@ -61,7 +61,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'navigate'); }); }, 'sec-fetch-mode - Cross-Site -> Same-Site'); @@ -73,7 +73,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'navigate'); }); }, 'sec-fetch-mode - Cross-Site -> Cross-Site'); @@ -85,7 +85,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'navigate'); }); }, 'sec-fetch-mode - Same-Origin -> Cross-Site -> Same-Origin'); @@ -97,7 +97,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'navigate'); }); }, 'sec-fetch-mode - HTTPS downgrade-upgrade'); diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 736082f8b0c040..5eed118cc30c87 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -32,7 +32,13 @@ https://{{host}}:{{ports[https][0]}}" expected: cross-site -- templates: '*' +- templates: + - appcache-manifest.sub.https.html + - image.sub.html + - js-module-via-dynamic-import.sub.html + - js-module-via-script.sub.html + - js-module-via-static-import.sub.html + - video-poster.sub.html file_name_part: sec-fetch-mode-redirect title: Fetch Metadata - Sec-Fetch-Mode - redirection headerName: sec-fetch-mode @@ -64,3 +70,38 @@ http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=\ https://{{host}}:{{ports[https][0]}}" expected: no-cors + +- templates: + - form-post.sub.html + - form-get.sub.html + file_name_part: sec-fetch-mode-navigate-redirect + title: Fetch Metadata - Sec-Fetch-Mode - navigation redirection + headerName: sec-fetch-mode + requests: + - description: Cross-Site -> Same-Origin + pathPrefix: "\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: navigate + - description: Cross-Site -> Same-Site + pathPrefix: "\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{domains[www]}}:{{ports[https][0]}}" + expected: navigate + - description: Cross-Site -> Cross-Site + pathPrefix: "\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{hosts[alt][]}}:{{ports[https][0]}}" + expected: navigate + - description: Same-Origin -> Cross-Site -> Same-Origin + pathPrefix: "\ + https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: navigate + - description: HTTPS downgrade-upgrade + pathPrefix: "\ + https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: navigate diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index c7fed13d6398b0..27cddf7217d89c 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -36,6 +36,10 @@ def main(templates_directory, cases_file, out_directory): cases = yaml.safe_load(handle.read()) for case in cases: + + if template_name not in case['templates'] and case['templates'] != '*': + continue + out_file_name = os.path.join( out_directory, test_name(template_name, case['file_name_part']) ) From a1c42d115084b8d41c735e6f5289cd9e1eadbffc Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 9 Dec 2019 18:54:25 -0500 Subject: [PATCH 024/127] Further segment tests for Sec-Fetch-Mode --- ...t-sec-fetch-mode-module-redirect.sub.html} | 10 ++--- ...t-sec-fetch-mode-module-redirect.sub.html} | 12 +++--- fetch/metadata/tools/cases/master.yml | 37 ++++++++++++++++++- 3 files changed, 46 insertions(+), 13 deletions(-) rename fetch/metadata/generated/{js-module-via-dynamic-import-sec-fetch-mode-redirect.sub.html => js-module-via-dynamic-import-sec-fetch-mode-module-redirect.sub.html} (91%) rename fetch/metadata/generated/{js-module-via-static-import-sec-fetch-mode-redirect.sub.html => js-module-via-static-import-sec-fetch-mode-module-redirect.sub.html} (91%) diff --git a/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-module-redirect.sub.html similarity index 91% rename from fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-redirect.sub.html rename to fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-module-redirect.sub.html index 1fec5a1ab4082c..2747d0e2c894d5 100644 --- a/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-redirect.sub.html +++ b/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-module-redirect.sub.html @@ -16,7 +16,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'cors'); }); }, 'sec-fetch-mode - Cross-Site -> Same-Origin'); @@ -28,7 +28,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'cors'); }); }, 'sec-fetch-mode - Cross-Site -> Same-Site'); @@ -40,7 +40,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'cors'); }); }, 'sec-fetch-mode - Cross-Site -> Cross-Site'); @@ -52,7 +52,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'cors'); }); }, 'sec-fetch-mode - Same-Origin -> Cross-Site -> Same-Origin'); @@ -64,7 +64,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'cors'); }); }, 'sec-fetch-mode - HTTPS downgrade-upgrade'); diff --git a/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-module-redirect.sub.html similarity index 91% rename from fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-redirect.sub.html rename to fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-module-redirect.sub.html index c286743247f116..ce6e068b7e7873 100644 --- a/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-redirect.sub.html +++ b/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-module-redirect.sub.html @@ -2,7 +2,7 @@ - Fetch Metadata - Sec-Fetch-Mode - redirection + Fetch Metadata - Sec-Fetch-Mode - module redirection @@ -36,7 +36,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'cors'); }); }, 'sec-fetch-mode - Cross-Site -> Same-Origin'); @@ -51,7 +51,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'cors'); }); }, 'sec-fetch-mode - Cross-Site -> Same-Site'); @@ -66,7 +66,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'cors'); }); }, 'sec-fetch-mode - Cross-Site -> Cross-Site'); @@ -81,7 +81,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'cors'); }); }, 'sec-fetch-mode - Same-Origin -> Cross-Site -> Same-Origin'); @@ -96,7 +96,7 @@ .then((text) => JSON.parse(text)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], 'no-cors'); + assert_equals(headers['sec-fetch-mode'], 'cors'); }); }, 'sec-fetch-mode - HTTPS downgrade-upgrade'); diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 5eed118cc30c87..4426315a755166 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -35,9 +35,7 @@ - templates: - appcache-manifest.sub.https.html - image.sub.html - - js-module-via-dynamic-import.sub.html - js-module-via-script.sub.html - - js-module-via-static-import.sub.html - video-poster.sub.html file_name_part: sec-fetch-mode-redirect title: Fetch Metadata - Sec-Fetch-Mode - redirection @@ -71,6 +69,41 @@ https://{{host}}:{{ports[https][0]}}" expected: no-cors +- templates: + - js-module-via-dynamic-import.sub.html + - js-module-via-static-import.sub.html + file_name_part: sec-fetch-mode-module-redirect + title: Fetch Metadata - Sec-Fetch-Mode - module redirection + headerName: sec-fetch-mode + requests: + - description: Cross-Site -> Same-Origin + pathPrefix: "\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: cors + - description: Cross-Site -> Same-Site + pathPrefix: "\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{domains[www]}}:{{ports[https][0]}}" + expected: cors + - description: Cross-Site -> Cross-Site + pathPrefix: "\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{hosts[alt][]}}:{{ports[https][0]}}" + expected: cors + - description: Same-Origin -> Cross-Site -> Same-Origin + pathPrefix: "\ + https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: cors + - description: HTTPS downgrade-upgrade + pathPrefix: "\ + https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: cors + - templates: - form-post.sub.html - form-get.sub.html From 74df861fa92fde2fe052569db29f33f669a0e671 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 9 Dec 2019 19:33:20 -0500 Subject: [PATCH 025/127] Make "mode" tests more targetted --- ...import-sec-fetch-mode-cors-script.sub.html | 59 ++++++++++++ ...script-sec-fetch-mode-cors-script.sub.html | 89 +++++++++++++++++++ ...ia-script-sec-fetch-mode-redirect.sub.html | 85 ------------------ ...ipt-sec-fetch-site-redirect.https.sub.html | 85 ------------------ ...import-sec-fetch-mode-cors-script.sub.html | 88 ++++++++++++++++++ fetch/metadata/tools/cases/master.yml | 40 ++++----- .../templates/js-module-via-script.sub.html | 11 ++- 7 files changed, 260 insertions(+), 197 deletions(-) create mode 100644 fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-cors-script.sub.html create mode 100644 fetch/metadata/generated/js-module-via-script-sec-fetch-mode-cors-script.sub.html delete mode 100644 fetch/metadata/generated/js-module-via-script-sec-fetch-mode-redirect.sub.html delete mode 100644 fetch/metadata/generated/js-module-via-script-sec-fetch-site-redirect.https.sub.html create mode 100644 fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-cors-script.sub.html diff --git a/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-cors-script.sub.html b/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-cors-script.sub.html new file mode 100644 index 00000000000000..a03b8ed4a646f0 --- /dev/null +++ b/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-cors-script.sub.html @@ -0,0 +1,59 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-cors-script.sub.html b/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-cors-script.sub.html new file mode 100644 index 00000000000000..7b51ca40c2ce76 --- /dev/null +++ b/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-cors-script.sub.html @@ -0,0 +1,89 @@ + + + + + Fetch Metadata - Sec-Fetch-Mode - scripts + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-redirect.sub.html deleted file mode 100644 index 8a522c47f27c93..00000000000000 --- a/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-redirect.sub.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - redirection - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-script-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/js-module-via-script-sec-fetch-site-redirect.https.sub.html deleted file mode 100644 index d5b57a2075738d..00000000000000 --- a/fetch/metadata/generated/js-module-via-script-sec-fetch-site-redirect.https.sub.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Site - redirection - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-cors-script.sub.html b/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-cors-script.sub.html new file mode 100644 index 00000000000000..0bd87929a458e3 --- /dev/null +++ b/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-cors-script.sub.html @@ -0,0 +1,88 @@ + + + + + Fetch Metadata - Sec-Fetch-Mode - scripts + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 4426315a755166..8a0826c2fc156a 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -72,36 +72,26 @@ - templates: - js-module-via-dynamic-import.sub.html - js-module-via-static-import.sub.html - file_name_part: sec-fetch-mode-module-redirect - title: Fetch Metadata - Sec-Fetch-Mode - module redirection + - js-module-via-script.sub.html + file_name_part: sec-fetch-mode-cors-script + title: Fetch Metadata - Sec-Fetch-Mode - scripts headerName: sec-fetch-mode requests: - - description: Cross-Site -> Same-Origin - pathPrefix: "\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{host}}:{{ports[https][0]}}" - expected: cors - - description: Cross-Site -> Same-Site - pathPrefix: "\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{domains[www]}}:{{ports[https][0]}}" + - description: No attributes + elementAttrs: + crossorigin: '' expected: cors - - description: Cross-Site -> Cross-Site - pathPrefix: "\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{hosts[alt][]}}:{{ports[https][0]}}" + - description: crossorigin="" + elementAttrs: + crossorigin: '' expected: cors - - description: Same-Origin -> Cross-Site -> Same-Origin - pathPrefix: "\ - https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{host}}:{{ports[https][0]}}" + - description: crossorigin="anonymous" + elementAttrs: + crossorigin: anonymous expected: cors - - description: HTTPS downgrade-upgrade - pathPrefix: "\ - https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{host}}:{{ports[https][0]}}" + - description: crossorigin="use-credentials" + elementAttrs: + crossorigin: use-credentials expected: cors - templates: diff --git a/fetch/metadata/tools/templates/js-module-via-script.sub.html b/fetch/metadata/tools/templates/js-module-via-script.sub.html index 01dbf34d8b0740..eb3de44663dc24 100644 --- a/fetch/metadata/tools/templates/js-module-via-script.sub.html +++ b/fetch/metadata/tools/templates/js-module-via-script.sub.html @@ -10,10 +10,14 @@ - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-module-redirect.sub.html b/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-module-redirect.sub.html deleted file mode 100644 index 2747d0e2c894d5..00000000000000 --- a/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-mode-module-redirect.sub.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-cors-script.sub.html b/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-cors-script.sub.html deleted file mode 100644 index 7b51ca40c2ce76..00000000000000 --- a/fetch/metadata/generated/js-module-via-script-sec-fetch-mode-cors-script.sub.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - scripts - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-cors-script.sub.html b/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-cors-script.sub.html deleted file mode 100644 index 0bd87929a458e3..00000000000000 --- a/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-cors-script.sub.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - scripts - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-module-redirect.sub.html b/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-module-redirect.sub.html deleted file mode 100644 index ce6e068b7e7873..00000000000000 --- a/fetch/metadata/generated/js-module-via-static-import-sec-fetch-mode-module-redirect.sub.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - module redirection - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site-redirect.https.sub.html similarity index 100% rename from fetch/metadata/generated/js-module-via-dynamic-import-sec-fetch-site-redirect.https.sub.html rename to fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site-redirect.https.sub.html diff --git a/fetch/metadata/generated/js-module-via-static-import-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-site-redirect.https.sub.html similarity index 100% rename from fetch/metadata/generated/js-module-via-static-import-sec-fetch-site-redirect.https.sub.html rename to fetch/metadata/generated/script-module-import-static-sec-fetch-site-redirect.https.sub.html diff --git a/fetch/metadata/generated/script-module-script-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/script-module-script-sec-fetch-site-redirect.https.sub.html new file mode 100644 index 00000000000000..f116c9d64d34d8 --- /dev/null +++ b/fetch/metadata/generated/script-module-script-sec-fetch-site-redirect.https.sub.html @@ -0,0 +1,104 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 8a0826c2fc156a..345aa38d3fda34 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -70,9 +70,9 @@ expected: no-cors - templates: - - js-module-via-dynamic-import.sub.html - - js-module-via-static-import.sub.html - - js-module-via-script.sub.html + - script-module-via-import-dynamic.sub.html + - script-module-via-import-static.sub.html + - script-module-via-script.sub.html file_name_part: sec-fetch-mode-cors-script title: Fetch Metadata - Sec-Fetch-Mode - scripts headerName: sec-fetch-mode diff --git a/fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html b/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html similarity index 100% rename from fetch/metadata/tools/templates/js-module-via-dynamic-import.sub.html rename to fetch/metadata/tools/templates/script-module-import-dynamic.sub.html diff --git a/fetch/metadata/tools/templates/js-module-via-static-import.sub.html b/fetch/metadata/tools/templates/script-module-import-static.sub.html similarity index 100% rename from fetch/metadata/tools/templates/js-module-via-static-import.sub.html rename to fetch/metadata/tools/templates/script-module-import-static.sub.html diff --git a/fetch/metadata/tools/templates/js-module-via-script.sub.html b/fetch/metadata/tools/templates/script-module-script.sub.html similarity index 100% rename from fetch/metadata/tools/templates/js-module-via-script.sub.html rename to fetch/metadata/tools/templates/script-module-script.sub.html From befda2824786aefb8da80308a7d60e2166af8ea6 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 9 Dec 2019 19:57:27 -0500 Subject: [PATCH 027/127] Refine further --- ...fest-sec-fetch-mode-no-cors.sub.https.html | 52 +++++++++ ...est-sec-fetch-mode-redirect.sub.https.html | 100 ------------------ .../image-sec-fetch-mode-no-cors.sub.html | 33 ++++++ .../image-sec-fetch-mode-redirect.sub.html | 81 -------------- ...ec-fetch-mode-cors-script-element.sub.html | 89 ++++++++++++++++ ...pt-element-sec-fetch-mode-no-cors.sub.html | 44 ++++++++ ...nt-sec-fetch-site-redirect.https.sub.html} | 2 +- ...deo-poster-sec-fetch-mode-no-cors.sub.html | 35 ++++++ ...eo-poster-sec-fetch-mode-redirect.sub.html | 87 --------------- fetch/metadata/tools/cases/master.yml | 58 ++++------ ...cript.sub.html => script-element.sub.html} | 2 +- 11 files changed, 275 insertions(+), 308 deletions(-) create mode 100644 fetch/metadata/generated/appcache-manifest-sec-fetch-mode-no-cors.sub.https.html delete mode 100644 fetch/metadata/generated/appcache-manifest-sec-fetch-mode-redirect.sub.https.html create mode 100644 fetch/metadata/generated/image-sec-fetch-mode-no-cors.sub.html delete mode 100644 fetch/metadata/generated/image-sec-fetch-mode-redirect.sub.html create mode 100644 fetch/metadata/generated/script-element-sec-fetch-mode-cors-script-element.sub.html create mode 100644 fetch/metadata/generated/script-element-sec-fetch-mode-no-cors.sub.html rename fetch/metadata/generated/{script-module-script-sec-fetch-site-redirect.https.sub.html => script-element-sec-fetch-site-redirect.https.sub.html} (98%) create mode 100644 fetch/metadata/generated/video-poster-sec-fetch-mode-no-cors.sub.html delete mode 100644 fetch/metadata/generated/video-poster-sec-fetch-mode-redirect.sub.html rename fetch/metadata/tools/templates/{script-module-script.sub.html => script-element.sub.html} (96%) diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode-no-cors.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode-no-cors.sub.https.html new file mode 100644 index 00000000000000..ebfee887212cc2 --- /dev/null +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode-no-cors.sub.https.html @@ -0,0 +1,52 @@ + + + + + Fetch Metadata - Sec-Fetch-Mode + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode-redirect.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode-redirect.sub.https.html deleted file mode 100644 index 931576b1802732..00000000000000 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode-redirect.sub.https.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - redirection - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/image-sec-fetch-mode-no-cors.sub.html b/fetch/metadata/generated/image-sec-fetch-mode-no-cors.sub.html new file mode 100644 index 00000000000000..634c7eda71dd18 --- /dev/null +++ b/fetch/metadata/generated/image-sec-fetch-mode-no-cors.sub.html @@ -0,0 +1,33 @@ + + + + + Fetch Metadata - Sec-Fetch-Mode + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/image-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/image-sec-fetch-mode-redirect.sub.html deleted file mode 100644 index 6b34152656c988..00000000000000 --- a/fetch/metadata/generated/image-sec-fetch-mode-redirect.sub.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - redirection - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/script-element-sec-fetch-mode-cors-script-element.sub.html b/fetch/metadata/generated/script-element-sec-fetch-mode-cors-script-element.sub.html new file mode 100644 index 00000000000000..9ad19750fc31a5 --- /dev/null +++ b/fetch/metadata/generated/script-element-sec-fetch-mode-cors-script-element.sub.html @@ -0,0 +1,89 @@ + + + + + Fetch Metadata - Sec-Fetch-Mode - scripts via element + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/script-element-sec-fetch-mode-no-cors.sub.html b/fetch/metadata/generated/script-element-sec-fetch-mode-no-cors.sub.html new file mode 100644 index 00000000000000..6f4427768d6692 --- /dev/null +++ b/fetch/metadata/generated/script-element-sec-fetch-mode-no-cors.sub.html @@ -0,0 +1,44 @@ + + + + + Fetch Metadata - Sec-Fetch-Mode + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-script-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/script-element-sec-fetch-site-redirect.https.sub.html similarity index 98% rename from fetch/metadata/generated/script-module-script-sec-fetch-site-redirect.https.sub.html rename to fetch/metadata/generated/script-element-sec-fetch-site-redirect.https.sub.html index f116c9d64d34d8..179907a0420354 100644 --- a/fetch/metadata/generated/script-module-script-sec-fetch-site-redirect.https.sub.html +++ b/fetch/metadata/generated/script-element-sec-fetch-site-redirect.https.sub.html @@ -14,7 +14,7 @@ const script = document.createElement('script'); script.setAttribute('src', path); - for (const { name, value } of Object.entries(attributes)) { + for (const [ name, value ] of Object.entries(attributes)) { script.setAttribute(name, value); } diff --git a/fetch/metadata/generated/video-poster-sec-fetch-mode-no-cors.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-mode-no-cors.sub.html new file mode 100644 index 00000000000000..dd6d25e5693174 --- /dev/null +++ b/fetch/metadata/generated/video-poster-sec-fetch-mode-no-cors.sub.html @@ -0,0 +1,35 @@ + + + + + Fetch Metadata - Sec-Fetch-Mode + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-mode-redirect.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-mode-redirect.sub.html deleted file mode 100644 index 051ee592d4144f..00000000000000 --- a/fetch/metadata/generated/video-poster-sec-fetch-mode-redirect.sub.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - redirection - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 345aa38d3fda34..95c8efb81abd88 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -35,61 +35,43 @@ - templates: - appcache-manifest.sub.https.html - image.sub.html - - js-module-via-script.sub.html + - script-element.sub.html - video-poster.sub.html - file_name_part: sec-fetch-mode-redirect - title: Fetch Metadata - Sec-Fetch-Mode - redirection + file_name_part: sec-fetch-mode-no-cors + title: Fetch Metadata - Sec-Fetch-Mode headerName: sec-fetch-mode requests: - - description: Cross-Site -> Same-Origin - pathPrefix: "\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{host}}:{{ports[https][0]}}" - expected: no-cors - - description: Cross-Site -> Same-Site - pathPrefix: "\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{domains[www]}}:{{ports[https][0]}}" - expected: no-cors - - description: Cross-Site -> Cross-Site - pathPrefix: "\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{hosts[alt][]}}:{{ports[https][0]}}" - expected: no-cors - - description: Same-Origin -> Cross-Site -> Same-Origin - pathPrefix: "\ - https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{host}}:{{ports[https][0]}}" - expected: no-cors - - description: HTTPS downgrade-upgrade - pathPrefix: "\ - https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{host}}:{{ports[https][0]}}" - expected: no-cors + - expected: no-cors - templates: - script-module-via-import-dynamic.sub.html - script-module-via-import-static.sub.html - - script-module-via-script.sub.html - file_name_part: sec-fetch-mode-cors-script - title: Fetch Metadata - Sec-Fetch-Mode - scripts + file_name_part: sec-fetch-mode-cors-script-import + title: Fetch Metadata - Sec-Fetch-Mode - scripts via "import" headerName: sec-fetch-mode requests: - - description: No attributes + - description: foobar + expected: cors + +- templates: + - script-element.sub.html + file_name_part: sec-fetch-mode-cors-script-element + title: Fetch Metadata - Sec-Fetch-Mode - scripts via element + headerName: sec-fetch-mode + requests: + - description: module script elementAttrs: - crossorigin: '' + type: module expected: cors - - description: crossorigin="" + - description: classic script, crossorigin="" elementAttrs: crossorigin: '' expected: cors - - description: crossorigin="anonymous" + - description: classic script, crossorigin="anonymous" elementAttrs: crossorigin: anonymous expected: cors - - description: crossorigin="use-credentials" + - description: classic script, crossorigin="use-credentials" elementAttrs: crossorigin: use-credentials expected: cors diff --git a/fetch/metadata/tools/templates/script-module-script.sub.html b/fetch/metadata/tools/templates/script-element.sub.html similarity index 96% rename from fetch/metadata/tools/templates/script-module-script.sub.html rename to fetch/metadata/tools/templates/script-element.sub.html index eb3de44663dc24..6f1726ce372cb4 100644 --- a/fetch/metadata/tools/templates/script-module-script.sub.html +++ b/fetch/metadata/tools/templates/script-element.sub.html @@ -14,7 +14,7 @@ const script = document.createElement('script'); script.setAttribute('src', path); - for (const { name, value } of Object.entries(attributes)) { + for (const [ name, value ] of Object.entries(attributes)) { script.setAttribute(name, value); } From fd4d43105c12e165bde1140aeb3690ec5f8c4467 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 9 Dec 2019 21:45:35 -0500 Subject: [PATCH 028/127] Refactor heavily again --- ...he-manifest-sec-fetch-mode.sub.https.html} | 0 ...he-manifest-sec-fetch-site.sub.https.html} | 0 ...-sec-fetch-mode-navigate-redirect.sub.html | 104 ---------- .../form-get-sec-fetch-mode.sub.html | 56 ++++++ ....html => form-get-sec-fetch-site.sub.html} | 0 ...-sec-fetch-mode-navigate-redirect.sub.html | 105 ---------- .../form-post-sec-fetch-mode.sub.html | 57 ++++++ ...html => form-post-sec-fetch-site.sub.html} | 0 ...sub.html => image-sec-fetch-mode.sub.html} | 0 ...sub.html => image-sec-fetch-site.sub.html} | 0 ...=> script-element-sec-fetch-mode.sub.html} | 25 ++- ...=> script-element-sec-fetch-site.sub.html} | 95 ++++++++- ...ule-import-dynamic-sec-fetch-mode.sub.html | 23 +++ ...le-import-dynamic-sec-fetch-site.sub.html} | 10 +- ...ule-import-static-sec-fetch-mode.sub.html} | 23 ++- ...ule-import-static-sec-fetch-site.sub.html} | 10 +- ...l => video-poster-sec-fetch-mode.sub.html} | 0 ...l => video-poster-sec-fetch-site.sub.html} | 0 fetch/metadata/tools/cases/master.yml | 185 ++++++++---------- fetch/metadata/tools/generate.py | 39 +++- .../appcache-manifest.sub.https.html | 10 +- .../tools/templates/form-get.sub.html | 10 +- .../tools/templates/form-post.sub.html | 10 +- fetch/metadata/tools/templates/image.sub.html | 10 +- .../tools/templates/script-element.sub.html | 14 +- .../script-module-import-dynamic.sub.html | 12 +- .../script-module-import-static.sub.html | 12 +- .../tools/templates/video-poster.sub.html | 10 +- 28 files changed, 412 insertions(+), 408 deletions(-) rename fetch/metadata/generated/{appcache-manifest-sec-fetch-mode-no-cors.sub.https.html => appcache-manifest-sec-fetch-mode.sub.https.html} (100%) rename fetch/metadata/generated/{appcache-manifest-sec-fetch-site-redirect.https.sub.https.html => appcache-manifest-sec-fetch-site.sub.https.html} (100%) delete mode 100644 fetch/metadata/generated/form-get-sec-fetch-mode-navigate-redirect.sub.html create mode 100644 fetch/metadata/generated/form-get-sec-fetch-mode.sub.html rename fetch/metadata/generated/{form-get-sec-fetch-site-redirect.https.sub.html => form-get-sec-fetch-site.sub.html} (100%) delete mode 100644 fetch/metadata/generated/form-post-sec-fetch-mode-navigate-redirect.sub.html create mode 100644 fetch/metadata/generated/form-post-sec-fetch-mode.sub.html rename fetch/metadata/generated/{form-post-sec-fetch-site-redirect.https.sub.html => form-post-sec-fetch-site.sub.html} (100%) rename fetch/metadata/generated/{image-sec-fetch-mode-no-cors.sub.html => image-sec-fetch-mode.sub.html} (100%) rename fetch/metadata/generated/{image-sec-fetch-site-redirect.https.sub.html => image-sec-fetch-site.sub.html} (100%) rename fetch/metadata/generated/{script-element-sec-fetch-mode-cors-script-element.sub.html => script-element-sec-fetch-mode.sub.html} (83%) rename fetch/metadata/generated/{script-element-sec-fetch-site-redirect.https.sub.html => script-element-sec-fetch-site.sub.html} (51%) create mode 100644 fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.sub.html rename fetch/metadata/generated/{script-module-import-dynamic-sec-fetch-site-redirect.https.sub.html => script-module-import-dynamic-sec-fetch-site.sub.html} (98%) rename fetch/metadata/generated/{script-element-sec-fetch-mode-no-cors.sub.html => script-module-import-static-sec-fetch-mode.sub.html} (72%) rename fetch/metadata/generated/{script-module-import-static-sec-fetch-site-redirect.https.sub.html => script-module-import-static-sec-fetch-site.sub.html} (98%) rename fetch/metadata/generated/{video-poster-sec-fetch-mode-no-cors.sub.html => video-poster-sec-fetch-mode.sub.html} (100%) rename fetch/metadata/generated/{video-poster-sec-fetch-site-redirect.https.sub.html => video-poster-sec-fetch-site.sub.html} (100%) diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode-no-cors.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.sub.https.html similarity index 100% rename from fetch/metadata/generated/appcache-manifest-sec-fetch-mode-no-cors.sub.https.html rename to fetch/metadata/generated/appcache-manifest-sec-fetch-mode.sub.https.html diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site-redirect.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html similarity index 100% rename from fetch/metadata/generated/appcache-manifest-sec-fetch-site-redirect.https.sub.https.html rename to fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html diff --git a/fetch/metadata/generated/form-get-sec-fetch-mode-navigate-redirect.sub.html b/fetch/metadata/generated/form-get-sec-fetch-mode-navigate-redirect.sub.html deleted file mode 100644 index d77d63c369ed4f..00000000000000 --- a/fetch/metadata/generated/form-get-sec-fetch-mode-navigate-redirect.sub.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - navigation redirection - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/form-get-sec-fetch-mode.sub.html b/fetch/metadata/generated/form-get-sec-fetch-mode.sub.html new file mode 100644 index 00000000000000..e089455cf22dce --- /dev/null +++ b/fetch/metadata/generated/form-get-sec-fetch-mode.sub.html @@ -0,0 +1,56 @@ + + + + + Fetch Metadata - Sec-Fetch-Mode + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/form-get-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/form-get-sec-fetch-site.sub.html similarity index 100% rename from fetch/metadata/generated/form-get-sec-fetch-site-redirect.https.sub.html rename to fetch/metadata/generated/form-get-sec-fetch-site.sub.html diff --git a/fetch/metadata/generated/form-post-sec-fetch-mode-navigate-redirect.sub.html b/fetch/metadata/generated/form-post-sec-fetch-mode-navigate-redirect.sub.html deleted file mode 100644 index 8505055ce836d7..00000000000000 --- a/fetch/metadata/generated/form-post-sec-fetch-mode-navigate-redirect.sub.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - navigation redirection - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/form-post-sec-fetch-mode.sub.html b/fetch/metadata/generated/form-post-sec-fetch-mode.sub.html new file mode 100644 index 00000000000000..92f98fd1a23df4 --- /dev/null +++ b/fetch/metadata/generated/form-post-sec-fetch-mode.sub.html @@ -0,0 +1,57 @@ + + + + + Fetch Metadata - Sec-Fetch-Mode + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/form-post-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/form-post-sec-fetch-site.sub.html similarity index 100% rename from fetch/metadata/generated/form-post-sec-fetch-site-redirect.https.sub.html rename to fetch/metadata/generated/form-post-sec-fetch-site.sub.html diff --git a/fetch/metadata/generated/image-sec-fetch-mode-no-cors.sub.html b/fetch/metadata/generated/image-sec-fetch-mode.sub.html similarity index 100% rename from fetch/metadata/generated/image-sec-fetch-mode-no-cors.sub.html rename to fetch/metadata/generated/image-sec-fetch-mode.sub.html diff --git a/fetch/metadata/generated/image-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/image-sec-fetch-site.sub.html similarity index 100% rename from fetch/metadata/generated/image-sec-fetch-site-redirect.https.sub.html rename to fetch/metadata/generated/image-sec-fetch-site.sub.html diff --git a/fetch/metadata/generated/script-element-sec-fetch-mode-cors-script-element.sub.html b/fetch/metadata/generated/script-element-sec-fetch-mode.sub.html similarity index 83% rename from fetch/metadata/generated/script-element-sec-fetch-mode-cors-script-element.sub.html rename to fetch/metadata/generated/script-element-sec-fetch-mode.sub.html index 9ad19750fc31a5..c3ecc3d9443da6 100644 --- a/fetch/metadata/generated/script-element-sec-fetch-mode-cors-script-element.sub.html +++ b/fetch/metadata/generated/script-element-sec-fetch-mode.sub.html @@ -2,7 +2,7 @@ - Fetch Metadata - Sec-Fetch-Mode - scripts via element + Fetch Metadata - Sec-Fetch-Mode @@ -26,6 +26,21 @@ .then(() => script.remove()); } + promise_test(() => { + const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; + return induceRequest( + '' + path + '&mime=application/javascript', + {} + ) + .then(() => fetch(path + '&retrieve')) + .then((response) => response.text()) + .then((text) => JSON.parse(text)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'no-cors'); + }); + }, 'sec-fetch-mode - classic script'); + promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; return induceRequest( @@ -38,7 +53,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); - }); + }); }, 'sec-fetch-mode - module script'); promise_test(() => { @@ -53,7 +68,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); - }); + }); }, 'sec-fetch-mode - classic script, crossorigin=""'); promise_test(() => { @@ -68,7 +83,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); - }); + }); }, 'sec-fetch-mode - classic script, crossorigin="anonymous"'); promise_test(() => { @@ -83,7 +98,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); - }); + }); }, 'sec-fetch-mode - classic script, crossorigin="use-credentials"'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-element-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/script-element-sec-fetch-site.sub.html similarity index 51% rename from fetch/metadata/generated/script-element-sec-fetch-site-redirect.https.sub.html rename to fetch/metadata/generated/script-element-sec-fetch-site.sub.html index 179907a0420354..e4f48a155ceb92 100644 --- a/fetch/metadata/generated/script-element-sec-fetch-site-redirect.https.sub.html +++ b/fetch/metadata/generated/script-element-sec-fetch-site.sub.html @@ -38,8 +38,23 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Origin'); + }); + }, 'sec-fetch-site - classic script'); + + promise_test(() => { + const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; + return induceRequest( + 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path + '&mime=application/javascript', + {"type": "module"} + ) + .then(() => fetch(path + '&retrieve')) + .then((response) => response.text()) + .then((text) => JSON.parse(text)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'sec-fetch-site - module script'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -53,8 +68,23 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Site'); + }); + }, 'sec-fetch-site - classic script'); + + promise_test(() => { + const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; + return induceRequest( + 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{domains[www2]}}:{{ports[https][0]}}' + path + '&mime=application/javascript', + {"type": "module"} + ) + .then(() => fetch(path + '&retrieve')) + .then((response) => response.text()) + .then((text) => JSON.parse(text)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'sec-fetch-site - module script'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -68,8 +98,23 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Cross-Site'); + }); + }, 'sec-fetch-site - classic script'); + + promise_test(() => { + const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; + return induceRequest( + 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}' + path + '&mime=application/javascript', + {"type": "module"} + ) + .then(() => fetch(path + '&retrieve')) + .then((response) => response.text()) + .then((text) => JSON.parse(text)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'sec-fetch-site - module script'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -83,8 +128,23 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin'); + }); + }, 'sec-fetch-site - classic script'); + + promise_test(() => { + const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; + return induceRequest( + 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path + '&mime=application/javascript', + {"type": "module"} + ) + .then(() => fetch(path + '&retrieve')) + .then((response) => response.text()) + .then((text) => JSON.parse(text)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'sec-fetch-site - module script'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -98,7 +158,22 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }); + }, 'sec-fetch-site - classic script'); + + promise_test(() => { + const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; + return induceRequest( + 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path + '&mime=application/javascript', + {"type": "module"} + ) + .then(() => fetch(path + '&retrieve')) + .then((response) => response.text()) + .then((text) => JSON.parse(text)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'sec-fetch-site - module script'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.sub.html new file mode 100644 index 00000000000000..efc6b2142ff81d --- /dev/null +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.sub.html @@ -0,0 +1,23 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html similarity index 98% rename from fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site-redirect.https.sub.html rename to fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html index e59e116b46573b..797856f5630bf2 100644 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site-redirect.https.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html @@ -17,7 +17,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); + }); }, 'sec-fetch-site - Cross-Site -> Same-Origin'); promise_test(() => { @@ -29,7 +29,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); + }); }, 'sec-fetch-site - Cross-Site -> Same-Site'); promise_test(() => { @@ -41,7 +41,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); + }); }, 'sec-fetch-site - Cross-Site -> Cross-Site'); promise_test(() => { @@ -53,7 +53,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); + }); }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin'); promise_test(() => { @@ -65,7 +65,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); + }); }, 'sec-fetch-site - HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-element-sec-fetch-mode-no-cors.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-mode.sub.html similarity index 72% rename from fetch/metadata/generated/script-element-sec-fetch-mode-no-cors.sub.html rename to fetch/metadata/generated/script-module-import-static-sec-fetch-mode.sub.html index 6f4427768d6692..d005ec2374574f 100644 --- a/fetch/metadata/generated/script-element-sec-fetch-mode-no-cors.sub.html +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-mode.sub.html @@ -10,13 +10,12 @@ \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html similarity index 98% rename from fetch/metadata/generated/script-module-import-static-sec-fetch-site-redirect.https.sub.html rename to fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html index c87d54f831d44f..6bdbbfdb1ac6af 100644 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-site-redirect.https.sub.html +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html @@ -37,7 +37,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); + }); }, 'sec-fetch-site - Cross-Site -> Same-Origin'); promise_test(() => { @@ -52,7 +52,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); + }); }, 'sec-fetch-site - Cross-Site -> Same-Site'); promise_test(() => { @@ -67,7 +67,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); + }); }, 'sec-fetch-site - Cross-Site -> Cross-Site'); promise_test(() => { @@ -82,7 +82,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); + }); }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin'); promise_test(() => { @@ -97,7 +97,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); + }); }, 'sec-fetch-site - HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-mode-no-cors.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-mode.sub.html similarity index 100% rename from fetch/metadata/generated/video-poster-sec-fetch-mode-no-cors.sub.html rename to fetch/metadata/generated/video-poster-sec-fetch-mode.sub.html diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site-redirect.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html similarity index 100% rename from fetch/metadata/generated/video-poster-sec-fetch-site-redirect.https.sub.html rename to fetch/metadata/generated/video-poster-sec-fetch-site.sub.html diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 95c8efb81abd88..d7eabe9b8e77ed 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -1,112 +1,81 @@ --- -- templates: '*' - file_name_part: sec-fetch-site-redirect.https - title: Fetch Metadata - Sec-Fetch-Site - redirection +- title: Fetch Metadata - Sec-Fetch-Site - redirection headerName: sec-fetch-site - requests: - - description: Cross-Site -> Same-Origin - pathPrefix: "\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{host}}:{{ports[https][0]}}" - expected: cross-site - - description: Cross-Site -> Same-Site - pathPrefix: "\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{domains[www2]}}:{{ports[https][0]}}" - expected: cross-site - - description: Cross-Site -> Cross-Site - pathPrefix: "\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{hosts[alt][]}}:{{ports[https][0]}}" - expected: cross-site - - description: Same-Origin -> Cross-Site -> Same-Origin - pathPrefix: "\ - https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{host}}:{{ports[https][0]}}" - expected: cross-site - - description: HTTPS downgrade-upgrade - pathPrefix: "\ - https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{host}}:{{ports[https][0]}}" - expected: cross-site + all_subtests: + - description: Cross-Site -> Same-Origin + pathPrefix: "\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: cross-site + - description: Cross-Site -> Same-Site + pathPrefix: "\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{domains[www2]}}:{{ports[https][0]}}" + expected: cross-site + - description: Cross-Site -> Cross-Site + pathPrefix: "\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{hosts[alt][]}}:{{ports[https][0]}}" + expected: cross-site + - description: Same-Origin -> Cross-Site -> Same-Origin + pathPrefix: "\ + https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: cross-site + - description: HTTPS downgrade-upgrade + pathPrefix: "\ + https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: cross-site + each_subtest: + appcache-manifest.sub.https.html: [{}] + form-get.sub.html: [{}] + form-post.sub.html: [{}] + image.sub.html: [{}] + script-element.sub.html: + - description: classic script + - description: module script + elementAttrs: + type: module + script-module-import-dynamic.sub.html: [{}] + script-module-import-static.sub.html: [{}] + video-poster.sub.html: [{}] -- templates: - - appcache-manifest.sub.https.html - - image.sub.html - - script-element.sub.html - - video-poster.sub.html - file_name_part: sec-fetch-mode-no-cors - title: Fetch Metadata - Sec-Fetch-Mode +- title: Fetch Metadata - Sec-Fetch-Mode headerName: sec-fetch-mode - requests: - - expected: no-cors - -- templates: - - script-module-via-import-dynamic.sub.html - - script-module-via-import-static.sub.html - file_name_part: sec-fetch-mode-cors-script-import - title: Fetch Metadata - Sec-Fetch-Mode - scripts via "import" - headerName: sec-fetch-mode - requests: - - description: foobar - expected: cors - -- templates: - - script-element.sub.html - file_name_part: sec-fetch-mode-cors-script-element - title: Fetch Metadata - Sec-Fetch-Mode - scripts via element - headerName: sec-fetch-mode - requests: - - description: module script - elementAttrs: - type: module - expected: cors - - description: classic script, crossorigin="" - elementAttrs: - crossorigin: '' - expected: cors - - description: classic script, crossorigin="anonymous" - elementAttrs: - crossorigin: anonymous - expected: cors - - description: classic script, crossorigin="use-credentials" - elementAttrs: - crossorigin: use-credentials - expected: cors - -- templates: - - form-post.sub.html - - form-get.sub.html - file_name_part: sec-fetch-mode-navigate-redirect - title: Fetch Metadata - Sec-Fetch-Mode - navigation redirection - headerName: sec-fetch-mode - requests: - - description: Cross-Site -> Same-Origin - pathPrefix: "\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{host}}:{{ports[https][0]}}" - expected: navigate - - description: Cross-Site -> Same-Site - pathPrefix: "\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{domains[www]}}:{{ports[https][0]}}" - expected: navigate - - description: Cross-Site -> Cross-Site - pathPrefix: "\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{hosts[alt][]}}:{{ports[https][0]}}" - expected: navigate - - description: Same-Origin -> Cross-Site -> Same-Origin - pathPrefix: "\ - https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{host}}:{{ports[https][0]}}" - expected: navigate - - description: HTTPS downgrade-upgrade - pathPrefix: "\ - https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{host}}:{{ports[https][0]}}" - expected: navigate + each_subtest: + appcache-manifest.sub.https.html: + - expected: no-cors + form-post.sub.html: + - expected: navigate + form-get.sub.html: + - expected: navigate + image.sub.html: + - expected: no-cors + script-element.sub.html: + - description: classic script + expected: no-cors + - description: module script + expected: cors + elementAttrs: + type: module + - description: classic script, crossorigin="" + expected: cors + elementAttrs: + crossorigin: '' + - description: classic script, crossorigin="anonymous" + expected: cors + elementAttrs: + crossorigin: anonymous + - description: classic script, crossorigin="use-credentials" + expected: cors + elementAttrs: + crossorigin: use-credentials + script-module-import-dynamic.sub.html: + - expected: cors + script-module-import-static.sub.html: + - expected: cors + video-poster.sub.html: + - expected: no-cors diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index 27cddf7217d89c..5d148e603c36d0 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -27,25 +27,44 @@ def test_name(template_name, case_name): prefix, suffix = template_name.split('.', 1) return '{}-{}.{}'.format(prefix, case_name, suffix) +def cross(a, b): + for a_item in a: + for b_item in b: + merged = {} + merged.update(a_item) + merged.update(b_item) + yield merged + def main(templates_directory, cases_file, out_directory): + templates = {} for template_name, path in find_templates(templates_directory): with open(path, 'r') as handle: - template = Template(handle.read(), variable_start_string='[%', variable_end_string='%]') - - with open(cases_file, 'r') as handle: - cases = yaml.safe_load(handle.read()) + templates[template_name] = Template( + handle.read(), + variable_start_string='[%', + variable_end_string='%]' + ) - for case in cases: - - if template_name not in case['templates'] and case['templates'] != '*': - continue + with open(cases_file, 'r') as handle: + cases = yaml.safe_load(handle.read()) + for case in cases: + for template_name, concise_subtests in case['each_subtest'].items(): out_file_name = os.path.join( - out_directory, test_name(template_name, case['file_name_part']) + out_directory, + test_name(template_name, case['headerName']) + ) + context = dict( + subtests=cross( + case.get('all_subtests', [{}]), concise_subtests + ), + **case ) + context.pop('all_subtests', None) + context.pop('each_subtest') with open(out_file_name, 'w') as handle: - handle.write(template.render(**case)) + handle.write(templates[template_name].render(**context)) if __name__ == '__main__': main(TEMPLATES_DIR, CASES, OUT_DIR) diff --git a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html index 955f91930bf0e3..e8ba2767091d0f 100644 --- a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html +++ b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html @@ -36,23 +36,23 @@ .then(() => iframe.remove()); } - {%- for request in requests %} + {%- for subtest in subtests %} promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('[%request.pathPrefix%]' + path) + return induceRequest('[%subtest.pathPrefix%]' + path) .then(() => fetch(path + '&retrieve')) .then((response) => response.text()) .then((text) => JSON.parse(text)) .then((headers) => { - {%- if request[expected] == none %} + {%- if subtest[expected] == none %} assert_not_own_property(headers, '[%headerName%]'); {%- else %} assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headName%]'], '[%request[expected]%]'); + assert_equals(headers['[%headName%]'], '[%subtest[expected]%]'); {%- endif %} }); - }, '[%headerName%] - [%request.description%]'); + }, '[%headerName%] - [%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/form-get.sub.html b/fetch/metadata/tools/templates/form-get.sub.html index b34672f4a5b19e..a0d92a8e937cd4 100644 --- a/fetch/metadata/tools/templates/form-get.sub.html +++ b/fetch/metadata/tools/templates/form-get.sub.html @@ -42,23 +42,23 @@ }) .then(() => win.close()); } - {%- for request in requests %} + {%- for subtest in subtests %} promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('[%request.pathPrefix%]' + path) + return induceRequest('[%subtest.pathPrefix%]' + path) .then(() => fetch(path + '&retrieve')) .then((response) => response.text()) .then((text) => JSON.parse(text)) .then((headers) => { - {%- if request[expected] == none %} + {%- if subtest[expected] == none %} assert_not_own_property(headers, '[%headerName%]'); {%- else %} assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%request.expected%]'); + assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%request.description%]'); + }, '[%headerName%] - [%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/form-post.sub.html b/fetch/metadata/tools/templates/form-post.sub.html index 97694d766f2c1e..0d318548a57e7d 100644 --- a/fetch/metadata/tools/templates/form-post.sub.html +++ b/fetch/metadata/tools/templates/form-post.sub.html @@ -43,23 +43,23 @@ }) .then(() => win.close()); } - {%- for request in requests %} + {%- for subtest in subtests %} promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('[%request.pathPrefix%]' + path) + return induceRequest('[%subtest.pathPrefix%]' + path) .then(() => fetch(path + '&retrieve')) .then((response) => response.text()) .then((text) => JSON.parse(text)) .then((headers) => { - {%- if request[expected] == none %} + {%- if subtest[expected] == none %} assert_not_own_property(headers, '[%headerName%]'); {%- else %} assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%request.expected%]'); + assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%request.description%]'); + }, '[%headerName%] - [%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/image.sub.html b/fetch/metadata/tools/templates/image.sub.html index a1cb2fface3cd5..36ee43d1b90615 100644 --- a/fetch/metadata/tools/templates/image.sub.html +++ b/fetch/metadata/tools/templates/image.sub.html @@ -17,23 +17,23 @@ }); } - {%- for request in requests %} + {%- for subtest in subtests %} promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('[%request.pathPrefix%]' + path) + return induceRequest('[%subtest.pathPrefix%]' + path) .then(() => fetch(path + '&retrieve')) .then((response) => response.text()) .then((text) => JSON.parse(text)) .then((headers) => { - {%- if request[expected] == none %} + {%- if subtest[expected] == none %} assert_not_own_property(headers, '[%headerName%]'); {%- else %} assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%request.expected%]'); + assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%request.description%]'); + }, '[%headerName%] - [%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/script-element.sub.html b/fetch/metadata/tools/templates/script-element.sub.html index 6f1726ce372cb4..5562428036b1bd 100644 --- a/fetch/metadata/tools/templates/script-element.sub.html +++ b/fetch/metadata/tools/templates/script-element.sub.html @@ -25,26 +25,26 @@ }) .then(() => script.remove()); } - {%- for request in requests %} + {%- for subtest in subtests %} promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; return induceRequest( - '[%request.pathPrefix%]' + path + '&mime=application/javascript', - [%request.elementAttrs | default({}) | tojson%] + '[%subtest.pathPrefix%]' + path + '&mime=application/javascript', + [%subtest.elementAttrs | default({}) | tojson%] ) .then(() => fetch(path + '&retrieve')) .then((response) => response.text()) .then((text) => JSON.parse(text)) .then((headers) => { - {%- if request[expected] == none %} + {%- if subtest[expected] == none %} assert_not_own_property(headers, '[%headerName%]'); {%- else %} assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%request.expected%]'); + assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} - }); - }, '[%headerName%] - [%request.description%]'); + }); + }, '[%headerName%] - [%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html b/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html index 11e953257a8f2d..86d2a3ff55263c 100644 --- a/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html +++ b/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html @@ -7,23 +7,23 @@ diff --git a/fetch/metadata/tools/templates/script-module-import-static.sub.html b/fetch/metadata/tools/templates/script-module-import-static.sub.html index cc3d1ab3a07962..3c9c19c3bb8542 100644 --- a/fetch/metadata/tools/templates/script-module-import-static.sub.html +++ b/fetch/metadata/tools/templates/script-module-import-static.sub.html @@ -24,11 +24,11 @@ }) .then(() => script.remove()); } - {%- for request in requests %} + {%- for subtest in subtests %} promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const moduleId = '[%request.pathPrefix%]' + + const moduleId = '[%subtest.pathPrefix%]' + encodeURIComponent(path + '&mime=application/javascript'); return induceRequest(moduleId) @@ -36,14 +36,14 @@ .then((response) => response.text()) .then((text) => JSON.parse(text)) .then((headers) => { - {%- if request[expected] == none %} + {%- if subtest[expected] == none %} assert_not_own_property(headers, '[%headerName%]'); {%- else %} assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%request.expected%]'); + assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} - }); - }, '[%headerName%] - [%request.description%]'); + }); + }, '[%headerName%] - [%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/video-poster.sub.html b/fetch/metadata/tools/templates/video-poster.sub.html index c0c45f0cc37898..790587028b6a3f 100644 --- a/fetch/metadata/tools/templates/video-poster.sub.html +++ b/fetch/metadata/tools/templates/video-poster.sub.html @@ -18,24 +18,24 @@ t.add_cleanup(() => video.remove()); } - {%- for request in requests %} + {%- for subtest in subtests %} promise_test((t) => { const id = '{{uuid()}}'; const path = '/fetch/metadata/resources/record-headers.py?key=' + id; - induceRequest(t, '[%request.pathPrefix%]' + path); + induceRequest(t, '[%subtest.pathPrefix%]' + path); return pollForRequestRecording(id) .then((headers) => { - {%- if request[expected] == none %} + {%- if subtest[expected] == none %} assert_not_own_property(headers, '[%headerName%]'); {%- else %} assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%request.expected%]'); + assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%request.description%]'); + }, '[%headerName%] - [%subtest.description%]'); {%- endfor %} From b9b4dd0bfbeb964911052ef30f1ec7140541c0c7 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 10 Dec 2019 11:37:51 -0500 Subject: [PATCH 029/127] Refactor again Still don't have an answer for subtest titles --- .../form-get-sec-fetch-site.sub.html | 104 ----------- .../form-post-sec-fetch-mode.sub.html | 57 ------ .../form-post-sec-fetch-site.sub.html | 105 ----------- ...> form-submission-sec-fetch-mode.sub.html} | 20 ++- .../form-submission-sec-fetch-site.sub.html | 164 ++++++++++++++++++ fetch/metadata/tools/cases/master.yml | 18 +- .../tools/templates/form-post.sub.html | 67 ------- ...-get.sub.html => form-submission.sub.html} | 6 +- 8 files changed, 195 insertions(+), 346 deletions(-) delete mode 100644 fetch/metadata/generated/form-get-sec-fetch-site.sub.html delete mode 100644 fetch/metadata/generated/form-post-sec-fetch-mode.sub.html delete mode 100644 fetch/metadata/generated/form-post-sec-fetch-site.sub.html rename fetch/metadata/generated/{form-get-sec-fetch-mode.sub.html => form-submission-sec-fetch-mode.sub.html} (70%) create mode 100644 fetch/metadata/generated/form-submission-sec-fetch-site.sub.html delete mode 100644 fetch/metadata/tools/templates/form-post.sub.html rename fetch/metadata/tools/templates/{form-get.sub.html => form-submission.sub.html} (90%) diff --git a/fetch/metadata/generated/form-get-sec-fetch-site.sub.html b/fetch/metadata/generated/form-get-sec-fetch-site.sub.html deleted file mode 100644 index 141728ef7e4cc5..00000000000000 --- a/fetch/metadata/generated/form-get-sec-fetch-site.sub.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Site - redirection - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/form-post-sec-fetch-mode.sub.html b/fetch/metadata/generated/form-post-sec-fetch-mode.sub.html deleted file mode 100644 index 92f98fd1a23df4..00000000000000 --- a/fetch/metadata/generated/form-post-sec-fetch-mode.sub.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/form-post-sec-fetch-site.sub.html b/fetch/metadata/generated/form-post-sec-fetch-site.sub.html deleted file mode 100644 index 4707c02ffc8030..00000000000000 --- a/fetch/metadata/generated/form-post-sec-fetch-site.sub.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Site - redirection - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/form-get-sec-fetch-mode.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-mode.sub.html similarity index 70% rename from fetch/metadata/generated/form-get-sec-fetch-mode.sub.html rename to fetch/metadata/generated/form-submission-sec-fetch-mode.sub.html index e089455cf22dce..8dedf0947160d7 100644 --- a/fetch/metadata/generated/form-get-sec-fetch-mode.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-mode.sub.html @@ -9,7 +9,7 @@ \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html new file mode 100644 index 00000000000000..4e6adf9618d358 --- /dev/null +++ b/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html @@ -0,0 +1,164 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index d7eabe9b8e77ed..90be28c470f09d 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -31,8 +31,11 @@ expected: cross-site each_subtest: appcache-manifest.sub.https.html: [{}] - form-get.sub.html: [{}] - form-post.sub.html: [{}] + form-submission.sub.html: + - description: GET + method: GET + - description: POST + method: POST image.sub.html: [{}] script-element.sub.html: - description: classic script @@ -48,10 +51,13 @@ each_subtest: appcache-manifest.sub.https.html: - expected: no-cors - form-post.sub.html: - - expected: navigate - form-get.sub.html: - - expected: navigate + form-submission.sub.html: + - description: GET + method: GET + expected: navigate + - description: POST + method: POST + expected: navigate image.sub.html: - expected: no-cors script-element.sub.html: diff --git a/fetch/metadata/tools/templates/form-post.sub.html b/fetch/metadata/tools/templates/form-post.sub.html deleted file mode 100644 index 0d318548a57e7d..00000000000000 --- a/fetch/metadata/tools/templates/form-post.sub.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - [%title%] - - - {%- for script in scripts %} - - {%- endfor %} - - - - diff --git a/fetch/metadata/tools/templates/form-get.sub.html b/fetch/metadata/tools/templates/form-submission.sub.html similarity index 90% rename from fetch/metadata/tools/templates/form-get.sub.html rename to fetch/metadata/tools/templates/form-submission.sub.html index a0d92a8e937cd4..657aefa813cfc5 100644 --- a/fetch/metadata/tools/templates/form-get.sub.html +++ b/fetch/metadata/tools/templates/form-submission.sub.html @@ -12,7 +12,7 @@ \ No newline at end of file diff --git a/fetch/metadata/generated/image-sec-fetch-site.sub.html b/fetch/metadata/generated/image-sec-fetch-site.sub.html index d2b17eaa478bae..2077225caf604b 100644 --- a/fetch/metadata/generated/image-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/image-sec-fetch-site.sub.html @@ -9,17 +9,25 @@ diff --git a/fetch/metadata/generated/image-sec-fetch-site.sub.html b/fetch/metadata/generated/image-sec-fetch-site.sub.html index 2077225caf604b..141361d2a30c61 100644 --- a/fetch/metadata/generated/image-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/image-sec-fetch-site.sub.html @@ -34,7 +34,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); + }); }, 'sec-fetch-site - Cross-Site -> Same-Origin'); promise_test(() => { @@ -49,7 +49,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); + }); }, 'sec-fetch-site - Cross-Site -> Same-Site'); promise_test(() => { @@ -64,7 +64,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); + }); }, 'sec-fetch-site - Cross-Site -> Cross-Site'); promise_test(() => { @@ -79,7 +79,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); + }); }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin'); promise_test(() => { @@ -94,7 +94,7 @@ .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); + }); }, 'sec-fetch-site - HTTPS downgrade-upgrade'); diff --git a/fetch/metadata/tools/templates/image.sub.html b/fetch/metadata/tools/templates/image.sub.html index 15a9fab64edfe8..d53c89c0f3fa9f 100644 --- a/fetch/metadata/tools/templates/image.sub.html +++ b/fetch/metadata/tools/templates/image.sub.html @@ -40,7 +40,7 @@ assert_own_property(headers, '[%headerName%]'); assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} - }); + }); }, '[%headerName%] - [%subtest.description%]'); {%- endfor %} From 4b4764e743d5b7c8507284f21a4d103b4864c3f2 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 10 Dec 2019 13:35:19 -0500 Subject: [PATCH 032/127] Add template and tests for `fetch` method --- .../generated/fetch-sec-fetch-mode.sub.html | 86 +++++++++++++++ .../generated/fetch-sec-fetch-site.sub.html | 101 ++++++++++++++++++ fetch/metadata/tools/cases/master.yml | 13 +++ fetch/metadata/tools/templates/fetch.sub.html | 49 +++++++++ 4 files changed, 249 insertions(+) create mode 100644 fetch/metadata/generated/fetch-sec-fetch-mode.sub.html create mode 100644 fetch/metadata/generated/fetch-sec-fetch-site.sub.html create mode 100644 fetch/metadata/tools/templates/fetch.sub.html diff --git a/fetch/metadata/generated/fetch-sec-fetch-mode.sub.html b/fetch/metadata/generated/fetch-sec-fetch-mode.sub.html new file mode 100644 index 00000000000000..1b4ca45a9eafd3 --- /dev/null +++ b/fetch/metadata/generated/fetch-sec-fetch-mode.sub.html @@ -0,0 +1,86 @@ + + + + + Fetch Metadata - Sec-Fetch-Mode + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-site.sub.html b/fetch/metadata/generated/fetch-sec-fetch-site.sub.html new file mode 100644 index 00000000000000..3f995dff62ee77 --- /dev/null +++ b/fetch/metadata/generated/fetch-sec-fetch-site.sub.html @@ -0,0 +1,101 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 0083a5b93809a7..ff4bd245c62607 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -31,6 +31,7 @@ expected: cross-site each_subtest: appcache-manifest.sub.https.html: [{}] + fetch.sub.html: [{}] form-submission.sub.html: - description: GET method: GET @@ -51,6 +52,18 @@ each_subtest: appcache-manifest.sub.https.html: - expected: no-cors + fetch.sub.html: + - description: no options + expected: cors + - description: 'mode: cors' + expected: cors + init: { mode: cors } + - description: 'mode: no-cors' + expected: no-cors + init: { mode: no-cors } + - description: 'mode: same-origin' + expected: same-origin + init: { mode: same-origin } form-submission.sub.html: - description: GET method: GET diff --git a/fetch/metadata/tools/templates/fetch.sub.html b/fetch/metadata/tools/templates/fetch.sub.html new file mode 100644 index 00000000000000..bf1cc181d8c9d5 --- /dev/null +++ b/fetch/metadata/tools/templates/fetch.sub.html @@ -0,0 +1,49 @@ + + + + + [%title%] + + + + + + From 029648c65010c03a35e7c10242f7ff53d653c626 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 10 Dec 2019 14:38:04 -0500 Subject: [PATCH 033/127] Add templates for naviation via global property --- .../global-properties-sec-fetch-mode.sub.html | 90 +++++ .../global-properties-sec-fetch-site.sub.html | 331 ++++++++++++++++++ fetch/metadata/tools/cases/master.yml | 22 ++ .../templates/global-properties.sub.html | 63 ++++ 4 files changed, 506 insertions(+) create mode 100644 fetch/metadata/generated/global-properties-sec-fetch-mode.sub.html create mode 100644 fetch/metadata/generated/global-properties-sec-fetch-site.sub.html create mode 100644 fetch/metadata/tools/templates/global-properties.sub.html diff --git a/fetch/metadata/generated/global-properties-sec-fetch-mode.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-mode.sub.html new file mode 100644 index 00000000000000..9fa35a5c2f74bf --- /dev/null +++ b/fetch/metadata/generated/global-properties-sec-fetch-mode.sub.html @@ -0,0 +1,90 @@ + + + + + Fetch Metadata - Sec-Fetch-Mode + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/global-properties-sec-fetch-site.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-site.sub.html new file mode 100644 index 00000000000000..c024cc2be83677 --- /dev/null +++ b/fetch/metadata/generated/global-properties-sec-fetch-site.sub.html @@ -0,0 +1,331 @@ + + + + + + Fetch Metadata - Sec-Fetch-Site - redirection + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index ff4bd245c62607..09377aa1ed5983 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -37,6 +37,15 @@ method: GET - description: POST method: POST + global-properties.sub.html: + - description: location + api: location + - description: location.href + api: location.href + - description: location.assign + api: location.assign + - description: location.replace + api: location.replace image.sub.html: [{}] script-element.sub.html: - description: classic script @@ -71,6 +80,19 @@ - description: POST method: POST expected: navigate + global-properties.sub.html: + - description: location + api: location + expected: navigate + - description: location.href + api: location.href + expected: navigate + - description: location.assign + api: location.assign + expected: navigate + - description: location.replace + api: location.replace + expected: navigate image.sub.html: - description: no attributes expected: no-cors diff --git a/fetch/metadata/tools/templates/global-properties.sub.html b/fetch/metadata/tools/templates/global-properties.sub.html new file mode 100644 index 00000000000000..d346dc035690c8 --- /dev/null +++ b/fetch/metadata/tools/templates/global-properties.sub.html @@ -0,0 +1,63 @@ + + + + + {#- Jinja2 models list values using generators. In order to count the number + of members, the generator must be exhausted. Store the list values so + that they may be iterated over to generate source code for subtests. #} + {%- set foo = subtests|list %} + {%- if foo|length > 10 %} + + {%- endif %} + [%title%] + + + + + + From 519dc873bc0d9614b64a0287fe4ce44435745395 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 10 Dec 2019 14:46:03 -0500 Subject: [PATCH 034/127] Concatenate description properties --- .../form-submission-sec-fetch-site.sub.html | 20 +++++----- .../global-properties-sec-fetch-site.sub.html | 40 +++++++++---------- .../script-element-sec-fetch-site.sub.html | 20 +++++----- fetch/metadata/tools/cases/master.yml | 16 ++++---- fetch/metadata/tools/generate.py | 14 +++++-- 5 files changed, 58 insertions(+), 52 deletions(-) diff --git a/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html index 4e6adf9618d358..cd0306f5bcb2a7 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html @@ -50,7 +50,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - GET'); + }, 'sec-fetch-site - Cross-Site -> Same-Origin - GET'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -62,7 +62,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - POST'); + }, 'sec-fetch-site - Cross-Site -> Same-Origin - POST'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -74,7 +74,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - GET'); + }, 'sec-fetch-site - Cross-Site -> Same-Site - GET'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -86,7 +86,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - POST'); + }, 'sec-fetch-site - Cross-Site -> Same-Site - POST'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -98,7 +98,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - GET'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site - GET'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -110,7 +110,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - POST'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site - POST'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -122,7 +122,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - GET'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - GET'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -134,7 +134,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - POST'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - POST'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -146,7 +146,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - GET'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade - GET'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -158,7 +158,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - POST'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade - POST'); \ No newline at end of file diff --git a/fetch/metadata/generated/global-properties-sec-fetch-site.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-site.sub.html index c024cc2be83677..101d7db2bea796 100644 --- a/fetch/metadata/generated/global-properties-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/global-properties-sec-fetch-site.sub.html @@ -40,7 +40,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location'); + }, 'sec-fetch-site - Cross-Site -> Same-Origin - location'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -55,7 +55,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location.href'); + }, 'sec-fetch-site - Cross-Site -> Same-Origin - location.href'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -70,7 +70,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location.assign'); + }, 'sec-fetch-site - Cross-Site -> Same-Origin - location.assign'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -85,7 +85,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location.replace'); + }, 'sec-fetch-site - Cross-Site -> Same-Origin - location.replace'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -100,7 +100,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location'); + }, 'sec-fetch-site - Cross-Site -> Same-Site - location'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -115,7 +115,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location.href'); + }, 'sec-fetch-site - Cross-Site -> Same-Site - location.href'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -130,7 +130,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location.assign'); + }, 'sec-fetch-site - Cross-Site -> Same-Site - location.assign'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -145,7 +145,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location.replace'); + }, 'sec-fetch-site - Cross-Site -> Same-Site - location.replace'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -160,7 +160,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site - location'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -175,7 +175,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location.href'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site - location.href'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -190,7 +190,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location.assign'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site - location.assign'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -205,7 +205,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location.replace'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site - location.replace'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -220,7 +220,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - location'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -235,7 +235,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location.href'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - location.href'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -250,7 +250,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location.assign'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - location.assign'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -265,7 +265,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location.replace'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - location.replace'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -280,7 +280,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade - location'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -295,7 +295,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location.href'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.href'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -310,7 +310,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location.assign'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.assign'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -325,7 +325,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - location.replace'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.replace'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-element-sec-fetch-site.sub.html b/fetch/metadata/generated/script-element-sec-fetch-site.sub.html index e4f48a155ceb92..64ad25fb2e610b 100644 --- a/fetch/metadata/generated/script-element-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/script-element-sec-fetch-site.sub.html @@ -39,7 +39,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - classic script'); + }, 'sec-fetch-site - Cross-Site -> Same-Origin - classic script'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -54,7 +54,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - module script'); + }, 'sec-fetch-site - Cross-Site -> Same-Origin - module script'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -69,7 +69,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - classic script'); + }, 'sec-fetch-site - Cross-Site -> Same-Site - classic script'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -84,7 +84,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - module script'); + }, 'sec-fetch-site - Cross-Site -> Same-Site - module script'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -99,7 +99,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - classic script'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site - classic script'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -114,7 +114,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - module script'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site - module script'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -129,7 +129,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - classic script'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - classic script'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -144,7 +144,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - module script'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - module script'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -159,7 +159,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - classic script'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade - classic script'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; @@ -174,6 +174,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - module script'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade - module script'); \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 09377aa1ed5983..d7231920e88d8f 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -33,23 +33,23 @@ appcache-manifest.sub.https.html: [{}] fetch.sub.html: [{}] form-submission.sub.html: - - description: GET + - description: ' - GET' method: GET - - description: POST + - description: ' - POST' method: POST global-properties.sub.html: - - description: location + - description: ' - location' api: location - - description: location.href + - description: ' - location.href' api: location.href - - description: location.assign + - description: ' - location.assign' api: location.assign - - description: location.replace + - description: ' - location.replace' api: location.replace image.sub.html: [{}] script-element.sub.html: - - description: classic script - - description: module script + - description: ' - classic script' + - description: ' - module script' elementAttrs: type: module script-module-import-dynamic.sub.html: [{}] diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index 5d148e603c36d0..ae46ce4ba7996f 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -28,11 +28,17 @@ def test_name(template_name, case_name): return '{}-{}.{}'.format(prefix, case_name, suffix) def cross(a, b): - for a_item in a: - for b_item in b: + for a_object in a: + for b_object in b: merged = {} - merged.update(a_item) - merged.update(b_item) + merged.update(a_object) + merged.update(b_object) + + if 'description' in a_object and 'description' in b_object: + merged['description'] = '{}{}'.format( + a_object['description'], b_object['description'] + ) + yield merged def main(templates_directory, cases_file, out_directory): From d6cfff0f756cd34f30384c197937f01305d110ce Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 10 Dec 2019 16:51:57 -0500 Subject: [PATCH 035/127] Correct protocol usage --- ...ifest-sec-fetch-mode.https.sub.https.html} | 0 ...nifest-sec-fetch-site.https.sub.https.html | 52 ++++ ...che-manifest-sec-fetch-site.sub.https.html | 50 +--- ...ml => fetch-sec-fetch-mode.https.sub.html} | 0 .../fetch-sec-fetch-site.https.sub.html | 41 +++ .../generated/fetch-sec-fetch-site.sub.html | 62 +---- ...-submission-sec-fetch-mode.https.sub.html} | 0 ...m-submission-sec-fetch-site.https.sub.html | 68 +++++ .../form-submission-sec-fetch-site.sub.html | 98 +------ ...-properties-sec-fetch-mode.https.sub.html} | 0 ...l-properties-sec-fetch-site.https.sub.html | 90 +++++++ .../global-properties-sec-fetch-site.sub.html | 243 +----------------- ...ml => image-sec-fetch-mode.https.sub.html} | 0 .../image-sec-fetch-site.https.sub.html | 41 +++ .../generated/image-sec-fetch-site.sub.html | 62 +---- ...ipt-element-sec-fetch-mode.https.sub.html} | 0 ...ript-element-sec-fetch-site.https.sub.html | 59 +++++ .../script-element-sec-fetch-site.sub.html | 122 +-------- ...ort-dynamic-sec-fetch-mode.https.sub.html} | 0 ...port-dynamic-sec-fetch-site.https.sub.html | 23 ++ ...ule-import-dynamic-sec-fetch-site.sub.html | 48 ---- ...port-static-sec-fetch-mode.https.sub.html} | 0 ...mport-static-sec-fetch-site.https.sub.html | 43 ++++ ...dule-import-static-sec-fetch-site.sub.html | 62 +---- ...ideo-poster-sec-fetch-mode.https.sub.html} | 0 ...video-poster-sec-fetch-site.https.sub.html | 35 +++ .../video-poster-sec-fetch-site.sub.html | 54 +--- fetch/metadata/tools/cases/master.yml | 59 +++-- fetch/metadata/tools/generate.py | 2 +- 29 files changed, 502 insertions(+), 812 deletions(-) rename fetch/metadata/generated/{appcache-manifest-sec-fetch-mode.sub.https.html => appcache-manifest-sec-fetch-mode.https.sub.https.html} (100%) create mode 100644 fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html rename fetch/metadata/generated/{fetch-sec-fetch-mode.sub.html => fetch-sec-fetch-mode.https.sub.html} (100%) create mode 100644 fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html rename fetch/metadata/generated/{form-submission-sec-fetch-mode.sub.html => form-submission-sec-fetch-mode.https.sub.html} (100%) create mode 100644 fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html rename fetch/metadata/generated/{global-properties-sec-fetch-mode.sub.html => global-properties-sec-fetch-mode.https.sub.html} (100%) create mode 100644 fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html rename fetch/metadata/generated/{image-sec-fetch-mode.sub.html => image-sec-fetch-mode.https.sub.html} (100%) create mode 100644 fetch/metadata/generated/image-sec-fetch-site.https.sub.html rename fetch/metadata/generated/{script-element-sec-fetch-mode.sub.html => script-element-sec-fetch-mode.https.sub.html} (100%) create mode 100644 fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html rename fetch/metadata/generated/{script-module-import-dynamic-sec-fetch-mode.sub.html => script-module-import-dynamic-sec-fetch-mode.https.sub.html} (100%) create mode 100644 fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html rename fetch/metadata/generated/{script-module-import-static-sec-fetch-mode.sub.html => script-module-import-static-sec-fetch-mode.https.sub.html} (100%) create mode 100644 fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html rename fetch/metadata/generated/{video-poster-sec-fetch-mode.sub.html => video-poster-sec-fetch-mode.https.sub.html} (100%) create mode 100644 fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html similarity index 100% rename from fetch/metadata/generated/appcache-manifest-sec-fetch-mode.sub.https.html rename to fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html new file mode 100644 index 00000000000000..cb1dc1d57ecb46 --- /dev/null +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html @@ -0,0 +1,52 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html index f66f56529463fb..db12993f17ccb8 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html @@ -2,7 +2,7 @@ - Fetch Metadata - Sec-Fetch-Site - redirection + Fetch Metadata - Sec-Fetch-Site - redirection from HTTP @@ -36,54 +36,6 @@ .then(() => iframe.remove()); } - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers[''], ''); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Origin'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{domains[www2]}}:{{ports[https][0]}}' + path) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers[''], ''); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Site'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}' + path) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers[''], ''); - }); - }, 'sec-fetch-site - Cross-Site -> Cross-Site'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers[''], ''); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin'); - promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path) diff --git a/fetch/metadata/generated/fetch-sec-fetch-mode.sub.html b/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html similarity index 100% rename from fetch/metadata/generated/fetch-sec-fetch-mode.sub.html rename to fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html diff --git a/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html b/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html new file mode 100644 index 00000000000000..2217e7dc770e0c --- /dev/null +++ b/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html @@ -0,0 +1,41 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-site.sub.html b/fetch/metadata/generated/fetch-sec-fetch-site.sub.html index 3f995dff62ee77..c2c6212dd58546 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/fetch-sec-fetch-site.sub.html @@ -2,7 +2,7 @@ - Fetch Metadata - Sec-Fetch-Site - redirection + Fetch Metadata - Sec-Fetch-Site - redirection from HTTP @@ -22,66 +22,6 @@ }); } - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return fetch( - 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, - {} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Origin'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return fetch( - 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{domains[www2]}}:{{ports[https][0]}}' + path, - {} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Site'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return fetch( - 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}' + path, - {} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Cross-Site'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return fetch( - 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, - {} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin'); - promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; return fetch( diff --git a/fetch/metadata/generated/form-submission-sec-fetch-mode.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-mode.https.sub.html similarity index 100% rename from fetch/metadata/generated/form-submission-sec-fetch-mode.sub.html rename to fetch/metadata/generated/form-submission-sec-fetch-mode.https.sub.html diff --git a/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html new file mode 100644 index 00000000000000..2a23dc3d71d183 --- /dev/null +++ b/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html @@ -0,0 +1,68 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html index cd0306f5bcb2a7..94b609f081a372 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html @@ -2,7 +2,7 @@ - Fetch Metadata - Sec-Fetch-Site - redirection + Fetch Metadata - Sec-Fetch-Site - redirection from HTTP @@ -40,102 +40,6 @@ .then(() => win.close()); } - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('GET', 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Origin - GET'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('POST', 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Origin - POST'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('GET', 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{domains[www2]}}:{{ports[https][0]}}' + path) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Site - GET'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('POST', 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{domains[www2]}}:{{ports[https][0]}}' + path) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Site - POST'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('GET', 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}' + path) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Cross-Site - GET'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('POST', 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}' + path) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Cross-Site - POST'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('GET', 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - GET'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('POST', 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - POST'); - promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; return induceRequest('GET', 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path) diff --git a/fetch/metadata/generated/global-properties-sec-fetch-mode.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-mode.https.sub.html similarity index 100% rename from fetch/metadata/generated/global-properties-sec-fetch-mode.sub.html rename to fetch/metadata/generated/global-properties-sec-fetch-mode.https.sub.html diff --git a/fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html new file mode 100644 index 00000000000000..1b3af47f74c413 --- /dev/null +++ b/fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html @@ -0,0 +1,90 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/global-properties-sec-fetch-site.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-site.sub.html index 101d7db2bea796..0c83787108687d 100644 --- a/fetch/metadata/generated/global-properties-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/global-properties-sec-fetch-site.sub.html @@ -2,8 +2,7 @@ - - Fetch Metadata - Sec-Fetch-Site - redirection + Fetch Metadata - Sec-Fetch-Site - redirection from HTTP @@ -27,246 +26,6 @@ .then(() => win.close()); } - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location = path; - }; - return induceRequest('https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Origin - location'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location.href = path; - }; - return induceRequest('https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Origin - location.href'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location.assign(path); - }; - return induceRequest('https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Origin - location.assign'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location.replace(path); - }; - return induceRequest('https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Origin - location.replace'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location = path; - }; - return induceRequest('https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{domains[www2]}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Site - location'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location.href = path; - }; - return induceRequest('https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{domains[www2]}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Site - location.href'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location.assign(path); - }; - return induceRequest('https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{domains[www2]}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Site - location.assign'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location.replace(path); - }; - return induceRequest('https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{domains[www2]}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Site - location.replace'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location = path; - }; - return induceRequest('https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Cross-Site - location'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location.href = path; - }; - return induceRequest('https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Cross-Site - location.href'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location.assign(path); - }; - return induceRequest('https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Cross-Site - location.assign'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location.replace(path); - }; - return induceRequest('https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Cross-Site - location.replace'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location = path; - }; - return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - location'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location.href = path; - }; - return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - location.href'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location.assign(path); - }; - return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - location.assign'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const navigate = (win, path) => { - win.location.replace(path); - }; - return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - location.replace'); - promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; const navigate = (win, path) => { diff --git a/fetch/metadata/generated/image-sec-fetch-mode.sub.html b/fetch/metadata/generated/image-sec-fetch-mode.https.sub.html similarity index 100% rename from fetch/metadata/generated/image-sec-fetch-mode.sub.html rename to fetch/metadata/generated/image-sec-fetch-mode.https.sub.html diff --git a/fetch/metadata/generated/image-sec-fetch-site.https.sub.html b/fetch/metadata/generated/image-sec-fetch-site.https.sub.html new file mode 100644 index 00000000000000..947d356c81f00d --- /dev/null +++ b/fetch/metadata/generated/image-sec-fetch-site.https.sub.html @@ -0,0 +1,41 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/image-sec-fetch-site.sub.html b/fetch/metadata/generated/image-sec-fetch-site.sub.html index 141361d2a30c61..0ebceb6abbcbf0 100644 --- a/fetch/metadata/generated/image-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/image-sec-fetch-site.sub.html @@ -2,7 +2,7 @@ - Fetch Metadata - Sec-Fetch-Site - redirection + Fetch Metadata - Sec-Fetch-Site - redirection from HTTP @@ -22,66 +22,6 @@ }); } - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest( - 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, - {} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Origin'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest( - 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{domains[www2]}}:{{ports[https][0]}}' + path, - {} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Site'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest( - 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}' + path, - {} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Cross-Site'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest( - 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, - {} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin'); - promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; return induceRequest( diff --git a/fetch/metadata/generated/script-element-sec-fetch-mode.sub.html b/fetch/metadata/generated/script-element-sec-fetch-mode.https.sub.html similarity index 100% rename from fetch/metadata/generated/script-element-sec-fetch-mode.sub.html rename to fetch/metadata/generated/script-element-sec-fetch-mode.https.sub.html diff --git a/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html b/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html new file mode 100644 index 00000000000000..2032ee27c1aa41 --- /dev/null +++ b/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html @@ -0,0 +1,59 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/script-element-sec-fetch-site.sub.html b/fetch/metadata/generated/script-element-sec-fetch-site.sub.html index 64ad25fb2e610b..0fac4f4070f302 100644 --- a/fetch/metadata/generated/script-element-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/script-element-sec-fetch-site.sub.html @@ -2,7 +2,7 @@ - Fetch Metadata - Sec-Fetch-Site - redirection + Fetch Metadata - Sec-Fetch-Site - redirection from HTTP @@ -26,126 +26,6 @@ .then(() => script.remove()); } - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest( - 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path + '&mime=application/javascript', - {} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Origin - classic script'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest( - 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path + '&mime=application/javascript', - {"type": "module"} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Origin - module script'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest( - 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{domains[www2]}}:{{ports[https][0]}}' + path + '&mime=application/javascript', - {} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Site - classic script'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest( - 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{domains[www2]}}:{{ports[https][0]}}' + path + '&mime=application/javascript', - {"type": "module"} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Site - module script'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest( - 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}' + path + '&mime=application/javascript', - {} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Cross-Site - classic script'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest( - 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}' + path + '&mime=application/javascript', - {"type": "module"} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Cross-Site - module script'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest( - 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path + '&mime=application/javascript', - {} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - classic script'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest( - 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path + '&mime=application/javascript', - {"type": "module"} - ) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin - module script'); - promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; return induceRequest( diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.https.sub.html similarity index 100% rename from fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.sub.html rename to fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.https.sub.html diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html new file mode 100644 index 00000000000000..00861c39b0a868 --- /dev/null +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html @@ -0,0 +1,23 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html index 797856f5630bf2..00861c39b0a868 100644 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html @@ -8,54 +8,6 @@ + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html index 6bdbbfdb1ac6af..f9f9ac903c430e 100644 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html @@ -2,7 +2,7 @@ - Fetch Metadata - Sec-Fetch-Site - redirection + Fetch Metadata - Sec-Fetch-Site - redirection from HTTP @@ -25,66 +25,6 @@ .then(() => script.remove()); } - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const moduleId = 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + - encodeURIComponent(path + '&mime=application/javascript'); - - return induceRequest(moduleId) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Origin'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const moduleId = 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{domains[www2]}}:{{ports[https][0]}}' + - encodeURIComponent(path + '&mime=application/javascript'); - - return induceRequest(moduleId) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Site'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const moduleId = 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}' + - encodeURIComponent(path + '&mime=application/javascript'); - - return induceRequest(moduleId) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Cross-Site'); - - promise_test(() => { - const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const moduleId = 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + - encodeURIComponent(path + '&mime=application/javascript'); - - return induceRequest(moduleId) - .then(() => fetch(path + '&retrieve')) - .then((response) => response.text()) - .then((text) => JSON.parse(text)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin'); - promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; const moduleId = 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + diff --git a/fetch/metadata/generated/video-poster-sec-fetch-mode.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html similarity index 100% rename from fetch/metadata/generated/video-poster-sec-fetch-mode.sub.html rename to fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html new file mode 100644 index 00000000000000..454dbfffcc3299 --- /dev/null +++ b/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html @@ -0,0 +1,35 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html index d6ba662c9cf302..4c38aa9e50b182 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html @@ -2,7 +2,7 @@ - Fetch Metadata - Sec-Fetch-Site - redirection + Fetch Metadata - Sec-Fetch-Site - redirection from HTTP @@ -18,58 +18,6 @@ t.add_cleanup(() => video.remove()); } - promise_test((t) => { - const id = '{{uuid()}}'; - const path = '/fetch/metadata/resources/record-headers.py?key=' + id; - - induceRequest(t, 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path); - - return pollForRequestRecording(id) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Origin'); - - promise_test((t) => { - const id = '{{uuid()}}'; - const path = '/fetch/metadata/resources/record-headers.py?key=' + id; - - induceRequest(t, 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{domains[www2]}}:{{ports[https][0]}}' + path); - - return pollForRequestRecording(id) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Site'); - - promise_test((t) => { - const id = '{{uuid()}}'; - const path = '/fetch/metadata/resources/record-headers.py?key=' + id; - - induceRequest(t, 'https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}' + path); - - return pollForRequestRecording(id) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Cross-Site'); - - promise_test((t) => { - const id = '{{uuid()}}'; - const path = '/fetch/metadata/resources/record-headers.py?key=' + id; - - induceRequest(t, 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path); - - return pollForRequestRecording(id) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin'); - promise_test((t) => { const id = '{{uuid()}}'; const path = '/fetch/metadata/resources/record-headers.py?key=' + id; diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index d7231920e88d8f..90c59717d671e8 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -1,28 +1,45 @@ --- -- title: Fetch Metadata - Sec-Fetch-Site - redirection +- title: Fetch Metadata - Sec-Fetch-Site - redirection from HTTP + fileName: sec-fetch-site headerName: sec-fetch-site all_subtests: - - description: Cross-Site -> Same-Origin - pathPrefix: "\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{host}}:{{ports[https][0]}}" - expected: cross-site - - description: Cross-Site -> Same-Site - pathPrefix: "\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{domains[www2]}}:{{ports[https][0]}}" - expected: cross-site - - description: Cross-Site -> Cross-Site - pathPrefix: "\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{hosts[alt][]}}:{{ports[https][0]}}" - expected: cross-site - - description: Same-Origin -> Cross-Site -> Same-Origin + - description: HTTPS downgrade-upgrade pathPrefix: "\ https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - https://{{hosts[alt][]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=\ https://{{host}}:{{ports[https][0]}}" expected: cross-site + each_subtest: + appcache-manifest.sub.https.html: [{}] + fetch.sub.html: [{}] + form-submission.sub.html: + - description: ' - GET' + method: GET + - description: ' - POST' + method: POST + global-properties.sub.html: + - description: ' - location' + api: location + - description: ' - location.href' + api: location.href + - description: ' - location.assign' + api: location.assign + - description: ' - location.replace' + api: location.replace + image.sub.html: [{}] + script-element.sub.html: + - description: ' - classic script' + - description: ' - module script' + elementAttrs: + type: module + script-module-import-dynamic.sub.html: [{}] + script-module-import-static.sub.html: [{}] + video-poster.sub.html: [{}] + +- title: Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + fileName: sec-fetch-site.https + headerName: sec-fetch-site + all_subtests: - description: HTTPS downgrade-upgrade pathPrefix: "\ https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ @@ -57,6 +74,12 @@ video-poster.sub.html: [{}] - title: Fetch Metadata - Sec-Fetch-Mode + # These tests are served over HTTPS so the induced requests will be both + # same-origin with the document [1] and a potentially-trustworthy URL [2]. + # + # [1] https://html.spec.whatwg.org/multipage/origin.html#same-origin + # [2] https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-url + fileName: sec-fetch-mode.https headerName: sec-fetch-mode each_subtest: appcache-manifest.sub.https.html: diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index ae46ce4ba7996f..319376cda1dadc 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -58,7 +58,7 @@ def main(templates_directory, cases_file, out_directory): for template_name, concise_subtests in case['each_subtest'].items(): out_file_name = os.path.join( out_directory, - test_name(template_name, case['headerName']) + test_name(template_name, case['fileName']) ) context = dict( subtests=cross( From 65517a9a7dc1a9cc29d3753a537094eaf8639332 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 10 Dec 2019 19:03:32 -0500 Subject: [PATCH 036/127] Further subdivide redirection tests --- ...-sec-fetch-site-mixed.https.sub.https.html | 52 +++++++++++ ...nifest-sec-fetch-site.https.sub.https.html | 4 +- .../fetch-sec-fetch-site.https.sub.html | 6 +- ...ission-sec-fetch-site-mixed.https.sub.html | 68 ++++++++++++++ ...m-submission-sec-fetch-site.https.sub.html | 8 +- ...erties-sec-fetch-site-mixed.https.sub.html | 90 +++++++++++++++++++ ...l-properties-sec-fetch-site.https.sub.html | 16 ++-- .../image-sec-fetch-site-mixed.https.sub.html | 41 +++++++++ .../image-sec-fetch-site.https.sub.html | 4 +- ...ript-element-sec-fetch-site.https.sub.html | 8 +- ...port-dynamic-sec-fetch-site.https.sub.html | 4 +- ...mport-static-sec-fetch-site.https.sub.html | 4 +- ...poster-sec-fetch-site-mixed.https.sub.html | 35 ++++++++ ...video-poster-sec-fetch-site.https.sub.html | 4 +- fetch/metadata/tools/cases/master.yml | 45 +++++++++- 15 files changed, 357 insertions(+), 32 deletions(-) create mode 100644 fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html create mode 100644 fetch/metadata/generated/form-submission-sec-fetch-site-mixed.https.sub.html create mode 100644 fetch/metadata/generated/global-properties-sec-fetch-site-mixed.https.sub.html create mode 100644 fetch/metadata/generated/image-sec-fetch-site-mixed.https.sub.html create mode 100644 fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html new file mode 100644 index 00000000000000..491e8b5cc81e77 --- /dev/null +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html @@ -0,0 +1,52 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection with mixed content + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html index cb1dc1d57ecb46..d55214df782012 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html @@ -38,7 +38,7 @@ promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path) + return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path) .then(() => fetch(path + '&retrieve')) .then((response) => response.text()) .then((text) => JSON.parse(text)) @@ -46,7 +46,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers[''], ''); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html b/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html index 2217e7dc770e0c..ccaeee1b2c7f13 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html @@ -25,8 +25,8 @@ promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; return fetch( - 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, - {} + 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, + {"mode": "no-cors"} ) .then(() => fetch(path + '&retrieve')) .then((response) => response.text()) @@ -35,7 +35,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-site-mixed.https.sub.html new file mode 100644 index 00000000000000..8114b907ebe186 --- /dev/null +++ b/fetch/metadata/generated/form-submission-sec-fetch-site-mixed.https.sub.html @@ -0,0 +1,68 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection with mixed content + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html index 2a23dc3d71d183..b45e9404287dfa 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html @@ -42,7 +42,7 @@ promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('GET', 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path) + return induceRequest('GET', 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path) .then(() => fetch(path + '&retrieve')) .then((response) => response.text()) .then((text) => JSON.parse(text)) @@ -50,11 +50,11 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - GET'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - GET'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return induceRequest('POST', 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path) + return induceRequest('POST', 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path) .then(() => fetch(path + '&retrieve')) .then((response) => response.text()) .then((text) => JSON.parse(text)) @@ -62,7 +62,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - POST'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - POST'); \ No newline at end of file diff --git a/fetch/metadata/generated/global-properties-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-site-mixed.https.sub.html new file mode 100644 index 00000000000000..bea8fb1d55269d --- /dev/null +++ b/fetch/metadata/generated/global-properties-sec-fetch-site-mixed.https.sub.html @@ -0,0 +1,90 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection with mixed content + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html index 1b3af47f74c413..2b448cf2cb5c4d 100644 --- a/fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html @@ -31,7 +31,7 @@ const navigate = (win, path) => { win.location = path; }; - return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) + return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) .then(() => fetch(path + '&retrieve')) .then((response) => response.text()) .then((text) => JSON.parse(text)) @@ -39,14 +39,14 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - location'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - location'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; const navigate = (win, path) => { win.location.href = path; }; - return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) + return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) .then(() => fetch(path + '&retrieve')) .then((response) => response.text()) .then((text) => JSON.parse(text)) @@ -54,14 +54,14 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.href'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - location.href'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; const navigate = (win, path) => { win.location.assign(path); }; - return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) + return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) .then(() => fetch(path + '&retrieve')) .then((response) => response.text()) .then((text) => JSON.parse(text)) @@ -69,14 +69,14 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.assign'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - location.assign'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; const navigate = (win, path) => { win.location.replace(path); }; - return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) + return induceRequest('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, navigate) .then(() => fetch(path + '&retrieve')) .then((response) => response.text()) .then((text) => JSON.parse(text)) @@ -84,7 +84,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.replace'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - location.replace'); \ No newline at end of file diff --git a/fetch/metadata/generated/image-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/image-sec-fetch-site-mixed.https.sub.html new file mode 100644 index 00000000000000..a1d88a0804ac3d --- /dev/null +++ b/fetch/metadata/generated/image-sec-fetch-site-mixed.https.sub.html @@ -0,0 +1,41 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection with mixed content + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/image-sec-fetch-site.https.sub.html b/fetch/metadata/generated/image-sec-fetch-site.https.sub.html index 947d356c81f00d..8a12638ae732e1 100644 --- a/fetch/metadata/generated/image-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/image-sec-fetch-site.https.sub.html @@ -25,7 +25,7 @@ promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; return induceRequest( - 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, + 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path, {} ) .then(() => fetch(path + '&retrieve')) @@ -35,7 +35,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html b/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html index 2032ee27c1aa41..1feabab3492e3c 100644 --- a/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html @@ -29,7 +29,7 @@ promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; return induceRequest( - 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path + '&mime=application/javascript', + 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path + '&mime=application/javascript', {} ) .then(() => fetch(path + '&retrieve')) @@ -39,12 +39,12 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - classic script'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - classic script'); promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; return induceRequest( - 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path + '&mime=application/javascript', + 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path + '&mime=application/javascript', {"type": "module"} ) .then(() => fetch(path + '&retrieve')) @@ -54,6 +54,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - module script'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - module script'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html index 00861c39b0a868..d456aadb429b7f 100644 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html @@ -10,7 +10,7 @@ promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - return import('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path + '&mime=application/javascript') + return import('https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path + '&mime=application/javascript') .then(() => fetch(path + '&retrieve')) .then((response) => response.text()) .then((text) => JSON.parse(text)) @@ -18,6 +18,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html index 55478e6f1dc034..afd86d305e9e87 100644 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html @@ -27,7 +27,7 @@ promise_test(() => { const path = '/fetch/metadata/resources/record-headers.py?key={{uuid()}}'; - const moduleId = 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + + const moduleId = 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + encodeURIComponent(path + '&mime=application/javascript'); return induceRequest(moduleId) @@ -38,6 +38,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html new file mode 100644 index 00000000000000..ada1c042df3148 --- /dev/null +++ b/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html @@ -0,0 +1,35 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection with mixed content + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html index 454dbfffcc3299..26a7d8e0a60790 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html @@ -22,14 +22,14 @@ const id = '{{uuid()}}'; const path = '/fetch/metadata/resources/record-headers.py?key=' + id; - induceRequest(t, 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path); + induceRequest(t, 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path); return pollForRequestRecording(id) .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 90c59717d671e8..d37fcf9623bf36 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -40,15 +40,15 @@ fileName: sec-fetch-site.https headerName: sec-fetch-site all_subtests: - - description: HTTPS downgrade-upgrade + - description: Same-Origin -> Cross-Site -> Same-Origin redirect pathPrefix: "\ https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ - http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ https://{{host}}:{{ports[https][0]}}" expected: cross-site each_subtest: appcache-manifest.sub.https.html: [{}] - fetch.sub.html: [{}] + fetch.sub.html: [{ init: { mode: no-cors } }] form-submission.sub.html: - description: ' - GET' method: GET @@ -73,6 +73,45 @@ script-module-import-static.sub.html: [{}] video-poster.sub.html: [{}] +- title: Fetch Metadata - Sec-Fetch-Site - redirection with mixed content + # These tests verify the effect that redirection has on the request's "site". + # The initial request must be made to a resource that is "same-site" with its + # origin. This avoids false positives because if the request were made to a + # cross-site resource, the value of "cross-site" would be assigned regardless + # of the subseqent redirection. + # + # Because these conditions necessarily warrant mixed content, only templates + # which can be configured to allow mixed content [1] can be used. + # + # [1] https://w3c.github.io/webappsec-mixed-content/#should-block-fetch + fileName: sec-fetch-site-mixed.https + headerName: sec-fetch-site + all_subtests: + - description: HTTPS downgrade-upgrade + pathPrefix: "\ + https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=\ + http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=\ + https://{{host}}:{{ports[https][0]}}" + expected: cross-site + each_subtest: + appcache-manifest.sub.https.html: [{}] + form-submission.sub.html: + - description: ' - GET' + method: GET + - description: ' - POST' + method: POST + global-properties.sub.html: + - description: ' - location' + api: location + - description: ' - location.href' + api: location.href + - description: ' - location.assign' + api: location.assign + - description: ' - location.replace' + api: location.replace + image.sub.html: [{}] + video-poster.sub.html: [{}] + - title: Fetch Metadata - Sec-Fetch-Mode # These tests are served over HTTPS so the induced requests will be both # same-origin with the document [1] and a potentially-trustworthy URL [2]. From ed424a6b5edec8b7c12f1dd7105584cb0044c809 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 10 Dec 2019 19:04:36 -0500 Subject: [PATCH 037/127] Correct construction of form requests --- .../generated/form-submission-sec-fetch-mode.https.sub.html | 6 ++---- .../form-submission-sec-fetch-site-mixed.https.sub.html | 6 ++---- .../generated/form-submission-sec-fetch-site.https.sub.html | 6 ++---- .../generated/form-submission-sec-fetch-site.sub.html | 6 ++---- fetch/metadata/tools/templates/form-submission.sub.html | 6 ++---- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/fetch/metadata/generated/form-submission-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-mode.https.sub.html index 8dedf0947160d7..f68ff0ed005f4c 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-mode.https.sub.html @@ -11,10 +11,8 @@ function induceRequest(method, path) { const win = window.open(); - const inputs = [ - ['body', ` + + + +
test
+ + + \ No newline at end of file diff --git a/fetch/metadata/generated/font-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/font-sec-fetch-site-mixed.https.sub.html new file mode 100644 index 00000000000000..769f3ca5f4f892 --- /dev/null +++ b/fetch/metadata/generated/font-sec-fetch-site-mixed.https.sub.html @@ -0,0 +1,45 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection with mixed content + + + + +
test
+ + + \ No newline at end of file diff --git a/fetch/metadata/generated/font-sec-fetch-site.https.sub.html b/fetch/metadata/generated/font-sec-fetch-site.https.sub.html new file mode 100644 index 00000000000000..151874fd78dea7 --- /dev/null +++ b/fetch/metadata/generated/font-sec-fetch-site.https.sub.html @@ -0,0 +1,45 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + + + + +
test
+ + + \ No newline at end of file diff --git a/fetch/metadata/generated/font-sec-fetch-site.sub.html b/fetch/metadata/generated/font-sec-fetch-site.sub.html new file mode 100644 index 00000000000000..09fa57f54a7794 --- /dev/null +++ b/fetch/metadata/generated/font-sec-fetch-site.sub.html @@ -0,0 +1,45 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection from HTTP + + + + +
test
+ + + \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index d37fcf9623bf36..17b8282936094b 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -12,6 +12,7 @@ each_subtest: appcache-manifest.sub.https.html: [{}] fetch.sub.html: [{}] + font.sub.html: [{}] form-submission.sub.html: - description: ' - GET' method: GET @@ -49,6 +50,7 @@ each_subtest: appcache-manifest.sub.https.html: [{}] fetch.sub.html: [{ init: { mode: no-cors } }] + font.sub.html: [{}] form-submission.sub.html: - description: ' - GET' method: GET @@ -135,6 +137,8 @@ - description: 'mode: same-origin' expected: same-origin init: { mode: same-origin } + font.sub.html: + - expected: cors form-submission.sub.html: - description: GET method: GET diff --git a/fetch/metadata/tools/templates/font.sub.html b/fetch/metadata/tools/templates/font.sub.html new file mode 100644 index 00000000000000..eda5860fbc3d8b --- /dev/null +++ b/fetch/metadata/tools/templates/font.sub.html @@ -0,0 +1,53 @@ + + + + + [%title%] + + + + +
test
+ + + From 09bd2d9a138b9d45b359ab2b3d77b4607c06149e Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 10 Dec 2019 19:23:22 -0500 Subject: [PATCH 039/127] Improve formatting slightly --- fetch/metadata/tools/cases/master.yml | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 17b8282936094b..a3b377d71da2af 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -31,8 +31,7 @@ script-element.sub.html: - description: ' - classic script' - description: ' - module script' - elementAttrs: - type: module + elementAttrs: { type: module } script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] video-poster.sub.html: [{}] @@ -69,8 +68,7 @@ script-element.sub.html: - description: ' - classic script' - description: ' - module script' - elementAttrs: - type: module + elementAttrs: { type: module } script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] video-poster.sub.html: [{}] @@ -164,35 +162,28 @@ expected: no-cors - description: crossorigin="" expected: cors - elementAttrs: - crossorigin: '' + elementAttrs: { crossorigin: '' } - description: crossorigin="anonymous" expected: cors - elementAttrs: - crossorigin: anonymous + elementAttrs: { crossorigin: anonymous } - description: crossorigin="use-credentials" expected: cors - elementAttrs: - crossorigin: use-credentials + elementAttrs: { crossorigin: use-credentials } script-element.sub.html: - description: classic script expected: no-cors - description: module script expected: cors - elementAttrs: - type: module + elementAttrs: { type: module } - description: classic script, crossorigin="" expected: cors - elementAttrs: - crossorigin: '' + elementAttrs: { crossorigin: '' } - description: classic script, crossorigin="anonymous" expected: cors - elementAttrs: - crossorigin: anonymous + elementAttrs: { crossorigin: anonymous } - description: classic script, crossorigin="use-credentials" expected: cors - elementAttrs: - crossorigin: use-credentials + elementAttrs: { crossorigin: use-credentials } script-module-import-dynamic.sub.html: - expected: cors script-module-import-static.sub.html: From f83470441751fd68077ed9ece00aed7da453cb8f Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 10 Dec 2019 19:44:11 -0500 Subject: [PATCH 040/127] Remove dead code --- .../generated/fetch-sec-fetch-mode.https.sub.html | 13 ------------- .../generated/fetch-sec-fetch-site.https.sub.html | 13 ------------- .../generated/fetch-sec-fetch-site.sub.html | 13 ------------- fetch/metadata/tools/templates/fetch.sub.html | 13 ------------- 4 files changed, 52 deletions(-) diff --git a/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html index 1b4ca45a9eafd3..fdb953fa684f9e 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html @@ -9,19 +9,6 @@ + + + + + \ No newline at end of file diff --git a/fetch/metadata/resources/record-headers.py b/fetch/metadata/resources/record-headers.py index e45403862f0ebb..7774fd8a8f8982 100644 --- a/fetch/metadata/resources/record-headers.py +++ b/fetch/metadata/resources/record-headers.py @@ -5,8 +5,12 @@ import json def main(request, response): - ## Get the query parameter (key) from URL ## - ## Tests will record POST requests (CSP Report) and GET (rest) ## + # This condition avoids false positives from CORS preflight checks, where the + # request under test may be followed immediately by a request to the same URL + # using a different HTTP method. + if 'requireOPTIONS' in request.GET and request.method != 'OPTIONS': + return + if 'key' in request.GET: key = request.GET['key'] elif 'key' in request.POST: diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index a3b377d71da2af..1cf12254b010fc 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -123,6 +123,8 @@ each_subtest: appcache-manifest.sub.https.html: - expected: no-cors + cors-preflight.sub.html: + - expected: cors fetch.sub.html: - description: no options expected: cors diff --git a/fetch/metadata/tools/templates/cors-preflight.sub.html b/fetch/metadata/tools/templates/cors-preflight.sub.html new file mode 100644 index 00000000000000..1c71703b8b5393 --- /dev/null +++ b/fetch/metadata/tools/templates/cors-preflight.sub.html @@ -0,0 +1,38 @@ + + + + + [%title%] + + + + + + From 01210aad63013afaa8b6ab20c7e191ee7899920f Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 12 Dec 2019 12:50:20 -0500 Subject: [PATCH 042/127] Add README file --- fetch/metadata/tools/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 fetch/metadata/tools/README.md diff --git a/fetch/metadata/tools/README.md b/fetch/metadata/tools/README.md new file mode 100644 index 00000000000000..929b20a9f59b5f --- /dev/null +++ b/fetch/metadata/tools/README.md @@ -0,0 +1,16 @@ +# Fetch Metadata test generation framework + +This directory defines a tool for procedurally generating WPT tests. It is +currently under development, so documentation is minimal. + +To run: + +- [Install Python 3](https://www.python.org/download/releases/3.0/) +- Install Python dependencies with the following command (issued from the + directory containing this document): + + $ pip install -r ./requirements.txt + +- Invoke the executable: + + $ python3 ./generate.py From 7225a11e6613a992308569946a14d07aeb40e5c9 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 12 Dec 2019 15:53:54 -0500 Subject: [PATCH 043/127] Add initial tests for Sec-Fetch-Dest --- ...che-manifest-sec-fetch-dest.sub.https.html | 52 +++++++++++ .../cors-preflight-sec-fetch-dest.sub.html | 30 +++++++ .../generated/fetch-sec-fetch-dest.sub.html | 28 ++++++ ....sub.html => font-sec-fetch-dest.sub.html} | 10 +-- .../form-submission-sec-fetch-dest.sub.html | 66 ++++++++++++++ .../global-properties-sec-fetch-dest.sub.html | 90 +++++++++++++++++++ .../generated/image-sec-fetch-dest.sub.html | 41 +++++++++ .../script-element-sec-fetch-dest.sub.html | 44 +++++++++ ...ule-import-dynamic-sec-fetch-dest.sub.html | 23 +++++ ...dule-import-static-sec-fetch-dest.sub.html | 43 +++++++++ .../video-poster-sec-fetch-dest.sub.html | 35 ++++++++ fetch/metadata/tools/cases/master.yml | 43 +++++++++ 12 files changed, 500 insertions(+), 5 deletions(-) create mode 100644 fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html create mode 100644 fetch/metadata/generated/cors-preflight-sec-fetch-dest.sub.html create mode 100644 fetch/metadata/generated/fetch-sec-fetch-dest.sub.html rename fetch/metadata/generated/{font-sec-fetch-site-mixed.https.sub.html => font-sec-fetch-dest.sub.html} (66%) create mode 100644 fetch/metadata/generated/form-submission-sec-fetch-dest.sub.html create mode 100644 fetch/metadata/generated/global-properties-sec-fetch-dest.sub.html create mode 100644 fetch/metadata/generated/image-sec-fetch-dest.sub.html create mode 100644 fetch/metadata/generated/script-element-sec-fetch-dest.sub.html create mode 100644 fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.sub.html create mode 100644 fetch/metadata/generated/script-module-import-static-sec-fetch-dest.sub.html create mode 100644 fetch/metadata/generated/video-poster-sec-fetch-dest.sub.html diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html new file mode 100644 index 00000000000000..1d1552f408999b --- /dev/null +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html @@ -0,0 +1,52 @@ + + + + + Fetch Metadata - Sec-Fetch-Dest + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/cors-preflight-sec-fetch-dest.sub.html b/fetch/metadata/generated/cors-preflight-sec-fetch-dest.sub.html new file mode 100644 index 00000000000000..02271ca43cad95 --- /dev/null +++ b/fetch/metadata/generated/cors-preflight-sec-fetch-dest.sub.html @@ -0,0 +1,30 @@ + + + + + Fetch Metadata - Sec-Fetch-Dest + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-dest.sub.html b/fetch/metadata/generated/fetch-sec-fetch-dest.sub.html new file mode 100644 index 00000000000000..e7333159fb8df1 --- /dev/null +++ b/fetch/metadata/generated/fetch-sec-fetch-dest.sub.html @@ -0,0 +1,28 @@ + + + + + Fetch Metadata - Sec-Fetch-Dest + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/font-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/font-sec-fetch-dest.sub.html similarity index 66% rename from fetch/metadata/generated/font-sec-fetch-site-mixed.https.sub.html rename to fetch/metadata/generated/font-sec-fetch-dest.sub.html index 769f3ca5f4f892..ca6f9b9d331da2 100644 --- a/fetch/metadata/generated/font-sec-fetch-site-mixed.https.sub.html +++ b/fetch/metadata/generated/font-sec-fetch-dest.sub.html @@ -2,7 +2,7 @@ - Fetch Metadata - Sec-Fetch-Site - redirection with mixed content + Fetch Metadata - Sec-Fetch-Dest @@ -32,14 +32,14 @@ const id = '{{uuid()}}'; const path = '/fetch/metadata/resources/record-headers.py?key=' + id; - induceRequest(t, 'https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http://{{host}}:{{ports[http][0]}}/fetch/api/resources/redirect.py?location=https://{{host}}:{{ports[https][0]}}' + path); + induceRequest(t, '' + path); return pollForRequestRecording(id) .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); + assert_own_property(headers, 'sec-fetch-dest'); + assert_equals(headers['sec-fetch-dest'], 'font'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'sec-fetch-dest - '); \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-dest.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-dest.sub.html new file mode 100644 index 00000000000000..310255f76b6a5c --- /dev/null +++ b/fetch/metadata/generated/form-submission-sec-fetch-dest.sub.html @@ -0,0 +1,66 @@ + + + + + Fetch Metadata - Sec-Fetch-Dest + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/global-properties-sec-fetch-dest.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-dest.sub.html new file mode 100644 index 00000000000000..8442893803aaa9 --- /dev/null +++ b/fetch/metadata/generated/global-properties-sec-fetch-dest.sub.html @@ -0,0 +1,90 @@ + + + + + Fetch Metadata - Sec-Fetch-Dest + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/image-sec-fetch-dest.sub.html b/fetch/metadata/generated/image-sec-fetch-dest.sub.html new file mode 100644 index 00000000000000..900aa1c405784f --- /dev/null +++ b/fetch/metadata/generated/image-sec-fetch-dest.sub.html @@ -0,0 +1,41 @@ + + + + + Fetch Metadata - Sec-Fetch-Dest + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/script-element-sec-fetch-dest.sub.html b/fetch/metadata/generated/script-element-sec-fetch-dest.sub.html new file mode 100644 index 00000000000000..3b765d19a227da --- /dev/null +++ b/fetch/metadata/generated/script-element-sec-fetch-dest.sub.html @@ -0,0 +1,44 @@ + + + + + Fetch Metadata - Sec-Fetch-Dest + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.sub.html new file mode 100644 index 00000000000000..74c8beb9b9ea22 --- /dev/null +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.sub.html @@ -0,0 +1,23 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.sub.html new file mode 100644 index 00000000000000..407dd28d22e621 --- /dev/null +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.sub.html @@ -0,0 +1,43 @@ + + + + + Fetch Metadata - Sec-Fetch-Dest + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-dest.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-dest.sub.html new file mode 100644 index 00000000000000..e4cfc0db75b23b --- /dev/null +++ b/fetch/metadata/generated/video-poster-sec-fetch-dest.sub.html @@ -0,0 +1,35 @@ + + + + + Fetch Metadata - Sec-Fetch-Dest + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 1cf12254b010fc..7bbca504eed67c 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -192,3 +192,46 @@ - expected: cors video-poster.sub.html: - expected: no-cors + +- title: Fetch Metadata - Sec-Fetch-Dest + fileName: sec-fetch-dest + headerName: sec-fetch-dest + each_subtest: + appcache-manifest.sub.https.html: + - expected: empty + cors-preflight.sub.html: + - expected: empty + fetch.sub.html: + - expected: empty + font.sub.html: + - expected: font + form-submission.sub.html: + - description: ' - GET' + method: GET + expected: document + - description: ' - POST' + method: POST + expected: document + global-properties.sub.html: + - description: location + api: location + expected: document + - description: location.href + api: location.href + expected: document + - description: location.assign + api: location.assign + expected: document + - description: location.replace + api: location.replace + expected: document + image.sub.html: + - expected: image + script-element.sub.html: + - expected: script + script-module-import-dynamic.sub.html: + - expected: script + script-module-import-static.sub.html: + - expected: script + video-poster.sub.html: + - expected: image From 011df0484027494bacaf67d8797517b7885c90ad Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 12 Dec 2019 15:54:33 -0500 Subject: [PATCH 044/127] Add tests for dedicated workers --- ...icated-constructor-sec-fetch-dest.sub.html | 45 ++++++++++++++++++ ...ated-importscripts-sec-fetch-dest.sub.html | 35 ++++++++++++++ fetch/metadata/tools/cases/master.yml | 11 +++++ .../worker-dedicated-constructor.sub.html | 44 +++++++++++++++++ .../worker-dedicated-importscripts.sub.html | 47 +++++++++++++++++++ 5 files changed, 182 insertions(+) create mode 100644 fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.sub.html create mode 100644 fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.sub.html create mode 100644 fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html create mode 100644 fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.sub.html new file mode 100644 index 00000000000000..4030158b6e6e45 --- /dev/null +++ b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.sub.html @@ -0,0 +1,45 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.sub.html new file mode 100644 index 00000000000000..5bc71acd58d8e3 --- /dev/null +++ b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.sub.html @@ -0,0 +1,35 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 7bbca504eed67c..27f9244db355fc 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -235,3 +235,14 @@ - expected: script video-poster.sub.html: - expected: image + worker-dedicated-constructor.sub.html: + - description: classic script + pathPrefix: https://{{host}}:{{ports[https][0]}} + expected: worker + - description: module script + options: { type: module } + pathPrefix: https://{{host}}:{{ports[https][0]}} + expected: worker + worker-dedicated-importscripts.sub.html: + - pathPrefix: https://{{host}}:{{ports[https][0]}} + expected: script diff --git a/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html b/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html new file mode 100644 index 00000000000000..8c6a3af43fc31f --- /dev/null +++ b/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html @@ -0,0 +1,44 @@ + + + + + + + + + diff --git a/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html b/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html new file mode 100644 index 00000000000000..877cc2ab1ca32c --- /dev/null +++ b/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html @@ -0,0 +1,47 @@ + + + + + + + + + From 949baf0ba1393e7db98095b1de4bc01d9984428c Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 12 Dec 2019 21:45:08 -0500 Subject: [PATCH 045/127] Add support to make URL construction more concise --- ...che-manifest-sec-fetch-dest.sub.https.html | 19 +++-- ...nifest-sec-fetch-mode.https.sub.https.html | 19 +++-- ...-sec-fetch-site-mixed.https.sub.https.html | 19 +++-- ...nifest-sec-fetch-site.https.sub.https.html | 19 +++-- ...che-manifest-sec-fetch-site.sub.https.html | 19 +++-- .../cors-preflight-sec-fetch-dest.sub.html | 16 ++--- ...rs-preflight-sec-fetch-mode.https.sub.html | 16 ++--- .../generated/fetch-sec-fetch-dest.sub.html | 10 +-- .../fetch-sec-fetch-mode.https.sub.html | 37 +++++----- .../fetch-sec-fetch-site.https.sub.html | 10 +-- .../generated/fetch-sec-fetch-site.sub.html | 10 +-- .../generated/font-sec-fetch-dest.sub.html | 9 ++- .../font-sec-fetch-mode.https.sub.html | 9 ++- .../font-sec-fetch-site.https.sub.html | 9 ++- .../generated/font-sec-fetch-site.sub.html | 9 ++- .../form-submission-sec-fetch-dest.sub.html | 32 +++++---- ...m-submission-sec-fetch-mode.https.sub.html | 32 +++++---- ...ission-sec-fetch-site-mixed.https.sub.html | 32 +++++---- ...m-submission-sec-fetch-site.https.sub.html | 32 +++++---- .../form-submission-sec-fetch-site.sub.html | 32 +++++---- .../global-properties-sec-fetch-dest.sub.html | 51 +++++++------ ...l-properties-sec-fetch-mode.https.sub.html | 51 +++++++------ ...erties-sec-fetch-site-mixed.https.sub.html | 51 +++++++------ ...l-properties-sec-fetch-site.https.sub.html | 51 +++++++------ .../global-properties-sec-fetch-site.sub.html | 51 +++++++------ .../generated/image-sec-fetch-dest.sub.html | 14 ++-- .../image-sec-fetch-mode.https.sub.html | 41 +++++------ .../image-sec-fetch-site-mixed.https.sub.html | 14 ++-- .../image-sec-fetch-site.https.sub.html | 14 ++-- .../generated/image-sec-fetch-site.sub.html | 14 ++-- .../script-element-sec-fetch-dest.sub.html | 19 ++--- ...ript-element-sec-fetch-mode.https.sub.html | 71 ++++++++++--------- ...ript-element-sec-fetch-site.https.sub.html | 32 +++++---- .../script-element-sec-fetch-site.sub.html | 32 +++++---- ...ule-import-dynamic-sec-fetch-dest.sub.html | 14 ++-- ...port-dynamic-sec-fetch-mode.https.sub.html | 14 ++-- ...port-dynamic-sec-fetch-site.https.sub.html | 14 ++-- ...ule-import-dynamic-sec-fetch-site.sub.html | 14 ++-- ...dule-import-static-sec-fetch-dest.sub.html | 21 +++--- ...mport-static-sec-fetch-mode.https.sub.html | 21 +++--- ...mport-static-sec-fetch-site.https.sub.html | 21 +++--- ...dule-import-static-sec-fetch-site.sub.html | 21 +++--- .../video-poster-sec-fetch-dest.sub.html | 15 ++-- ...video-poster-sec-fetch-mode.https.sub.html | 15 ++-- ...poster-sec-fetch-site-mixed.https.sub.html | 15 ++-- ...video-poster-sec-fetch-site.https.sub.html | 15 ++-- .../video-poster-sec-fetch-site.sub.html | 15 ++-- ...icated-constructor-sec-fetch-dest.sub.html | 31 ++++---- ...ated-importscripts-sec-fetch-dest.sub.html | 24 ++++--- fetch/metadata/resources/helper.js | 21 ------ fetch/metadata/resources/helper.sub.js | 44 ++++++++++++ fetch/metadata/resources/record-headers.py | 14 ++-- fetch/metadata/tools/cases/master.yml | 21 ++---- fetch/metadata/tools/generate.py | 2 + .../appcache-manifest.sub.https.html | 19 +++-- .../tools/templates/cors-preflight.sub.html | 18 ++--- fetch/metadata/tools/templates/fetch.sub.html | 10 +-- fetch/metadata/tools/templates/font.sub.html | 9 ++- .../tools/templates/form-submission.sub.html | 27 +++---- .../templates/global-properties.sub.html | 21 +++--- fetch/metadata/tools/templates/image.sub.html | 14 ++-- .../tools/templates/script-element.sub.html | 19 ++--- .../script-module-import-dynamic.sub.html | 14 ++-- .../script-module-import-static.sub.html | 21 +++--- .../tools/templates/video-poster.sub.html | 15 ++-- .../worker-dedicated-constructor.sub.html | 18 ++--- .../worker-dedicated-importscripts.sub.html | 24 ++++--- 67 files changed, 784 insertions(+), 713 deletions(-) create mode 100644 fetch/metadata/resources/helper.sub.js diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html index 1d1552f408999b..c562f241a81f0c 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html @@ -5,18 +5,16 @@ Fetch Metadata - Sec-Fetch-Dest + + + + + + + + + + + - +
test
- +
test
- +
test
- +
test
+ + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html index dd6d25e5693174..99729faf9dc150 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html @@ -5,30 +5,29 @@ Fetch Metadata - Sec-Fetch-Mode - + diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html index ada1c042df3148..37b5addcabf4da 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html @@ -5,30 +5,29 @@ Fetch Metadata - Sec-Fetch-Site - redirection with mixed content - + diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html index 26a7d8e0a60790..7f0f893b7e7e9e 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html @@ -5,30 +5,29 @@ Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS - + diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html index 4c38aa9e50b182..fb8a33f52ea9e3 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html @@ -5,30 +5,29 @@ Fetch Metadata - Sec-Fetch-Site - redirection from HTTP - + diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.sub.html index 4030158b6e6e45..c198829c31c6b3 100644 --- a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.sub.html +++ b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.sub.html @@ -4,11 +4,10 @@ - + - + + + + - +
test
- {%- for script in scripts %} - - {%- endfor %} + + + - + - + - + - + - + - + \ No newline at end of file diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html index 83b957953c0d2a..6dfd7e25e3d720 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html @@ -43,7 +43,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers[''], ''); }); - }, 'sec-fetch-mode - '); + }, ''); \ No newline at end of file diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html index a4d65fcdb8985f..92b2ca2d60b90c 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html @@ -43,7 +43,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers[''], ''); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html index 78c975165a6883..4cd3b93830e433 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html @@ -43,7 +43,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers[''], ''); }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); \ No newline at end of file diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html index 421c52ee6c9a91..0360df706ea34e 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html @@ -43,7 +43,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers[''], ''); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/cors-preflight-sec-fetch-dest.sub.html b/fetch/metadata/generated/cors-preflight-sec-fetch-dest.sub.html index 634cb94c8cb14f..0ffe2193a70880 100644 --- a/fetch/metadata/generated/cors-preflight-sec-fetch-dest.sub.html +++ b/fetch/metadata/generated/cors-preflight-sec-fetch-dest.sub.html @@ -24,7 +24,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'empty'); }); - }, 'sec-fetch-dest - '); + }, ''); \ No newline at end of file diff --git a/fetch/metadata/generated/cors-preflight-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/cors-preflight-sec-fetch-mode.https.sub.html index 6a81b7a1ee8340..2bdf7e643039c5 100644 --- a/fetch/metadata/generated/cors-preflight-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/cors-preflight-sec-fetch-mode.https.sub.html @@ -24,7 +24,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - '); + }, ''); \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-dest.sub.html b/fetch/metadata/generated/fetch-sec-fetch-dest.sub.html index 2432c1c4879303..5eab39cebcb32c 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-dest.sub.html +++ b/fetch/metadata/generated/fetch-sec-fetch-dest.sub.html @@ -22,7 +22,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'empty'); }); - }, 'sec-fetch-dest - '); + }, ''); \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html index 50483d9a5f5a42..634a02a0755b68 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html @@ -22,7 +22,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - no options'); + }, 'no options'); promise_test(() => { const key = '{{uuid()}}'; @@ -36,7 +36,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - mode: cors'); + }, 'mode: cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -50,7 +50,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'no-cors'); }); - }, 'sec-fetch-mode - mode: no-cors'); + }, 'mode: no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -64,7 +64,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'same-origin'); }); - }, 'sec-fetch-mode - mode: same-origin'); + }, 'mode: same-origin'); \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html b/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html index fe63469437e709..ef25ca6ab647cb 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html @@ -22,7 +22,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-site.sub.html b/fetch/metadata/generated/fetch-sec-fetch-site.sub.html index 4168c7035f8df6..55176dfc4b4233 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/fetch-sec-fetch-site.sub.html @@ -22,7 +22,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/font-sec-fetch-dest.sub.html b/fetch/metadata/generated/font-sec-fetch-dest.sub.html index 83f1b0af0b1533..8d5ff607468c55 100644 --- a/fetch/metadata/generated/font-sec-fetch-dest.sub.html +++ b/fetch/metadata/generated/font-sec-fetch-dest.sub.html @@ -38,7 +38,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'font'); }); - }, 'sec-fetch-dest - '); + }, ''); \ No newline at end of file diff --git a/fetch/metadata/generated/font-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/font-sec-fetch-mode.https.sub.html index 8e008eb1b53490..a57c93a0ee9adc 100644 --- a/fetch/metadata/generated/font-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/font-sec-fetch-mode.https.sub.html @@ -38,7 +38,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - '); + }, ''); \ No newline at end of file diff --git a/fetch/metadata/generated/font-sec-fetch-site.https.sub.html b/fetch/metadata/generated/font-sec-fetch-site.https.sub.html index fcd73780ffa852..aed861a6f0eb29 100644 --- a/fetch/metadata/generated/font-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/font-sec-fetch-site.https.sub.html @@ -38,7 +38,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); \ No newline at end of file diff --git a/fetch/metadata/generated/font-sec-fetch-site.sub.html b/fetch/metadata/generated/font-sec-fetch-site.sub.html index 029e75f6999742..fc4d0bcc80ca9c 100644 --- a/fetch/metadata/generated/font-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/font-sec-fetch-site.sub.html @@ -38,7 +38,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-dest.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-dest.sub.html index a0b0111716dfa0..e97e686face2ce 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-dest.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-dest.sub.html @@ -53,7 +53,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'document'); }); - }, 'sec-fetch-dest - - GET'); + }, ' - GET'); promise_test(() => { const key = '{{uuid()}}'; @@ -64,7 +64,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'document'); }); - }, 'sec-fetch-dest - - POST'); + }, ' - POST'); \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-mode.https.sub.html index b2b6a1ad3a1ac5..8d68efd0acdc01 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-mode.https.sub.html @@ -53,7 +53,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'navigate'); }); - }, 'sec-fetch-mode - GET'); + }, 'GET'); promise_test(() => { const key = '{{uuid()}}'; @@ -64,7 +64,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'navigate'); }); - }, 'sec-fetch-mode - POST'); + }, 'POST'); \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-site-mixed.https.sub.html index da06ba565c2bce..70ec233c7c2168 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-site-mixed.https.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-site-mixed.https.sub.html @@ -53,7 +53,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - GET'); + }, 'HTTPS downgrade-upgrade - GET'); promise_test(() => { const key = '{{uuid()}}'; @@ -64,7 +64,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - POST'); + }, 'HTTPS downgrade-upgrade - POST'); \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html index 1714b5152a3264..f3fec464bdbe25 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html @@ -53,7 +53,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - GET'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect - GET'); promise_test(() => { const key = '{{uuid()}}'; @@ -64,7 +64,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - POST'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect - POST'); \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html index 24479b2b947eb8..32e7a45e642869 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html @@ -53,7 +53,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - GET'); + }, 'HTTPS downgrade-upgrade - GET'); promise_test(() => { const key = '{{uuid()}}'; @@ -64,7 +64,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - POST'); + }, 'HTTPS downgrade-upgrade - POST'); \ No newline at end of file diff --git a/fetch/metadata/generated/global-properties-sec-fetch-dest.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-dest.sub.html index 9f12c26bef1d28..d265769ec0f16f 100644 --- a/fetch/metadata/generated/global-properties-sec-fetch-dest.sub.html +++ b/fetch/metadata/generated/global-properties-sec-fetch-dest.sub.html @@ -44,7 +44,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'document'); }); - }, 'sec-fetch-dest - location'); + }, 'location'); promise_test(() => { const key = '{{uuid()}}'; @@ -59,7 +59,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'document'); }); - }, 'sec-fetch-dest - location.href'); + }, 'location.href'); promise_test(() => { const key = '{{uuid()}}'; @@ -74,7 +74,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'document'); }); - }, 'sec-fetch-dest - location.assign'); + }, 'location.assign'); promise_test(() => { const key = '{{uuid()}}'; @@ -89,7 +89,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'document'); }); - }, 'sec-fetch-dest - location.replace'); + }, 'location.replace'); \ No newline at end of file diff --git a/fetch/metadata/generated/global-properties-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-mode.https.sub.html index f313e3021d4a1a..f367578a866305 100644 --- a/fetch/metadata/generated/global-properties-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/global-properties-sec-fetch-mode.https.sub.html @@ -44,7 +44,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'navigate'); }); - }, 'sec-fetch-mode - location'); + }, 'location'); promise_test(() => { const key = '{{uuid()}}'; @@ -59,7 +59,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'navigate'); }); - }, 'sec-fetch-mode - location.href'); + }, 'location.href'); promise_test(() => { const key = '{{uuid()}}'; @@ -74,7 +74,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'navigate'); }); - }, 'sec-fetch-mode - location.assign'); + }, 'location.assign'); promise_test(() => { const key = '{{uuid()}}'; @@ -89,7 +89,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'navigate'); }); - }, 'sec-fetch-mode - location.replace'); + }, 'location.replace'); \ No newline at end of file diff --git a/fetch/metadata/generated/global-properties-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-site-mixed.https.sub.html index fdbc37a94e807f..fd3ecf523b2dc4 100644 --- a/fetch/metadata/generated/global-properties-sec-fetch-site-mixed.https.sub.html +++ b/fetch/metadata/generated/global-properties-sec-fetch-site-mixed.https.sub.html @@ -44,7 +44,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - location'); + }, 'HTTPS downgrade-upgrade - location'); promise_test(() => { const key = '{{uuid()}}'; @@ -59,7 +59,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.href'); + }, 'HTTPS downgrade-upgrade - location.href'); promise_test(() => { const key = '{{uuid()}}'; @@ -74,7 +74,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.assign'); + }, 'HTTPS downgrade-upgrade - location.assign'); promise_test(() => { const key = '{{uuid()}}'; @@ -89,7 +89,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.replace'); + }, 'HTTPS downgrade-upgrade - location.replace'); \ No newline at end of file diff --git a/fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html index c44c5761924fb0..70fc7404ab3d6e 100644 --- a/fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html @@ -44,7 +44,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - location'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect - location'); promise_test(() => { const key = '{{uuid()}}'; @@ -59,7 +59,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - location.href'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect - location.href'); promise_test(() => { const key = '{{uuid()}}'; @@ -74,7 +74,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - location.assign'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect - location.assign'); promise_test(() => { const key = '{{uuid()}}'; @@ -89,7 +89,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - location.replace'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect - location.replace'); \ No newline at end of file diff --git a/fetch/metadata/generated/global-properties-sec-fetch-site.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-site.sub.html index a9eaf43e9bf44d..adccb89c4fc437 100644 --- a/fetch/metadata/generated/global-properties-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/global-properties-sec-fetch-site.sub.html @@ -44,7 +44,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - location'); + }, 'HTTPS downgrade-upgrade - location'); promise_test(() => { const key = '{{uuid()}}'; @@ -59,7 +59,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.href'); + }, 'HTTPS downgrade-upgrade - location.href'); promise_test(() => { const key = '{{uuid()}}'; @@ -74,7 +74,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.assign'); + }, 'HTTPS downgrade-upgrade - location.assign'); promise_test(() => { const key = '{{uuid()}}'; @@ -89,7 +89,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.replace'); + }, 'HTTPS downgrade-upgrade - location.replace'); \ No newline at end of file diff --git a/fetch/metadata/generated/image-sec-fetch-dest.sub.html b/fetch/metadata/generated/image-sec-fetch-dest.sub.html index 973e329b2fcb3f..16299d0939d6b9 100644 --- a/fetch/metadata/generated/image-sec-fetch-dest.sub.html +++ b/fetch/metadata/generated/image-sec-fetch-dest.sub.html @@ -35,7 +35,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'image'); }); - }, 'sec-fetch-dest - '); + }, ''); \ No newline at end of file diff --git a/fetch/metadata/generated/image-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/image-sec-fetch-mode.https.sub.html index 7a4136f95a82d3..9c5a15bb217116 100644 --- a/fetch/metadata/generated/image-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/image-sec-fetch-mode.https.sub.html @@ -35,7 +35,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'no-cors'); }); - }, 'sec-fetch-mode - no attributes'); + }, 'no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -49,7 +49,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - crossorigin=""'); + }, 'crossorigin=""'); promise_test(() => { const key = '{{uuid()}}'; @@ -63,7 +63,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - crossorigin="anonymous"'); + }, 'crossorigin="anonymous"'); promise_test(() => { const key = '{{uuid()}}'; @@ -77,7 +77,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - crossorigin="use-credentials"'); + }, 'crossorigin="use-credentials"'); \ No newline at end of file diff --git a/fetch/metadata/generated/image-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/image-sec-fetch-site-mixed.https.sub.html index 791b6da3847422..c11c18e20f4fc1 100644 --- a/fetch/metadata/generated/image-sec-fetch-site-mixed.https.sub.html +++ b/fetch/metadata/generated/image-sec-fetch-site-mixed.https.sub.html @@ -35,7 +35,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/image-sec-fetch-site.https.sub.html b/fetch/metadata/generated/image-sec-fetch-site.https.sub.html index 37f4f3e145ac93..5dcbaab38ccd6c 100644 --- a/fetch/metadata/generated/image-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/image-sec-fetch-site.https.sub.html @@ -35,7 +35,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); \ No newline at end of file diff --git a/fetch/metadata/generated/image-sec-fetch-site.sub.html b/fetch/metadata/generated/image-sec-fetch-site.sub.html index 5de5ab17c4fcb8..5c82f23fc7bbdb 100644 --- a/fetch/metadata/generated/image-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/image-sec-fetch-site.sub.html @@ -35,7 +35,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-element-sec-fetch-dest.sub.html b/fetch/metadata/generated/script-element-sec-fetch-dest.sub.html index 1c3383cb3ac0a6..7a330609838fc5 100644 --- a/fetch/metadata/generated/script-element-sec-fetch-dest.sub.html +++ b/fetch/metadata/generated/script-element-sec-fetch-dest.sub.html @@ -40,6 +40,6 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'script'); }); - }, 'sec-fetch-dest - '); + }, ''); \ No newline at end of file diff --git a/fetch/metadata/generated/script-element-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/script-element-sec-fetch-mode.https.sub.html index d6bd4eecb0ba71..38dd6b1600d999 100644 --- a/fetch/metadata/generated/script-element-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/script-element-sec-fetch-mode.https.sub.html @@ -40,7 +40,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'no-cors'); }); - }, 'sec-fetch-mode - classic script'); + }, 'classic script'); promise_test(() => { const key = '{{uuid()}}'; @@ -56,7 +56,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - module script'); + }, 'module script'); promise_test(() => { const key = '{{uuid()}}'; @@ -72,7 +72,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - classic script, crossorigin=""'); + }, 'classic script, crossorigin=""'); promise_test(() => { const key = '{{uuid()}}'; @@ -88,7 +88,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - classic script, crossorigin="anonymous"'); + }, 'classic script, crossorigin="anonymous"'); promise_test(() => { const key = '{{uuid()}}'; @@ -104,6 +104,6 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - classic script, crossorigin="use-credentials"'); + }, 'classic script, crossorigin="use-credentials"'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html b/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html index c832a264ca66ae..d79375a107b4f1 100644 --- a/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html @@ -40,7 +40,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - classic script'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect - classic script'); promise_test(() => { const key = '{{uuid()}}'; @@ -56,6 +56,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - module script'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect - module script'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-element-sec-fetch-site.sub.html b/fetch/metadata/generated/script-element-sec-fetch-site.sub.html index 43edc13f983719..cd5b7cc0ca5444 100644 --- a/fetch/metadata/generated/script-element-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/script-element-sec-fetch-site.sub.html @@ -40,7 +40,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - classic script'); + }, 'HTTPS downgrade-upgrade - classic script'); promise_test(() => { const key = '{{uuid()}}'; @@ -56,6 +56,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - module script'); + }, 'HTTPS downgrade-upgrade - module script'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.sub.html index d1e79accbfdaaf..503583cacf639a 100644 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.sub.html @@ -20,6 +20,6 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'script'); }); - }, 'sec-fetch-dest - '); + }, ''); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.https.sub.html index 49ccfab088ec58..55bbe1acabefff 100644 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.https.sub.html @@ -20,6 +20,6 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - '); + }, ''); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html index efe27d823075ff..5d0ae5ec6a85c0 100644 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html @@ -20,6 +20,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html index 2c5cd8010f8b1b..f1688c2e3d80ce 100644 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html @@ -20,6 +20,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.sub.html index 5b2ee98e85aefd..081f79754e33b5 100644 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.sub.html +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.sub.html @@ -39,6 +39,6 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'script'); }); - }, 'sec-fetch-dest - '); + }, ''); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-mode.https.sub.html index 50f5460d9175b8..33f449f6c71fa2 100644 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-mode.https.sub.html @@ -39,6 +39,6 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - '); + }, ''); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html index 9b0b88826b6a88..4277a5e4de6baf 100644 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html @@ -39,6 +39,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html index 90a7cb29c2772a..8266d87ba75d8a 100644 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html @@ -39,6 +39,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-dest.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-dest.sub.html index fb02a3aabd47e6..47d1333a302a9f 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-dest.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-dest.sub.html @@ -28,7 +28,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'image'); }); - }, 'sec-fetch-dest - '); + }, ''); \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html index 99729faf9dc150..10b2d6d692dc94 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html @@ -28,7 +28,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'no-cors'); }); - }, 'sec-fetch-mode - '); + }, ''); \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html index 37b5addcabf4da..af3443f3831aaa 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html @@ -28,7 +28,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html index 7f0f893b7e7e9e..e88caf92ab41d7 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html @@ -28,7 +28,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html index fb8a33f52ea9e3..b34b224779380d 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html @@ -28,7 +28,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + }, 'HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.sub.html index c198829c31c6b3..ffa12db3463ea4 100644 --- a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.sub.html +++ b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.sub.html @@ -29,7 +29,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'worker'); }); - }, 'sec-fetch-dest - classic script'); + }, 'classic script'); promise_test(() => { const key = '{{uuid()}}'; @@ -45,6 +45,6 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'worker'); }); - }, 'sec-fetch-dest - module script'); + }, 'module script'); \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.sub.html index 9db0aa9e847cb8..e094315fd3f6b8 100644 --- a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.sub.html +++ b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.sub.html @@ -34,6 +34,6 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'script'); }); - }, 'sec-fetch-dest - '); + }, ''); \ No newline at end of file diff --git a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html index 664678652a9af5..407d6e4656c361 100644 --- a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html +++ b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html @@ -49,7 +49,7 @@ assert_equals(headers['[%headName%]'], '[%subtest[expected]%]'); {%- endif %} }); - }, '[%headerName%] - [%subtest.description%]'); + }, '[%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/cors-preflight.sub.html b/fetch/metadata/tools/templates/cors-preflight.sub.html index 2cf8f366e01eb0..7c5c18975f5aff 100644 --- a/fetch/metadata/tools/templates/cors-preflight.sub.html +++ b/fetch/metadata/tools/templates/cors-preflight.sub.html @@ -30,7 +30,7 @@ assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%subtest.description%]'); + }, '[%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/fetch.sub.html b/fetch/metadata/tools/templates/fetch.sub.html index 600b5fd3d7213a..f34f03388d4e73 100644 --- a/fetch/metadata/tools/templates/fetch.sub.html +++ b/fetch/metadata/tools/templates/fetch.sub.html @@ -28,7 +28,7 @@ assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%subtest.description%]'); + }, '[%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/font.sub.html b/fetch/metadata/tools/templates/font.sub.html index b769ac9f125415..0d484e512d49ec 100644 --- a/fetch/metadata/tools/templates/font.sub.html +++ b/fetch/metadata/tools/templates/font.sub.html @@ -44,7 +44,7 @@ assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%subtest.description%]'); + }, '[%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/form-submission.sub.html b/fetch/metadata/tools/templates/form-submission.sub.html index ae683b4e261229..a1d10220e9055d 100644 --- a/fetch/metadata/tools/templates/form-submission.sub.html +++ b/fetch/metadata/tools/templates/form-submission.sub.html @@ -59,7 +59,7 @@ assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%subtest.description%]'); + }, '[%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/global-properties.sub.html b/fetch/metadata/tools/templates/global-properties.sub.html index ba431529f321d8..2f300889ffcbe1 100644 --- a/fetch/metadata/tools/templates/global-properties.sub.html +++ b/fetch/metadata/tools/templates/global-properties.sub.html @@ -56,7 +56,7 @@ assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%subtest.description%]'); + }, '[%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/image.sub.html b/fetch/metadata/tools/templates/image.sub.html index 2ca7789950cda3..c50d7e4c9b058f 100644 --- a/fetch/metadata/tools/templates/image.sub.html +++ b/fetch/metadata/tools/templates/image.sub.html @@ -41,7 +41,7 @@ assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%subtest.description%]'); + }, '[%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/script-element.sub.html b/fetch/metadata/tools/templates/script-element.sub.html index 7934b41f338406..31229f8172dc91 100644 --- a/fetch/metadata/tools/templates/script-element.sub.html +++ b/fetch/metadata/tools/templates/script-element.sub.html @@ -45,7 +45,7 @@ assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%subtest.description%]'); + }, '[%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html b/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html index 28519a93b3a3f8..7a2a5ced70dc11 100644 --- a/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html +++ b/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html @@ -25,7 +25,7 @@ assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%subtest.description%]'); + }, '[%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/script-module-import-static.sub.html b/fetch/metadata/tools/templates/script-module-import-static.sub.html index 33115777eb5c38..0c2c012db316b3 100644 --- a/fetch/metadata/tools/templates/script-module-import-static.sub.html +++ b/fetch/metadata/tools/templates/script-module-import-static.sub.html @@ -44,7 +44,7 @@ assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%subtest.description%]'); + }, '[%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/video-poster.sub.html b/fetch/metadata/tools/templates/video-poster.sub.html index 4a954b3d537c01..219ecae6d6c283 100644 --- a/fetch/metadata/tools/templates/video-poster.sub.html +++ b/fetch/metadata/tools/templates/video-poster.sub.html @@ -34,7 +34,7 @@ assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%subtest.description%]'); + }, '[%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html b/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html index a099cdb01d78a9..2642e486944e33 100644 --- a/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html +++ b/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html @@ -39,7 +39,7 @@ assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%subtest.description%]'); + }, '[%subtest.description%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html b/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html index 035483d5491cb0..e981622ffcfd91 100644 --- a/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html +++ b/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html @@ -44,7 +44,7 @@ assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%headerName%] - [%subtest.description%]'); + }, '[%subtest.description%]'); {%- endfor %} From 482e0c42c2d371f7757e43555a0ce51e4eaf2053 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 13 Dec 2019 15:21:09 -0500 Subject: [PATCH 050/127] Correct variable name --- .../generated/appcache-manifest-sec-fetch-dest.sub.https.html | 2 +- .../appcache-manifest-sec-fetch-mode.https.sub.https.html | 2 +- .../appcache-manifest-sec-fetch-site-mixed.https.sub.https.html | 2 +- .../appcache-manifest-sec-fetch-site.https.sub.https.html | 2 +- .../generated/appcache-manifest-sec-fetch-site.sub.https.html | 2 +- fetch/metadata/tools/templates/appcache-manifest.sub.https.html | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html index 2a76a88c81c60e..ae750bed251052 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html @@ -41,7 +41,7 @@ .then(() => retrieve(key)) .then((headers) => { assert_own_property(headers, 'sec-fetch-dest'); - assert_equals(headers[''], ''); + assert_equals(headers['sec-fetch-dest'], ''); }); }, ''); diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html index 6dfd7e25e3d720..bd88972bca26bd 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html @@ -41,7 +41,7 @@ .then(() => retrieve(key)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers[''], ''); + assert_equals(headers['sec-fetch-mode'], ''); }); }, ''); diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html index 92b2ca2d60b90c..c7c27789f53700 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html @@ -41,7 +41,7 @@ .then(() => retrieve(key)) .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers[''], ''); + assert_equals(headers['sec-fetch-site'], ''); }); }, 'HTTPS downgrade-upgrade'); diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html index 4cd3b93830e433..93a8eee0d9db3c 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html @@ -41,7 +41,7 @@ .then(() => retrieve(key)) .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers[''], ''); + assert_equals(headers['sec-fetch-site'], ''); }); }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html index 0360df706ea34e..fd18eecadcdef7 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html @@ -41,7 +41,7 @@ .then(() => retrieve(key)) .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers[''], ''); + assert_equals(headers['sec-fetch-site'], ''); }); }, 'HTTPS downgrade-upgrade'); diff --git a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html index 407d6e4656c361..d6b75532254726 100644 --- a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html +++ b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html @@ -46,7 +46,7 @@ assert_not_own_property(headers, '[%headerName%]'); {%- else %} assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headName%]'], '[%subtest[expected]%]'); + assert_equals(headers['[%headerName%]'], '[%subtest[expected]%]'); {%- endif %} }); }, '[%subtest.description%]'); From 247077e044396914dd2fc5a96f15775ac58123cb Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 13 Dec 2019 15:22:15 -0500 Subject: [PATCH 051/127] Add more HTTP redirection tests --- ...che-manifest-sec-fetch-dest.sub.https.html | 2 +- ...nifest-sec-fetch-mode.https.sub.https.html | 2 +- ...-sec-fetch-site-mixed.https.sub.https.html | 2 +- ...nifest-sec-fetch-site.https.sub.https.html | 2 +- ...che-manifest-sec-fetch-site.sub.https.html | 23 +++- .../generated/fetch-sec-fetch-site.sub.html | 27 ++++ .../generated/font-sec-fetch-site.sub.html | 23 ++++ .../form-submission-sec-fetch-site.sub.html | 42 +++++++ .../global-properties-sec-fetch-site.sub.html | 117 ++++++++++++++++++ .../generated/image-sec-fetch-site.sub.html | 27 ++++ .../script-element-sec-fetch-site.sub.html | 62 ++++++++++ ...ule-import-dynamic-sec-fetch-site.sub.html | 27 ++++ ...dule-import-static-sec-fetch-site.sub.html | 29 +++++ .../video-poster-sec-fetch-site.sub.html | 23 ++++ fetch/metadata/tools/cases/master.yml | 6 + .../appcache-manifest.sub.https.html | 4 +- .../tools/templates/cors-preflight.sub.html | 2 +- fetch/metadata/tools/templates/fetch.sub.html | 2 +- fetch/metadata/tools/templates/font.sub.html | 2 +- .../tools/templates/form-submission.sub.html | 2 +- .../templates/global-properties.sub.html | 2 +- fetch/metadata/tools/templates/image.sub.html | 2 +- .../tools/templates/script-element.sub.html | 2 +- .../script-module-import-dynamic.sub.html | 2 +- .../script-module-import-static.sub.html | 2 +- .../tools/templates/video-poster.sub.html | 2 +- .../worker-dedicated-constructor.sub.html | 2 +- .../worker-dedicated-importscripts.sub.html | 2 +- 28 files changed, 423 insertions(+), 19 deletions(-) diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html index ae750bed251052..d5aa9cda7a450e 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html @@ -41,7 +41,7 @@ .then(() => retrieve(key)) .then((headers) => { assert_own_property(headers, 'sec-fetch-dest'); - assert_equals(headers['sec-fetch-dest'], ''); + assert_equals(headers['sec-fetch-dest'], 'empty'); }); }, ''); diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html index bd88972bca26bd..91e234b04c608d 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html @@ -41,7 +41,7 @@ .then(() => retrieve(key)) .then((headers) => { assert_own_property(headers, 'sec-fetch-mode'); - assert_equals(headers['sec-fetch-mode'], ''); + assert_equals(headers['sec-fetch-mode'], 'no-cors'); }); }, ''); diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html index c7c27789f53700..dfa53a021c49f0 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html @@ -41,7 +41,7 @@ .then(() => retrieve(key)) .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], ''); + assert_equals(headers['sec-fetch-site'], 'cross-site'); }); }, 'HTTPS downgrade-upgrade'); diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html index 93a8eee0d9db3c..f3e5707a1f5484 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html @@ -41,7 +41,7 @@ .then(() => retrieve(key)) .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], ''); + assert_equals(headers['sec-fetch-site'], 'cross-site'); }); }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html index fd18eecadcdef7..8a8fa3c50e580a 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html @@ -34,6 +34,27 @@ .then(() => iframe.remove()); } + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['sameOrigin', 'httpOrigin'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-site'); + }); + }, 'HTTPS downgrade (header not sent)'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['httpOrigin', 'sameOrigin'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'HTTPS upgrade'); + promise_test(() => { const key = '{{uuid()}}'; @@ -41,7 +62,7 @@ .then(() => retrieve(key)) .then((headers) => { assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], ''); + assert_equals(headers['sec-fetch-site'], 'cross-site'); }); }, 'HTTPS downgrade-upgrade'); diff --git a/fetch/metadata/generated/fetch-sec-fetch-site.sub.html b/fetch/metadata/generated/fetch-sec-fetch-site.sub.html index 55176dfc4b4233..9fea7848820df4 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/fetch-sec-fetch-site.sub.html @@ -10,6 +10,33 @@ @@ -31,6 +32,122 @@ body: ` + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/cors-preflight-sec-fetch-dest.sub.html b/fetch/metadata/generated/cors-preflight-sec-fetch-dest.https.sub.html similarity index 100% rename from fetch/metadata/generated/cors-preflight-sec-fetch-dest.sub.html rename to fetch/metadata/generated/cors-preflight-sec-fetch-dest.https.sub.html diff --git a/fetch/metadata/generated/fetch-sec-fetch-dest.sub.html b/fetch/metadata/generated/fetch-sec-fetch-dest.https.sub.html similarity index 100% rename from fetch/metadata/generated/fetch-sec-fetch-dest.sub.html rename to fetch/metadata/generated/fetch-sec-fetch-dest.https.sub.html diff --git a/fetch/metadata/generated/font-sec-fetch-dest.sub.html b/fetch/metadata/generated/font-sec-fetch-dest.https.sub.html similarity index 100% rename from fetch/metadata/generated/font-sec-fetch-dest.sub.html rename to fetch/metadata/generated/font-sec-fetch-dest.https.sub.html diff --git a/fetch/metadata/generated/form-submission-sec-fetch-dest.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html similarity index 100% rename from fetch/metadata/generated/form-submission-sec-fetch-dest.sub.html rename to fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html diff --git a/fetch/metadata/generated/global-properties-sec-fetch-dest.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-dest.https.sub.html similarity index 100% rename from fetch/metadata/generated/global-properties-sec-fetch-dest.sub.html rename to fetch/metadata/generated/global-properties-sec-fetch-dest.https.sub.html diff --git a/fetch/metadata/generated/image-sec-fetch-dest.sub.html b/fetch/metadata/generated/image-sec-fetch-dest.https.sub.html similarity index 100% rename from fetch/metadata/generated/image-sec-fetch-dest.sub.html rename to fetch/metadata/generated/image-sec-fetch-dest.https.sub.html diff --git a/fetch/metadata/generated/script-element-sec-fetch-dest.sub.html b/fetch/metadata/generated/script-element-sec-fetch-dest.https.sub.html similarity index 100% rename from fetch/metadata/generated/script-element-sec-fetch-dest.sub.html rename to fetch/metadata/generated/script-element-sec-fetch-dest.https.sub.html diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.https.sub.html similarity index 100% rename from fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.sub.html rename to fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.https.sub.html diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.https.sub.html similarity index 100% rename from fetch/metadata/generated/script-module-import-static-sec-fetch-dest.sub.html rename to fetch/metadata/generated/script-module-import-static-sec-fetch-dest.https.sub.html diff --git a/fetch/metadata/generated/video-poster-sec-fetch-dest.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-dest.https.sub.html similarity index 100% rename from fetch/metadata/generated/video-poster-sec-fetch-dest.sub.html rename to fetch/metadata/generated/video-poster-sec-fetch-dest.https.sub.html diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.https.sub.html similarity index 97% rename from fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.sub.html rename to fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.https.sub.html index ffa12db3463ea4..97774ea956beb9 100644 --- a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.sub.html +++ b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.https.sub.html @@ -19,7 +19,7 @@ const key = '{{uuid()}}'; const url = makeRequestURL( key, - ['sameOrigin'], + [], { mime: 'application/javascript', body: 'postMessage("")' } ); @@ -35,7 +35,7 @@ const key = '{{uuid()}}'; const url = makeRequestURL( key, - ['sameOrigin'], + [], { mime: 'application/javascript', body: 'postMessage("")' } ); diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.https.sub.html similarity index 94% rename from fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.sub.html rename to fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.https.sub.html index 9be2115bea184e..6ee5d853ac2cce 100644 --- a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.sub.html +++ b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.https.sub.html @@ -25,7 +25,7 @@ promise_test(() => { const key = '{{uuid()}}'; const url = makeRequestURL( - key, ['sameOrigin'], { mime: 'application/javascript' } + key, [], { mime: 'application/javascript' } ); return induceRequest(url) diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index eab52c70d641f6..7509de6462a519 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -219,7 +219,7 @@ - expected: no-cors - title: Fetch Metadata - Sec-Fetch-Dest - fileName: sec-fetch-dest + fileName: sec-fetch-dest.https headerName: sec-fetch-dest each_subtest: appcache-manifest.sub.https.html: @@ -262,12 +262,9 @@ - expected: image worker-dedicated-constructor.sub.html: - description: classic script - origins: [sameOrigin] expected: worker - description: module script options: { type: module } - origins: [sameOrigin] expected: worker worker-dedicated-importscripts.sub.html: - - origins: [sameOrigin] - expected: script + - expected: script From 0088182fe0882ef647048b6e138614128c943de1 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 13 Dec 2019 19:12:55 -0500 Subject: [PATCH 055/127] Invoke `importScripts` with URL --- ...worker-dedicated-importscripts-sec-fetch-dest.https.sub.html | 2 +- .../tools/templates/worker-dedicated-importscripts.sub.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.https.sub.html index 6ee5d853ac2cce..dd5068401e5ab4 100644 --- a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.https.sub.html @@ -9,7 +9,7 @@ 'use strict'; function induceRequest(url, options) { const src = ` - importScripts('${url}'); + importScripts(new URL('${url}', location.origin)); postMessage('done'); `; const workerUrl = URL.createObjectURL( diff --git a/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html b/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html index eb8b1781e2401b..50d5af5036eb8a 100644 --- a/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html +++ b/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html @@ -9,7 +9,7 @@ 'use strict'; function induceRequest(url, options) { const src = ` - importScripts('${url}'); + importScripts(new URL('${url}', location.origin)); postMessage('done'); `; const workerUrl = URL.createObjectURL( From 1a702151db26ea63bca43c7368ed3af2421f533d Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 13 Dec 2019 19:26:40 -0500 Subject: [PATCH 056/127] Add more redirection tests --- ...icated-constructor-sec-fetch-site.sub.html | 112 ++++++++++++++++++ ...ated-importscripts-sec-fetch-site.sub.html | 66 +++++++++++ fetch/metadata/tools/cases/master.yml | 7 +- 3 files changed, 183 insertions(+), 2 deletions(-) create mode 100644 fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-site.sub.html create mode 100644 fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.sub.html diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-site.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-site.sub.html new file mode 100644 index 00000000000000..92729ca0f19820 --- /dev/null +++ b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-site.sub.html @@ -0,0 +1,112 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.sub.html new file mode 100644 index 00000000000000..d7f1018d0ed836 --- /dev/null +++ b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.sub.html @@ -0,0 +1,66 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 7509de6462a519..d5aad2fcf7f96d 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -16,8 +16,6 @@ # Unused # TODO(jugglinmike) document rationale cors-preflight.sub.html: [] - worker-dedicated-constructor.sub.html: [] - worker-dedicated-importscripts.sub.html: [] appcache-manifest.sub.https.html: [{}] fetch.sub.html: [{}] @@ -44,6 +42,11 @@ script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] video-poster.sub.html: [{}] + worker-dedicated-constructor.sub.html: + - description: classic script + - description: module script + options: { type: module } + worker-dedicated-importscripts.sub.html: [{}] - title: Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS fileName: sec-fetch-site.https From 01eccafdb9eee90a6c1ec32d9ebaf8508fa5662a Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 13 Dec 2019 19:32:52 -0500 Subject: [PATCH 057/127] Enable more tests for dedicated workers --- ...-constructor-sec-fetch-site.https.sub.html | 34 ++++++++++++++++ ...mportscripts-sec-fetch-site.https.sub.html | 39 +++++++++++++++++++ fetch/metadata/tools/cases/master.yml | 6 ++- 3 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-site.https.sub.html create mode 100644 fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.https.sub.html diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-site.https.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-site.https.sub.html new file mode 100644 index 00000000000000..915e05e8dfb1bf --- /dev/null +++ b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-site.https.sub.html @@ -0,0 +1,34 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.https.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.https.sub.html new file mode 100644 index 00000000000000..d14aa0cbff4dca --- /dev/null +++ b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.https.sub.html @@ -0,0 +1,39 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index d5aad2fcf7f96d..9cc8e57b1ace34 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -59,8 +59,6 @@ # Unused # TODO(jugglinmike) document rationale cors-preflight.sub.html: [] - worker-dedicated-constructor.sub.html: [] - worker-dedicated-importscripts.sub.html: [] appcache-manifest.sub.https.html: [{}] fetch.sub.html: [{ init: { mode: no-cors } }] @@ -87,6 +85,10 @@ script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] video-poster.sub.html: [{}] + worker-dedicated-constructor.sub.html: + - description: ' - module script' + options: { type: module } + worker-dedicated-importscripts.sub.html: [{}] - title: Fetch Metadata - Sec-Fetch-Site - redirection with mixed content # These tests verify the effect that redirection has on the request's "site". From 1cb94c5dd43e859123d34f920b94d09fb1374703 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 13 Dec 2019 20:42:23 -0500 Subject: [PATCH 058/127] Add more cases and correct template sets --- ...che-manifest-sec-fetch-dest.sub.https.html | 49 -- ...nifest-sec-fetch-site.https.sub.https.html | 99 ++++ .../fetch-sec-fetch-site.https.sub.html | 126 ++++ .../font-sec-fetch-site.https.sub.html | 108 ++++ ...m-submission-sec-fetch-site.https.sub.html | 198 +++++++ ...l-properties-sec-fetch-site.https.sub.html | 541 ++++++++++++++++++ .../image-sec-fetch-site.https.sub.html | 126 ++++ ...ript-element-sec-fetch-site.https.sub.html | 288 ++++++++++ ...port-dynamic-sec-fetch-site.https.sub.html | 126 ++++ ...mport-static-sec-fetch-site.https.sub.html | 135 +++++ ...video-poster-sec-fetch-site.https.sub.html | 108 ++++ ...constructor-sec-fetch-mode.https.sub.html} | 24 +- ...icated-constructor-sec-fetch-site.sub.html | 112 ---- ...mportscripts-sec-fetch-site.https.sub.html | 126 ++++ fetch/metadata/tools/cases/master.yml | 57 +- 15 files changed, 2050 insertions(+), 173 deletions(-) delete mode 100644 fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html rename fetch/metadata/generated/{worker-dedicated-constructor-sec-fetch-site.https.sub.html => worker-dedicated-constructor-sec-fetch-mode.https.sub.html} (59%) delete mode 100644 fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-site.sub.html diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html deleted file mode 100644 index d5aa9cda7a450e..00000000000000 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.sub.https.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Dest - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html index f3e5707a1f5484..40baaba800e18b 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html @@ -44,6 +44,105 @@ assert_equals(headers['sec-fetch-site'], 'cross-site'); }); }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['crossSite', 'sameOrigin'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['crossSite', 'sameSite'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['crossSite', 'crossSite'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['sameOrigin', 'sameOrigin'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['sameOrigin', 'sameSite'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['sameOrigin', 'crossSite'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['sameSite', 'sameOrigin'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['sameSite', 'sameSite'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest(makeRequestURL(key, ['sameSite', 'crossSite'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site'); \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html b/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html index ef25ca6ab647cb..e6ba576f6cae80 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html @@ -23,6 +23,132 @@ assert_equals(headers['sec-fetch-site'], 'cross-site'); }); }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return fetch( + makeRequestURL(key, ['crossSite', 'sameOrigin']), + {"mode": "no-cors"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return fetch( + makeRequestURL(key, ['crossSite', 'sameSite']), + {"mode": "no-cors"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return fetch( + makeRequestURL(key, ['crossSite', 'crossSite']), + {"mode": "no-cors"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return fetch( + makeRequestURL(key, ['sameOrigin', 'sameOrigin']), + {"mode": "no-cors"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return fetch( + makeRequestURL(key, ['sameOrigin', 'sameSite']), + {"mode": "no-cors"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return fetch( + makeRequestURL(key, ['sameOrigin', 'crossSite']), + {"mode": "no-cors"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return fetch( + makeRequestURL(key, ['sameSite', 'sameOrigin']), + {"mode": "no-cors"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return fetch( + makeRequestURL(key, ['sameSite', 'sameSite']), + {"mode": "no-cors"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return fetch( + makeRequestURL(key, ['sameSite', 'crossSite']), + {"mode": "no-cors"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site'); \ No newline at end of file diff --git a/fetch/metadata/generated/font-sec-fetch-site.https.sub.html b/fetch/metadata/generated/font-sec-fetch-site.https.sub.html index aed861a6f0eb29..6d25644d495cc8 100644 --- a/fetch/metadata/generated/font-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/font-sec-fetch-site.https.sub.html @@ -39,6 +39,114 @@ assert_equals(headers['sec-fetch-site'], 'cross-site'); }); }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['crossSite', 'sameOrigin'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['crossSite', 'sameSite'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['crossSite', 'crossSite'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['sameOrigin', 'sameOrigin'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['sameOrigin', 'sameSite'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['sameOrigin', 'crossSite'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['sameSite', 'sameOrigin'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['sameSite', 'sameSite'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['sameSite', 'crossSite'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site'); \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html index f3fec464bdbe25..14b03ea594bd51 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html @@ -65,6 +65,204 @@ assert_equals(headers['sec-fetch-site'], 'cross-site'); }); }, 'Same-Origin -> Cross-Site -> Same-Origin redirect - POST'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'sameOrigin'], responseParams); + return induceRequest('GET', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin - GET'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'sameOrigin'], responseParams); + return induceRequest('POST', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin - POST'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'sameSite'], responseParams); + return induceRequest('GET', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site - GET'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'sameSite'], responseParams); + return induceRequest('POST', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site - POST'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'crossSite'], responseParams); + return induceRequest('GET', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site - GET'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'crossSite'], responseParams); + return induceRequest('POST', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site - POST'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'sameOrigin'], responseParams); + return induceRequest('GET', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin - GET'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'sameOrigin'], responseParams); + return induceRequest('POST', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin - POST'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'sameSite'], responseParams); + return induceRequest('GET', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site - GET'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'sameSite'], responseParams); + return induceRequest('POST', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site - POST'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'crossSite'], responseParams); + return induceRequest('GET', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site - GET'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'crossSite'], responseParams); + return induceRequest('POST', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site - POST'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'sameOrigin'], responseParams); + return induceRequest('GET', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin - GET'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'sameOrigin'], responseParams); + return induceRequest('POST', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin - POST'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'sameSite'], responseParams); + return induceRequest('GET', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site - GET'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'sameSite'], responseParams); + return induceRequest('POST', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site - POST'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'crossSite'], responseParams); + return induceRequest('GET', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site - GET'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'crossSite'], responseParams); + return induceRequest('POST', url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site - POST'); \ No newline at end of file diff --git a/fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html index 70fc7404ab3d6e..1024a09ada7cb5 100644 --- a/fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/global-properties-sec-fetch-site.https.sub.html @@ -2,6 +2,7 @@ + Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS @@ -90,6 +91,546 @@ assert_equals(headers['sec-fetch-site'], 'cross-site'); }); }, 'Same-Origin -> Cross-Site -> Same-Origin redirect - location.replace'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'sameOrigin'], responseParams); + + const navigate = (win, path) => { + win.location = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin - location'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'sameOrigin'], responseParams); + + const navigate = (win, path) => { + win.location.href = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin - location.href'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'sameOrigin'], responseParams); + + const navigate = (win, path) => { + win.location.assign(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin - location.assign'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'sameOrigin'], responseParams); + + const navigate = (win, path) => { + win.location.replace(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin - location.replace'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'sameSite'], responseParams); + + const navigate = (win, path) => { + win.location = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site - location'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'sameSite'], responseParams); + + const navigate = (win, path) => { + win.location.href = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site - location.href'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'sameSite'], responseParams); + + const navigate = (win, path) => { + win.location.assign(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site - location.assign'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'sameSite'], responseParams); + + const navigate = (win, path) => { + win.location.replace(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site - location.replace'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'crossSite'], responseParams); + + const navigate = (win, path) => { + win.location = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site - location'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'crossSite'], responseParams); + + const navigate = (win, path) => { + win.location.href = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site - location.href'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'crossSite'], responseParams); + + const navigate = (win, path) => { + win.location.assign(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site - location.assign'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['crossSite', 'crossSite'], responseParams); + + const navigate = (win, path) => { + win.location.replace(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site - location.replace'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'sameOrigin'], responseParams); + + const navigate = (win, path) => { + win.location = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin - location'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'sameOrigin'], responseParams); + + const navigate = (win, path) => { + win.location.href = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin - location.href'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'sameOrigin'], responseParams); + + const navigate = (win, path) => { + win.location.assign(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin - location.assign'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'sameOrigin'], responseParams); + + const navigate = (win, path) => { + win.location.replace(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin - location.replace'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'sameSite'], responseParams); + + const navigate = (win, path) => { + win.location = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site - location'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'sameSite'], responseParams); + + const navigate = (win, path) => { + win.location.href = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site - location.href'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'sameSite'], responseParams); + + const navigate = (win, path) => { + win.location.assign(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site - location.assign'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'sameSite'], responseParams); + + const navigate = (win, path) => { + win.location.replace(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site - location.replace'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'crossSite'], responseParams); + + const navigate = (win, path) => { + win.location = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site - location'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'crossSite'], responseParams); + + const navigate = (win, path) => { + win.location.href = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site - location.href'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'crossSite'], responseParams); + + const navigate = (win, path) => { + win.location.assign(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site - location.assign'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameOrigin', 'crossSite'], responseParams); + + const navigate = (win, path) => { + win.location.replace(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site - location.replace'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'sameOrigin'], responseParams); + + const navigate = (win, path) => { + win.location = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin - location'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'sameOrigin'], responseParams); + + const navigate = (win, path) => { + win.location.href = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin - location.href'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'sameOrigin'], responseParams); + + const navigate = (win, path) => { + win.location.assign(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin - location.assign'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'sameOrigin'], responseParams); + + const navigate = (win, path) => { + win.location.replace(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin - location.replace'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'sameSite'], responseParams); + + const navigate = (win, path) => { + win.location = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site - location'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'sameSite'], responseParams); + + const navigate = (win, path) => { + win.location.href = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site - location.href'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'sameSite'], responseParams); + + const navigate = (win, path) => { + win.location.assign(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site - location.assign'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'sameSite'], responseParams); + + const navigate = (win, path) => { + win.location.replace(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site - location.replace'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'crossSite'], responseParams); + + const navigate = (win, path) => { + win.location = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site - location'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'crossSite'], responseParams); + + const navigate = (win, path) => { + win.location.href = path; + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site - location.href'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'crossSite'], responseParams); + + const navigate = (win, path) => { + win.location.assign(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site - location.assign'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, ['sameSite', 'crossSite'], responseParams); + + const navigate = (win, path) => { + win.location.replace(path); + }; + return induceRequest(url, navigate) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site - location.replace'); \ No newline at end of file diff --git a/fetch/metadata/generated/image-sec-fetch-site.https.sub.html b/fetch/metadata/generated/image-sec-fetch-site.https.sub.html index 5dcbaab38ccd6c..56aaca212e57b3 100644 --- a/fetch/metadata/generated/image-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/image-sec-fetch-site.https.sub.html @@ -36,6 +36,132 @@ assert_equals(headers['sec-fetch-site'], 'cross-site'); }); }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['crossSite', 'sameOrigin']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['crossSite', 'sameSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['crossSite', 'crossSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['sameOrigin', 'sameOrigin']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['sameOrigin', 'sameSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['sameOrigin', 'crossSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['sameSite', 'sameOrigin']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['sameSite', 'sameSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['sameSite', 'crossSite']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html b/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html index d79375a107b4f1..42080502149c76 100644 --- a/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html @@ -57,5 +57,293 @@ assert_equals(headers['sec-fetch-site'], 'cross-site'); }); }, 'Same-Origin -> Cross-Site -> Same-Origin redirect - module script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['crossSite', 'sameOrigin'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin - classic script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['crossSite', 'sameOrigin'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"type": "module"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin - module script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['crossSite', 'sameSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site - classic script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['crossSite', 'sameSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"type": "module"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site - module script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['crossSite', 'crossSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site - classic script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['crossSite', 'crossSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"type": "module"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site - module script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameOrigin', 'sameOrigin'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin - classic script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameOrigin', 'sameOrigin'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"type": "module"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin - module script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameOrigin', 'sameSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site - classic script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameOrigin', 'sameSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"type": "module"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site - module script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameOrigin', 'crossSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site - classic script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameOrigin', 'crossSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"type": "module"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site - module script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameSite', 'sameOrigin'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin - classic script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameSite', 'sameOrigin'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"type": "module"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin - module script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameSite', 'sameSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site - classic script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameSite', 'sameSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"type": "module"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site - module script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameSite', 'crossSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site - classic script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameSite', 'crossSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"type": "module"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site - module script'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html index 5d0ae5ec6a85c0..5fe07576408123 100644 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html @@ -21,5 +21,131 @@ assert_equals(headers['sec-fetch-site'], 'cross-site'); }); }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['crossSite', 'sameOrigin'], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['crossSite', 'sameSite'], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['crossSite', 'crossSite'], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameOrigin', 'sameOrigin'], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameOrigin', 'sameSite'], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameOrigin', 'crossSite'], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameSite', 'sameOrigin'], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameSite', 'sameSite'], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameSite', 'crossSite'], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html index 4277a5e4de6baf..5a43f093e65cc3 100644 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html @@ -40,5 +40,140 @@ assert_equals(headers['sec-fetch-site'], 'cross-site'); }); }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, ['crossSite', 'sameOrigin'], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, ['crossSite', 'sameSite'], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, ['crossSite', 'crossSite'], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, ['sameOrigin', 'sameOrigin'], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, ['sameOrigin', 'sameSite'], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, ['sameOrigin', 'crossSite'], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, ['sameSite', 'sameOrigin'], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, ['sameSite', 'sameSite'], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, ['sameSite', 'crossSite'], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site'); \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html index e88caf92ab41d7..f7832926f900fe 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html @@ -29,6 +29,114 @@ assert_equals(headers['sec-fetch-site'], 'cross-site'); }); }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['crossSite', 'sameOrigin'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['crossSite', 'sameSite'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['crossSite', 'crossSite'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['sameOrigin', 'sameOrigin'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['sameOrigin', 'sameSite'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['sameOrigin', 'crossSite'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['sameSite', 'sameOrigin'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['sameSite', 'sameSite'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['sameSite', 'crossSite'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site'); \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-site.https.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-mode.https.sub.html similarity index 59% rename from fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-site.https.sub.html rename to fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-mode.https.sub.html index 915e05e8dfb1bf..054766c12a4826 100644 --- a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-mode.https.sub.html @@ -19,16 +19,32 @@ const key = '{{uuid()}}'; const url = makeRequestURL( key, - ['sameOrigin', 'crossSite', 'sameOrigin'], + [], + { mime: 'application/javascript', body: 'postMessage("")' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'same-origin'); + }); + }, 'classic script'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, + [], { mime: 'application/javascript', body: 'postMessage("")' } ); return induceRequest(url, {"type": "module"}) .then(() => retrieve(key)) .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'same-origin'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect - module script'); + }, 'module script'); \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-site.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-site.sub.html deleted file mode 100644 index 92729ca0f19820..00000000000000 --- a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-site.sub.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.https.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.https.sub.html index d14aa0cbff4dca..bf9a7c324f5077 100644 --- a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.https.sub.html @@ -35,5 +35,131 @@ assert_equals(headers['sec-fetch-site'], 'cross-site'); }); }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['crossSite', 'sameOrigin'], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['crossSite', 'sameSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['crossSite', 'crossSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Cross-Site -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameOrigin', 'sameOrigin'], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-origin'); + }); + }, 'Same-Origin -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameOrigin', 'sameSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Origin -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameOrigin', 'crossSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Origin -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameSite', 'sameOrigin'], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same Origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameSite', 'sameSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'same-site'); + }); + }, 'Same-Site -> Same-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, ['sameSite', 'crossSite'], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'Same-Site -> Cross-Site'); \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 9cc8e57b1ace34..88eabc7abf6eb6 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -16,6 +16,14 @@ # Unused # TODO(jugglinmike) document rationale cors-preflight.sub.html: [] + # Unused + # - the request mode of all "classic" worker scripts is set to + # "same-origin" + # https://html.spec.whatwg.org/#fetch-a-classic-worker-script + # - the request mode of all "top-level "module" worker scripts is set to + # "same-origin": + # https://html.spec.whatwg.org/#fetch-a-single-module-script + worker-dedicated-constructor.sub.html: [] appcache-manifest.sub.https.html: [{}] fetch.sub.html: [{}] @@ -42,10 +50,6 @@ script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] video-poster.sub.html: [{}] - worker-dedicated-constructor.sub.html: - - description: classic script - - description: module script - options: { type: module } worker-dedicated-importscripts.sub.html: [{}] - title: Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS @@ -55,10 +59,45 @@ - description: Same-Origin -> Cross-Site -> Same-Origin redirect origins: [sameOrigin, crossSite, sameOrigin] expected: cross-site + - description: Cross-Site -> Same Origin + origins: [crossSite, sameOrigin] + expected: cross-site + - description: Cross-Site -> Same-Site + origins: [crossSite, sameSite] + expected: cross-site + - description: Cross-Site -> Cross-Site + origins: [crossSite, crossSite] + expected: cross-site + - description: Same-Origin -> Same Origin + origins: [sameOrigin, sameOrigin] + expected: same-origin + - description: Same-Origin -> Same-Site + origins: [sameOrigin, sameSite] + expected: same-site + - description: Same-Origin -> Cross-Site + origins: [sameOrigin, crossSite] + expected: cross-site + - description: Same-Site -> Same Origin + origins: [sameSite, sameOrigin] + expected: same-site + - description: Same-Site -> Same-Site + origins: [sameSite, sameSite] + expected: same-site + - description: Same-Site -> Cross-Site + origins: [sameSite, crossSite] + expected: cross-site each_subtest: # Unused # TODO(jugglinmike) document rationale cors-preflight.sub.html: [] + # Unused + # - the request mode of all "classic" worker scripts is set to + # "same-origin" + # https://html.spec.whatwg.org/#fetch-a-classic-worker-script + # - the request mode of all "top-level "module" worker scripts is set to + # "same-origin": + # https://html.spec.whatwg.org/#fetch-a-single-module-script + worker-dedicated-constructor.sub.html: [] appcache-manifest.sub.https.html: [{}] fetch.sub.html: [{ init: { mode: no-cors } }] @@ -85,9 +124,6 @@ script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] video-poster.sub.html: [{}] - worker-dedicated-constructor.sub.html: - - description: ' - module script' - options: { type: module } worker-dedicated-importscripts.sub.html: [{}] - title: Fetch Metadata - Sec-Fetch-Site - redirection with mixed content @@ -149,7 +185,6 @@ # Unused # TODO(jugglinmike) document rationale worker-dedicated-importscripts.sub.html: [] - worker-dedicated-constructor.sub.html: [] appcache-manifest.sub.https.html: - expected: no-cors @@ -222,6 +257,12 @@ - expected: cors video-poster.sub.html: - expected: no-cors + worker-dedicated-constructor.sub.html: + - description: classic script + expected: same-origin + - description: module script + options: { type: module } + expected: same-origin - title: Fetch Metadata - Sec-Fetch-Dest fileName: sec-fetch-dest.https From 4fdb1bbaa6845084b74b5101b76f2828b5532402 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 13 Dec 2019 20:54:39 -0500 Subject: [PATCH 059/127] Rename templates --- ...ement-image-sec-fetch-dest.https.sub.html} | 0 ...ement-image-sec-fetch-mode.https.sub.html} | 0 ...image-sec-fetch-site-mixed.https.sub.html} | 0 ...ement-image-sec-fetch-site.https.sub.html} | 0 ... => element-image-sec-fetch-site.sub.html} | 0 ...ment-script-sec-fetch-dest.https.sub.html} | 0 ...ment-script-sec-fetch-mode.https.sub.html} | 0 ...ment-script-sec-fetch-site.https.sub.html} | 0 ...=> element-script-sec-fetch-site.sub.html} | 0 fetch/metadata/tools/cases/master.yml | 90 +++++++++---------- ...{image.sub.html => element-image.sub.html} | 0 ...ement.sub.html => element-script.sub.html} | 0 12 files changed, 45 insertions(+), 45 deletions(-) rename fetch/metadata/generated/{image-sec-fetch-dest.https.sub.html => element-image-sec-fetch-dest.https.sub.html} (100%) rename fetch/metadata/generated/{image-sec-fetch-mode.https.sub.html => element-image-sec-fetch-mode.https.sub.html} (100%) rename fetch/metadata/generated/{image-sec-fetch-site-mixed.https.sub.html => element-image-sec-fetch-site-mixed.https.sub.html} (100%) rename fetch/metadata/generated/{image-sec-fetch-site.https.sub.html => element-image-sec-fetch-site.https.sub.html} (100%) rename fetch/metadata/generated/{image-sec-fetch-site.sub.html => element-image-sec-fetch-site.sub.html} (100%) rename fetch/metadata/generated/{script-element-sec-fetch-dest.https.sub.html => element-script-sec-fetch-dest.https.sub.html} (100%) rename fetch/metadata/generated/{script-element-sec-fetch-mode.https.sub.html => element-script-sec-fetch-mode.https.sub.html} (100%) rename fetch/metadata/generated/{script-element-sec-fetch-site.https.sub.html => element-script-sec-fetch-site.https.sub.html} (100%) rename fetch/metadata/generated/{script-element-sec-fetch-site.sub.html => element-script-sec-fetch-site.sub.html} (100%) rename fetch/metadata/tools/templates/{image.sub.html => element-image.sub.html} (100%) rename fetch/metadata/tools/templates/{script-element.sub.html => element-script.sub.html} (100%) diff --git a/fetch/metadata/generated/image-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/element-image-sec-fetch-dest.https.sub.html similarity index 100% rename from fetch/metadata/generated/image-sec-fetch-dest.https.sub.html rename to fetch/metadata/generated/element-image-sec-fetch-dest.https.sub.html diff --git a/fetch/metadata/generated/image-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/element-image-sec-fetch-mode.https.sub.html similarity index 100% rename from fetch/metadata/generated/image-sec-fetch-mode.https.sub.html rename to fetch/metadata/generated/element-image-sec-fetch-mode.https.sub.html diff --git a/fetch/metadata/generated/image-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/element-image-sec-fetch-site-mixed.https.sub.html similarity index 100% rename from fetch/metadata/generated/image-sec-fetch-site-mixed.https.sub.html rename to fetch/metadata/generated/element-image-sec-fetch-site-mixed.https.sub.html diff --git a/fetch/metadata/generated/image-sec-fetch-site.https.sub.html b/fetch/metadata/generated/element-image-sec-fetch-site.https.sub.html similarity index 100% rename from fetch/metadata/generated/image-sec-fetch-site.https.sub.html rename to fetch/metadata/generated/element-image-sec-fetch-site.https.sub.html diff --git a/fetch/metadata/generated/image-sec-fetch-site.sub.html b/fetch/metadata/generated/element-image-sec-fetch-site.sub.html similarity index 100% rename from fetch/metadata/generated/image-sec-fetch-site.sub.html rename to fetch/metadata/generated/element-image-sec-fetch-site.sub.html diff --git a/fetch/metadata/generated/script-element-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/element-script-sec-fetch-dest.https.sub.html similarity index 100% rename from fetch/metadata/generated/script-element-sec-fetch-dest.https.sub.html rename to fetch/metadata/generated/element-script-sec-fetch-dest.https.sub.html diff --git a/fetch/metadata/generated/script-element-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/element-script-sec-fetch-mode.https.sub.html similarity index 100% rename from fetch/metadata/generated/script-element-sec-fetch-mode.https.sub.html rename to fetch/metadata/generated/element-script-sec-fetch-mode.https.sub.html diff --git a/fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html b/fetch/metadata/generated/element-script-sec-fetch-site.https.sub.html similarity index 100% rename from fetch/metadata/generated/script-element-sec-fetch-site.https.sub.html rename to fetch/metadata/generated/element-script-sec-fetch-site.https.sub.html diff --git a/fetch/metadata/generated/script-element-sec-fetch-site.sub.html b/fetch/metadata/generated/element-script-sec-fetch-site.sub.html similarity index 100% rename from fetch/metadata/generated/script-element-sec-fetch-site.sub.html rename to fetch/metadata/generated/element-script-sec-fetch-site.sub.html diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 88eabc7abf6eb6..edc3b5d2bc83a6 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -26,6 +26,11 @@ worker-dedicated-constructor.sub.html: [] appcache-manifest.sub.https.html: [{}] + element-image.sub.html: [{}] + element-script.sub.html: + - description: ' - classic script' + - description: ' - module script' + elementAttrs: { type: module } fetch.sub.html: [{}] font.sub.html: [{}] form-submission.sub.html: @@ -42,11 +47,6 @@ api: location.assign - description: ' - location.replace' api: location.replace - image.sub.html: [{}] - script-element.sub.html: - - description: ' - classic script' - - description: ' - module script' - elementAttrs: { type: module } script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] video-poster.sub.html: [{}] @@ -100,6 +100,11 @@ worker-dedicated-constructor.sub.html: [] appcache-manifest.sub.https.html: [{}] + element-image.sub.html: [{}] + element-script.sub.html: + - description: ' - classic script' + - description: ' - module script' + elementAttrs: { type: module } fetch.sub.html: [{ init: { mode: no-cors } }] font.sub.html: [{}] form-submission.sub.html: @@ -116,11 +121,6 @@ api: location.assign - description: ' - location.replace' api: location.replace - image.sub.html: [{}] - script-element.sub.html: - - description: ' - classic script' - - description: ' - module script' - elementAttrs: { type: module } script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] video-poster.sub.html: [{}] @@ -146,16 +146,17 @@ each_subtest: # Unused # TODO(jugglinmike) document rationale + element-script.sub.html: [] fetch.sub.html: [] - worker-dedicated-importscripts.sub.html: [] font.sub.html: [] - worker-dedicated-constructor.sub.html: [] script-module-import-static.sub.html: [] script-module-import-dynamic.sub.html: [] - script-element.sub.html: [] cors-preflight.sub.html: [] + worker-dedicated-constructor.sub.html: [] + worker-dedicated-importscripts.sub.html: [] appcache-manifest.sub.https.html: [{}] + element-image.sub.html: [{}] form-submission.sub.html: - description: ' - GET' method: GET @@ -170,7 +171,6 @@ api: location.assign - description: ' - location.replace' api: location.replace - image.sub.html: [{}] video-poster.sub.html: [{}] - title: Fetch Metadata - Sec-Fetch-Mode @@ -190,6 +190,33 @@ - expected: no-cors cors-preflight.sub.html: - expected: cors + element-image.sub.html: + - description: no attributes + expected: no-cors + - description: crossorigin="" + expected: cors + elementAttrs: { crossorigin: '' } + - description: crossorigin="anonymous" + expected: cors + elementAttrs: { crossorigin: anonymous } + - description: crossorigin="use-credentials" + expected: cors + elementAttrs: { crossorigin: use-credentials } + element-script.sub.html: + - description: classic script + expected: no-cors + - description: module script + expected: cors + elementAttrs: { type: module } + - description: classic script, crossorigin="" + expected: cors + elementAttrs: { crossorigin: '' } + - description: classic script, crossorigin="anonymous" + expected: cors + elementAttrs: { crossorigin: anonymous } + - description: classic script, crossorigin="use-credentials" + expected: cors + elementAttrs: { crossorigin: use-credentials } fetch.sub.html: - description: no options expected: cors @@ -224,33 +251,6 @@ - description: location.replace api: location.replace expected: navigate - image.sub.html: - - description: no attributes - expected: no-cors - - description: crossorigin="" - expected: cors - elementAttrs: { crossorigin: '' } - - description: crossorigin="anonymous" - expected: cors - elementAttrs: { crossorigin: anonymous } - - description: crossorigin="use-credentials" - expected: cors - elementAttrs: { crossorigin: use-credentials } - script-element.sub.html: - - description: classic script - expected: no-cors - - description: module script - expected: cors - elementAttrs: { type: module } - - description: classic script, crossorigin="" - expected: cors - elementAttrs: { crossorigin: '' } - - description: classic script, crossorigin="anonymous" - expected: cors - elementAttrs: { crossorigin: anonymous } - - description: classic script, crossorigin="use-credentials" - expected: cors - elementAttrs: { crossorigin: use-credentials } script-module-import-dynamic.sub.html: - expected: cors script-module-import-static.sub.html: @@ -272,6 +272,10 @@ - expected: empty cors-preflight.sub.html: - expected: empty + element-image.sub.html: + - expected: image + element-script.sub.html: + - expected: script fetch.sub.html: - expected: empty font.sub.html: @@ -296,10 +300,6 @@ - description: location.replace api: location.replace expected: document - image.sub.html: - - expected: image - script-element.sub.html: - - expected: script script-module-import-dynamic.sub.html: - expected: script script-module-import-static.sub.html: diff --git a/fetch/metadata/tools/templates/image.sub.html b/fetch/metadata/tools/templates/element-image.sub.html similarity index 100% rename from fetch/metadata/tools/templates/image.sub.html rename to fetch/metadata/tools/templates/element-image.sub.html diff --git a/fetch/metadata/tools/templates/script-element.sub.html b/fetch/metadata/tools/templates/element-script.sub.html similarity index 100% rename from fetch/metadata/tools/templates/script-element.sub.html rename to fetch/metadata/tools/templates/element-script.sub.html From c2a1c83efe7fc224b1b8f282884d07dc195b1b2c Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 13 Dec 2019 21:02:59 -0500 Subject: [PATCH 060/127] Add tests for video element --- ...lement-video-sec-fetch-dest.https.sub.html | 41 +++++ ...lement-video-sec-fetch-mode.https.sub.html | 83 +++++++++ ...-video-sec-fetch-site-mixed.https.sub.html | 41 +++++ ...lement-video-sec-fetch-site.https.sub.html | 167 ++++++++++++++++++ .../element-video-sec-fetch-site.sub.html | 68 +++++++ fetch/metadata/tools/cases/master.yml | 17 ++ .../tools/templates/element-video.sub.html | 49 +++++ 7 files changed, 466 insertions(+) create mode 100644 fetch/metadata/generated/element-video-sec-fetch-dest.https.sub.html create mode 100644 fetch/metadata/generated/element-video-sec-fetch-mode.https.sub.html create mode 100644 fetch/metadata/generated/element-video-sec-fetch-site-mixed.https.sub.html create mode 100644 fetch/metadata/generated/element-video-sec-fetch-site.https.sub.html create mode 100644 fetch/metadata/generated/element-video-sec-fetch-site.sub.html create mode 100644 fetch/metadata/tools/templates/element-video.sub.html diff --git a/fetch/metadata/generated/element-video-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/element-video-sec-fetch-dest.https.sub.html new file mode 100644 index 00000000000000..970419f199da9b --- /dev/null +++ b/fetch/metadata/generated/element-video-sec-fetch-dest.https.sub.html @@ -0,0 +1,41 @@ + + + + + Fetch Metadata - Sec-Fetch-Dest + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/element-video-sec-fetch-mode.https.sub.html new file mode 100644 index 00000000000000..8eabc2261ec10d --- /dev/null +++ b/fetch/metadata/generated/element-video-sec-fetch-mode.https.sub.html @@ -0,0 +1,83 @@ + + + + + Fetch Metadata - Sec-Fetch-Mode + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/element-video-sec-fetch-site-mixed.https.sub.html new file mode 100644 index 00000000000000..4f05a863cd8bc7 --- /dev/null +++ b/fetch/metadata/generated/element-video-sec-fetch-site-mixed.https.sub.html @@ -0,0 +1,41 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection with mixed content + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-site.https.sub.html b/fetch/metadata/generated/element-video-sec-fetch-site.https.sub.html new file mode 100644 index 00000000000000..53c95ec264de92 --- /dev/null +++ b/fetch/metadata/generated/element-video-sec-fetch-site.https.sub.html @@ -0,0 +1,167 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-site.sub.html b/fetch/metadata/generated/element-video-sec-fetch-site.sub.html new file mode 100644 index 00000000000000..a8ab71c0b5f914 --- /dev/null +++ b/fetch/metadata/generated/element-video-sec-fetch-site.sub.html @@ -0,0 +1,68 @@ + + + + + Fetch Metadata - Sec-Fetch-Site - redirection from HTTP + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index edc3b5d2bc83a6..74a7975d375aa9 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -31,6 +31,7 @@ - description: ' - classic script' - description: ' - module script' elementAttrs: { type: module } + element-video.sub.html: [{}] fetch.sub.html: [{}] font.sub.html: [{}] form-submission.sub.html: @@ -105,6 +106,7 @@ - description: ' - classic script' - description: ' - module script' elementAttrs: { type: module } + element-video.sub.html: [{}] fetch.sub.html: [{ init: { mode: no-cors } }] font.sub.html: [{}] form-submission.sub.html: @@ -157,6 +159,7 @@ appcache-manifest.sub.https.html: [{}] element-image.sub.html: [{}] + element-video.sub.html: [{}] form-submission.sub.html: - description: ' - GET' method: GET @@ -217,6 +220,18 @@ - description: classic script, crossorigin="use-credentials" expected: cors elementAttrs: { crossorigin: use-credentials } + element-video.sub.html: + - description: no attributes + expected: no-cors + - description: crossorigin="" + expected: cors + elementAttrs: { crossorigin: '' } + - description: crossorigin="anonymous" + expected: cors + elementAttrs: { crossorigin: anonymous } + - description: crossorigin="use-credentials" + expected: cors + elementAttrs: { crossorigin: use-credentials } fetch.sub.html: - description: no options expected: cors @@ -276,6 +291,8 @@ - expected: image element-script.sub.html: - expected: script + element-video.sub.html: + - expected: video fetch.sub.html: - expected: empty font.sub.html: diff --git a/fetch/metadata/tools/templates/element-video.sub.html b/fetch/metadata/tools/templates/element-video.sub.html new file mode 100644 index 00000000000000..cba6975cfcf4b8 --- /dev/null +++ b/fetch/metadata/tools/templates/element-video.sub.html @@ -0,0 +1,49 @@ + + + + + [%title%] + + + + + + + From e8ee35720b23da1fc978b789223f9335d2774b81 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 13 Dec 2019 22:22:01 -0500 Subject: [PATCH 061/127] Trigger navigation from parent context This is necessary for automation because testdriver.js cannot interact with child browsing contexts. --- ...m-submission-sec-fetch-dest.https.sub.html | 42 +++++++++++-------- ...m-submission-sec-fetch-mode.https.sub.html | 42 +++++++++++-------- ...ission-sec-fetch-site-mixed.https.sub.html | 42 +++++++++++-------- ...m-submission-sec-fetch-site.https.sub.html | 42 +++++++++++-------- .../form-submission-sec-fetch-site.sub.html | 42 +++++++++++-------- .../tools/templates/form-submission.sub.html | 42 +++++++++++-------- 6 files changed, 150 insertions(+), 102 deletions(-) diff --git a/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html index e97e686face2ce..a3342d84b574a9 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html @@ -11,14 +11,27 @@ 'use strict'; function induceRequest(method, url) { - const win = window.open(); // Query parameters must be expressed as form values so that they are sent // with the submission of forms whose method is POST. - const inputs = Array.from(new URL(url, location.origin).searchParams) - .map(([name, value]) => - `` - ) - .join('\n'); + const windowName = String(Math.random()); + const form = document.createElement('form'); + const submit = document.createElement('input'); + submit.setAttribute('type', 'submit'); + form.appendChild(submit); + const win = open('about:blank', windowName); + form.setAttribute('method', method); + form.setAttribute('action', url); + form.setAttribute('target', windowName); + document.body.appendChild(form); + + Array.from(new URL(url, location.origin).searchParams) + .forEach(([name, value]) => { + const input = document.createElement('input'); + input.setAttribute('type', 'hidden'); + input.setAttribute('name', name); + input.setAttribute('value', value); + form.appendChild(input); + }); return new Promise((resolve) => { addEventListener('message', function(event) { @@ -26,18 +39,13 @@ resolve(); } }); - win.document.open(); - win.document.write(` - -
${inputs}
- + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/audio-worklet-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/audio-worklet-sec-fetch-dest.https.sub.html new file mode 100644 index 00000000000000..3ddb90ac5b3a2e --- /dev/null +++ b/fetch/metadata/generated/audio-worklet-sec-fetch-dest.https.sub.html @@ -0,0 +1,34 @@ + + + + + Fetch Metadata - Sec-Fetch-Dest + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/audioworklet-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/audioworklet-sec-fetch-dest.https.sub.html new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/fetch/metadata/generated/cors-preflight-sec-fetch-user.https.sub.html b/fetch/metadata/generated/cors-preflight-sec-fetch-user.https.sub.html new file mode 100644 index 00000000000000..4c1e1d9559e55d --- /dev/null +++ b/fetch/metadata/generated/cors-preflight-sec-fetch-user.https.sub.html @@ -0,0 +1,29 @@ + + + + + Fetch Metadata - Sec-Fetch-User + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/element-image-sec-fetch-user.https.sub.html b/fetch/metadata/generated/element-image-sec-fetch-user.https.sub.html new file mode 100644 index 00000000000000..3fc5207af61b65 --- /dev/null +++ b/fetch/metadata/generated/element-image-sec-fetch-user.https.sub.html @@ -0,0 +1,40 @@ + + + + + Fetch Metadata - Sec-Fetch-User + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/element-script-sec-fetch-user.https.sub.html b/fetch/metadata/generated/element-script-sec-fetch-user.https.sub.html new file mode 100644 index 00000000000000..b055abef78bea5 --- /dev/null +++ b/fetch/metadata/generated/element-script-sec-fetch-user.https.sub.html @@ -0,0 +1,44 @@ + + + + + Fetch Metadata - Sec-Fetch-User + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-user.https.sub.html b/fetch/metadata/generated/element-video-sec-fetch-user.https.sub.html new file mode 100644 index 00000000000000..83984ce4d8e678 --- /dev/null +++ b/fetch/metadata/generated/element-video-sec-fetch-user.https.sub.html @@ -0,0 +1,40 @@ + + + + + Fetch Metadata - Sec-Fetch-User + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-user.https.sub.html b/fetch/metadata/generated/fetch-sec-fetch-user.https.sub.html new file mode 100644 index 00000000000000..d0c4ea8f9dd751 --- /dev/null +++ b/fetch/metadata/generated/fetch-sec-fetch-user.https.sub.html @@ -0,0 +1,27 @@ + + + + + Fetch Metadata - Sec-Fetch-User + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/font-sec-fetch-user.https.sub.html b/fetch/metadata/generated/font-sec-fetch-user.https.sub.html new file mode 100644 index 00000000000000..fdf4f88c6876f9 --- /dev/null +++ b/fetch/metadata/generated/font-sec-fetch-user.https.sub.html @@ -0,0 +1,43 @@ + + + + + Fetch Metadata - Sec-Fetch-User + + + + +
test
+ + + \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html index a3342d84b574a9..bc332adfa7b8ca 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html @@ -10,7 +10,7 @@ + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/global-properties-sec-fetch-user.https.sub.html b/fetch/metadata/generated/global-properties-sec-fetch-user.https.sub.html new file mode 100644 index 00000000000000..fa6c5dc897980f --- /dev/null +++ b/fetch/metadata/generated/global-properties-sec-fetch-user.https.sub.html @@ -0,0 +1,91 @@ + + + + + Fetch Metadata - Sec-Fetch-User + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-user.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-user.https.sub.html new file mode 100644 index 00000000000000..6ddb53db83282c --- /dev/null +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-user.https.sub.html @@ -0,0 +1,24 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-user.https.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-user.https.sub.html new file mode 100644 index 00000000000000..ede2f35c5b5ce3 --- /dev/null +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-user.https.sub.html @@ -0,0 +1,43 @@ + + + + + Fetch Metadata - Sec-Fetch-User + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-user.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-user.https.sub.html new file mode 100644 index 00000000000000..4696a8eb95748c --- /dev/null +++ b/fetch/metadata/generated/video-poster-sec-fetch-user.https.sub.html @@ -0,0 +1,33 @@ + + + + + Fetch Metadata - Sec-Fetch-User + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-user.https.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-user.https.sub.html new file mode 100644 index 00000000000000..4997920ee86e1b --- /dev/null +++ b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-user.https.sub.html @@ -0,0 +1,48 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-user.https.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-user.https.sub.html new file mode 100644 index 00000000000000..2e6e1b64389c9f --- /dev/null +++ b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-user.https.sub.html @@ -0,0 +1,38 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 74a7975d375aa9..60f17c71b750a0 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -331,3 +331,64 @@ expected: worker worker-dedicated-importscripts.sub.html: - expected: script + +- title: Fetch Metadata - Sec-Fetch-User + fileName: sec-fetch-user.https + headerName: sec-fetch-user + each_subtest: + appcache-manifest.sub.https.html: + - expected: NULL + cors-preflight.sub.html: + - expected: NULL + element-image.sub.html: + - expected: NULL + element-script.sub.html: + - expected: NULL + element-video.sub.html: + - expected: NULL + fetch.sub.html: + - expected: NULL + font.sub.html: + - expected: NULL + form-submission.sub.html: + - description: ' - GET' + method: GET + expected: NULL + - description: ' - GET with user activation' + method: GET + bless: TRUE + expected: ?1 + - description: ' - POST' + method: POST + expected: NULL + - description: ' - POST with user activation' + method: POST + bless: TRUE + expected: ?1 + global-properties.sub.html: + - description: location + api: location + expected: NULL + - description: location.href + api: location.href + expected: NULL + - description: location.assign + api: location.assign + expected: NULL + - description: location.replace + api: location.replace + expected: NULL + script-module-import-dynamic.sub.html: + - expected: NULL + script-module-import-static.sub.html: + - expected: NULL + video-poster.sub.html: + - expected: NULL + worker-dedicated-constructor.sub.html: + - description: classic script + expected: NULL + - description: module script + options: { type: module } + expected: NULL + worker-dedicated-importscripts.sub.html: + - expected: NULL diff --git a/fetch/metadata/tools/templates/form-submission.sub.html b/fetch/metadata/tools/templates/form-submission.sub.html index bc037353bbb8ff..4954488b30ca34 100644 --- a/fetch/metadata/tools/templates/form-submission.sub.html +++ b/fetch/metadata/tools/templates/form-submission.sub.html @@ -5,12 +5,15 @@ [%title%] + {%- if subtests|selectattr('bless')|list %} + + {%- endif %} + \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 60f17c71b750a0..d2c2225235b8e2 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -369,15 +369,31 @@ - description: location api: location expected: NULL + - description: location with user activation + api: location + bless: TRUE + expected: ?1 - description: location.href api: location.href expected: NULL + - description: location.href with user activation + api: location.href + bless: TRUE + expected: ?1 - description: location.assign api: location.assign expected: NULL + - description: location.assign with user activation + api: location.assign + bless: TRUE + expected: ?1 - description: location.replace api: location.replace expected: NULL + - description: location.replace with user activation + api: location.replace + bless: TRUE + expected: ?1 script-module-import-dynamic.sub.html: - expected: NULL script-module-import-static.sub.html: diff --git a/fetch/metadata/tools/templates/global-properties.sub.html b/fetch/metadata/tools/templates/global-properties.sub.html index 08b70eec418a6c..f5d13c744ab250 100644 --- a/fetch/metadata/tools/templates/global-properties.sub.html +++ b/fetch/metadata/tools/templates/global-properties.sub.html @@ -8,14 +8,16 @@ [%title%] + {%- if subtests|selectattr('bless')|list %} + + {%- endif %} - {%- if subtests|selectattr('bless')|list %} + {%- if subtests|selectattr('userActivated')|list %} {%- endif %} @@ -13,7 +13,7 @@ - {%- if subtests|selectattr('bless')|list %} + {%- if subtests|selectattr('userActivated')|list %} {%- endif %} @@ -16,7 +16,7 @@ diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.https.sub.html index 55bbe1acabefff..a475405cb9c135 100644 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.https.sub.html @@ -1,5 +1,10 @@ - + diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html index 5fe07576408123..dd03ed0e860e9b 100644 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html @@ -1,5 +1,10 @@ - + diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html index 52722cb9160294..80181dc13cb6e2 100644 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html @@ -1,5 +1,10 @@ - + diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-user.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-user.https.sub.html index 6ddb53db83282c..e8ac737acba879 100644 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-user.https.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-user.https.sub.html @@ -1,5 +1,10 @@ - + diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.https.sub.html index 081f79754e33b5..3a50b6cf91e953 100644 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.https.sub.html +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.https.sub.html @@ -1,5 +1,10 @@ - + Fetch Metadata - Sec-Fetch-Dest diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-mode.https.sub.html index 33f449f6c71fa2..5d8d7f0cbebe3b 100644 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-mode.https.sub.html @@ -1,5 +1,10 @@ - + Fetch Metadata - Sec-Fetch-Mode diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html index 5a43f093e65cc3..f85447fb0e5290 100644 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html @@ -1,5 +1,10 @@ - + Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html index 4f5dd94d18d5a8..eebd45dd5fc025 100644 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html @@ -1,5 +1,10 @@ - + Fetch Metadata - Sec-Fetch-Site - redirection from HTTP diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-user.https.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-user.https.sub.html index ede2f35c5b5ce3..5787b455dce53d 100644 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-user.https.sub.html +++ b/fetch/metadata/generated/script-module-import-static-sec-fetch-user.https.sub.html @@ -1,5 +1,10 @@ - + Fetch Metadata - Sec-Fetch-User diff --git a/fetch/metadata/generated/video-poster-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-dest.https.sub.html index 47d1333a302a9f..4477255fb5170a 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-dest.https.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-dest.https.sub.html @@ -1,5 +1,10 @@ - + Fetch Metadata - Sec-Fetch-Dest diff --git a/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html index 10b2d6d692dc94..accec7cba2fafd 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html @@ -1,5 +1,10 @@ - + Fetch Metadata - Sec-Fetch-Mode diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html index af3443f3831aaa..72daa019b8ba48 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html @@ -1,5 +1,10 @@ - + Fetch Metadata - Sec-Fetch-Site - redirection with mixed content diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html index f7832926f900fe..331a284b7301f6 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html @@ -1,5 +1,10 @@ - + Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html index 596dd221eeadd5..81e6ec62179edc 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html @@ -1,5 +1,10 @@ - + Fetch Metadata - Sec-Fetch-Site - redirection from HTTP diff --git a/fetch/metadata/generated/video-poster-sec-fetch-user.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-user.https.sub.html index 4696a8eb95748c..8968f064e2a1c3 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-user.https.sub.html +++ b/fetch/metadata/generated/video-poster-sec-fetch-user.https.sub.html @@ -1,5 +1,10 @@ - + Fetch Metadata - Sec-Fetch-User diff --git a/fetch/metadata/generated/window-location-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/window-location-sec-fetch-dest.https.sub.html index 69caa888882a4c..1a988785febaac 100644 --- a/fetch/metadata/generated/window-location-sec-fetch-dest.https.sub.html +++ b/fetch/metadata/generated/window-location-sec-fetch-dest.https.sub.html @@ -1,5 +1,10 @@ - + Fetch Metadata - Sec-Fetch-Dest diff --git a/fetch/metadata/generated/window-location-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/window-location-sec-fetch-mode.https.sub.html index 4dd8367ec3b909..41a72a6485c660 100644 --- a/fetch/metadata/generated/window-location-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/window-location-sec-fetch-mode.https.sub.html @@ -1,5 +1,10 @@ - + Fetch Metadata - Sec-Fetch-Mode diff --git a/fetch/metadata/generated/window-location-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/window-location-sec-fetch-site-mixed.https.sub.html index 8ab5ec7fe14b57..6808220b808e48 100644 --- a/fetch/metadata/generated/window-location-sec-fetch-site-mixed.https.sub.html +++ b/fetch/metadata/generated/window-location-sec-fetch-site-mixed.https.sub.html @@ -1,5 +1,10 @@ - + Fetch Metadata - Sec-Fetch-Site - redirection with mixed content diff --git a/fetch/metadata/generated/window-location-sec-fetch-site.https.sub.html b/fetch/metadata/generated/window-location-sec-fetch-site.https.sub.html index 6e7e9ff25cf8e9..353e546c746bf3 100644 --- a/fetch/metadata/generated/window-location-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/window-location-sec-fetch-site.https.sub.html @@ -1,5 +1,10 @@ - + diff --git a/fetch/metadata/generated/window-location-sec-fetch-site.sub.html b/fetch/metadata/generated/window-location-sec-fetch-site.sub.html index 5f465c68c25e4a..13693058292560 100644 --- a/fetch/metadata/generated/window-location-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/window-location-sec-fetch-site.sub.html @@ -1,5 +1,10 @@ - + diff --git a/fetch/metadata/generated/window-location-sec-fetch-user.https.sub.html b/fetch/metadata/generated/window-location-sec-fetch-user.https.sub.html index 7cb59394a8bb9f..0c089e7c03ffa2 100644 --- a/fetch/metadata/generated/window-location-sec-fetch-user.https.sub.html +++ b/fetch/metadata/generated/window-location-sec-fetch-user.https.sub.html @@ -1,5 +1,10 @@ - + Fetch Metadata - Sec-Fetch-User diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.https.sub.html index 97774ea956beb9..954f58f5a87a5d 100644 --- a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.https.sub.html @@ -1,5 +1,10 @@ - + diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-mode.https.sub.html index 054766c12a4826..24720aa648ff78 100644 --- a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-mode.https.sub.html @@ -1,5 +1,10 @@ - + diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-user.https.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-user.https.sub.html index 4997920ee86e1b..80b844d65d8276 100644 --- a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-user.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-user.https.sub.html @@ -1,5 +1,10 @@ - + diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.https.sub.html index 6ee5d853ac2cce..a4f41c6352f569 100644 --- a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.https.sub.html @@ -1,5 +1,10 @@ - + diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.https.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.https.sub.html index 88662cea9bace4..fe8d6fc4cae055 100644 --- a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.https.sub.html @@ -1,5 +1,10 @@ - + diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.sub.html index dd24505f2aa544..e0f01b30fc5463 100644 --- a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.sub.html @@ -1,5 +1,10 @@ - + diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-user.https.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-user.https.sub.html index fbc6704ea6cf3d..51877f7ee4e1e8 100644 --- a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-user.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-user.https.sub.html @@ -1,5 +1,10 @@ - + diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index 83b331f0267751..b2dd5e3c7e1d8b 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -9,6 +9,7 @@ OUT_DIR = os.path.normpath(os.path.join(HERE, '..', 'generated')) TEMPLATES_DIR = os.path.join(HERE, 'templates') CASES = os.path.join(HERE, 'cases', 'master.yml') +PROJECT_ROOT = os.path.join(HERE, '..', '..', '..') def find_templates(starting_directory): for directory, subdirectories, file_names in os.walk(starting_directory): @@ -43,7 +44,15 @@ def cross(a, b): yield merged -def main(templates_directory, cases_file, out_directory): +def make_provenance(project_root, cases, template): + return '\n'.join([ + 'This test was procedurally generated. Please do not modify it directly.', + 'Sources:', + '- {}'.format(os.path.relpath(cases, project_root)), + '- {}'.format(os.path.relpath(template, project_root)) + ]) + +def main(project_root, templates_directory, cases_file, out_directory): templates = {} for template_name, path in find_templates(templates_directory): with open(path, 'r') as handle: @@ -79,7 +88,12 @@ def main(templates_directory, cases_file, out_directory): subtests=[subtest for subtest in cross( case.get('all_subtests', [{}]), concise_subtests )], - **case + **case, + provenance=make_provenance( + project_root, + cases_file, + os.path.join(templates_directory, template_name) + ) ) context.pop('all_subtests', None) context.pop('each_subtest') @@ -92,4 +106,4 @@ def main(templates_directory, cases_file, out_directory): handle.write(templates[template_name].render(**context)) if __name__ == '__main__': - main(TEMPLATES_DIR, CASES, OUT_DIR) + main(PROJECT_ROOT, TEMPLATES_DIR, CASES, OUT_DIR) diff --git a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html index f89ef64598e1e9..67d734cee9bd80 100644 --- a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html +++ b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html @@ -1,5 +1,7 @@ - + [%title%] diff --git a/fetch/metadata/tools/templates/cors-preflight.sub.html b/fetch/metadata/tools/templates/cors-preflight.sub.html index bee6f2148dd1a7..614efd21e6888c 100644 --- a/fetch/metadata/tools/templates/cors-preflight.sub.html +++ b/fetch/metadata/tools/templates/cors-preflight.sub.html @@ -1,5 +1,7 @@ - + [%title%] diff --git a/fetch/metadata/tools/templates/element-image.sub.html b/fetch/metadata/tools/templates/element-image.sub.html index 526875175d472e..cc90ec1025f75e 100644 --- a/fetch/metadata/tools/templates/element-image.sub.html +++ b/fetch/metadata/tools/templates/element-image.sub.html @@ -1,5 +1,7 @@ - + [%title%] diff --git a/fetch/metadata/tools/templates/element-script.sub.html b/fetch/metadata/tools/templates/element-script.sub.html index a6936703c7dd26..74b3d6846e9c0d 100644 --- a/fetch/metadata/tools/templates/element-script.sub.html +++ b/fetch/metadata/tools/templates/element-script.sub.html @@ -1,5 +1,7 @@ - + [%title%] diff --git a/fetch/metadata/tools/templates/element-video.sub.html b/fetch/metadata/tools/templates/element-video.sub.html index d625b98c0a02a4..9ce5fc8136bea5 100644 --- a/fetch/metadata/tools/templates/element-video.sub.html +++ b/fetch/metadata/tools/templates/element-video.sub.html @@ -1,5 +1,7 @@ - + [%title%] diff --git a/fetch/metadata/tools/templates/fetch.sub.html b/fetch/metadata/tools/templates/fetch.sub.html index 416766c734e430..0a3e1317948a0f 100644 --- a/fetch/metadata/tools/templates/fetch.sub.html +++ b/fetch/metadata/tools/templates/fetch.sub.html @@ -1,5 +1,7 @@ - + [%title%] diff --git a/fetch/metadata/tools/templates/font.sub.html b/fetch/metadata/tools/templates/font.sub.html index 92bae9fa97f235..9cbfc2ef5df534 100644 --- a/fetch/metadata/tools/templates/font.sub.html +++ b/fetch/metadata/tools/templates/font.sub.html @@ -1,5 +1,7 @@ - + [%title%] diff --git a/fetch/metadata/tools/templates/form-submission.sub.html b/fetch/metadata/tools/templates/form-submission.sub.html index 3ca7052dabe255..d55114d837404e 100644 --- a/fetch/metadata/tools/templates/form-submission.sub.html +++ b/fetch/metadata/tools/templates/form-submission.sub.html @@ -1,5 +1,7 @@ - + [%title%] diff --git a/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html b/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html index 27fce03f2a776e..b510c329e595d2 100644 --- a/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html +++ b/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html @@ -1,5 +1,7 @@ - + diff --git a/fetch/metadata/tools/templates/script-module-import-static.sub.html b/fetch/metadata/tools/templates/script-module-import-static.sub.html index cc7cf6c050c33a..3ac7c0d6e4973e 100644 --- a/fetch/metadata/tools/templates/script-module-import-static.sub.html +++ b/fetch/metadata/tools/templates/script-module-import-static.sub.html @@ -1,5 +1,7 @@ - + [%title%] diff --git a/fetch/metadata/tools/templates/video-poster.sub.html b/fetch/metadata/tools/templates/video-poster.sub.html index 91a0e1d9c98363..d9973b80f46795 100644 --- a/fetch/metadata/tools/templates/video-poster.sub.html +++ b/fetch/metadata/tools/templates/video-poster.sub.html @@ -1,5 +1,7 @@ - + [%title%] diff --git a/fetch/metadata/tools/templates/window-location.sub.html b/fetch/metadata/tools/templates/window-location.sub.html index d30ab54861ee4e..f2eb08624413ef 100644 --- a/fetch/metadata/tools/templates/window-location.sub.html +++ b/fetch/metadata/tools/templates/window-location.sub.html @@ -1,5 +1,7 @@ - + {%- if subtests|length > 10 %} diff --git a/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html b/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html index 96a32922334620..c1b374e81eeef9 100644 --- a/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html +++ b/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html @@ -1,5 +1,7 @@ - + diff --git a/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html b/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html index eb8b1781e2401b..5ab538316f5957 100644 --- a/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html +++ b/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html @@ -1,5 +1,7 @@ - + From 6e7819052a9d5c5b1ceaf97518163e36ae71e8a2 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 1 May 2020 22:20:55 -0400 Subject: [PATCH 076/127] Remove outdated files --- ...udio-worklet-sec-fetch-dest.https.sub.html | 34 ------------------- ...audioworklet-sec-fetch-dest.https.sub.html | 0 2 files changed, 34 deletions(-) delete mode 100644 fetch/metadata/generated/audio-worklet-sec-fetch-dest.https.sub.html delete mode 100644 fetch/metadata/generated/audioworklet-sec-fetch-dest.https.sub.html diff --git a/fetch/metadata/generated/audio-worklet-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/audio-worklet-sec-fetch-dest.https.sub.html deleted file mode 100644 index 3ddb90ac5b3a2e..00000000000000 --- a/fetch/metadata/generated/audio-worklet-sec-fetch-dest.https.sub.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Dest - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/audioworklet-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/audioworklet-sec-fetch-dest.https.sub.html deleted file mode 100644 index e69de29bb2d1d6..00000000000000 From 7eef86b7b3a3fb410adf16ef386951e22723058d Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 30 Apr 2020 19:24:20 -0400 Subject: [PATCH 077/127] Move header names --- fetch/metadata/tools/cases/master.yml | 26 ++++++++++++++----- .../appcache-manifest.sub.https.html | 6 ++--- .../tools/templates/cors-preflight.sub.html | 6 ++--- .../tools/templates/element-image.sub.html | 6 ++--- .../tools/templates/element-script.sub.html | 6 ++--- .../tools/templates/element-video.sub.html | 6 ++--- fetch/metadata/tools/templates/fetch.sub.html | 6 ++--- fetch/metadata/tools/templates/font.sub.html | 6 ++--- .../tools/templates/form-submission.sub.html | 6 ++--- .../script-module-import-dynamic.sub.html | 6 ++--- .../script-module-import-static.sub.html | 6 ++--- .../tools/templates/video-poster.sub.html | 6 ++--- .../tools/templates/window-location.sub.html | 6 ++--- .../worker-dedicated-constructor.sub.html | 6 ++--- .../worker-dedicated-importscripts.sub.html | 6 ++--- 15 files changed, 62 insertions(+), 48 deletions(-) diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 11c50c8a2e3350..12e9f55485766b 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -1,15 +1,17 @@ --- - title: Fetch Metadata - Sec-Fetch-Site - redirection from HTTP fileName: sec-fetch-site - headerName: sec-fetch-site all_subtests: - description: HTTPS downgrade (header not sent) + headerName: sec-fetch-site origins: [sameOrigin, httpOrigin] expected: NULL - description: HTTPS upgrade + headerName: sec-fetch-site origins: [httpOrigin, sameOrigin] expected: cross-site - description: HTTPS downgrade-upgrade + headerName: sec-fetch-site origins: [sameOrigin, httpOrigin, sameOrigin] expected: cross-site each_subtest: @@ -55,36 +57,45 @@ - title: Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS fileName: sec-fetch-site.https - headerName: sec-fetch-site all_subtests: - description: Same-Origin -> Cross-Site -> Same-Origin redirect + headerName: sec-fetch-site origins: [sameOrigin, crossSite, sameOrigin] expected: cross-site - description: Cross-Site -> Same Origin + headerName: sec-fetch-site origins: [crossSite, sameOrigin] expected: cross-site - description: Cross-Site -> Same-Site + headerName: sec-fetch-site origins: [crossSite, sameSite] expected: cross-site - description: Cross-Site -> Cross-Site + headerName: sec-fetch-site origins: [crossSite, crossSite] expected: cross-site - description: Same-Origin -> Same Origin + headerName: sec-fetch-site origins: [sameOrigin, sameOrigin] expected: same-origin - description: Same-Origin -> Same-Site + headerName: sec-fetch-site origins: [sameOrigin, sameSite] expected: same-site - description: Same-Origin -> Cross-Site + headerName: sec-fetch-site origins: [sameOrigin, crossSite] expected: cross-site - description: Same-Site -> Same Origin + headerName: sec-fetch-site origins: [sameSite, sameOrigin] expected: same-site - description: Same-Site -> Same-Site + headerName: sec-fetch-site origins: [sameSite, sameSite] expected: same-site - description: Same-Site -> Cross-Site + headerName: sec-fetch-site origins: [sameSite, crossSite] expected: cross-site each_subtest: @@ -140,9 +151,9 @@ # # [1] https://w3c.github.io/webappsec-mixed-content/#should-block-fetch fileName: sec-fetch-site-mixed.https - headerName: sec-fetch-site all_subtests: - description: HTTPS downgrade-upgrade + headerName: sec-fetch-site origins: [sameOrigin, httpOrigin, sameOrigin] expected: cross-site each_subtest: @@ -183,7 +194,8 @@ # [1] https://html.spec.whatwg.org/multipage/origin.html#same-origin # [2] https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-url fileName: sec-fetch-mode.https - headerName: sec-fetch-mode + all_subtests: + - headerName: sec-fetch-mode each_subtest: # Unused # TODO(jugglinmike) document rationale @@ -281,7 +293,8 @@ - title: Fetch Metadata - Sec-Fetch-Dest fileName: sec-fetch-dest.https - headerName: sec-fetch-dest + all_subtests: + - headerName: sec-fetch-dest each_subtest: appcache-manifest.sub.https.html: - expected: empty @@ -334,7 +347,8 @@ - title: Fetch Metadata - Sec-Fetch-User fileName: sec-fetch-user.https - headerName: sec-fetch-user + all_subtests: + - headerName: sec-fetch-user each_subtest: appcache-manifest.sub.https.html: - expected: NULL diff --git a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html index 67d734cee9bd80..6439992a9607cd 100644 --- a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html +++ b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html @@ -49,10 +49,10 @@ .then(() => retrieve(key)) .then((headers) => { {%- if subtest.expected == none %} - assert_not_own_property(headers, '[%headerName%]'); + assert_not_own_property(headers, '[%subtest.headerName%]'); {%- else %} - assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); }, '[%subtest.description%]'); diff --git a/fetch/metadata/tools/templates/cors-preflight.sub.html b/fetch/metadata/tools/templates/cors-preflight.sub.html index 614efd21e6888c..cd250cb3741492 100644 --- a/fetch/metadata/tools/templates/cors-preflight.sub.html +++ b/fetch/metadata/tools/templates/cors-preflight.sub.html @@ -29,10 +29,10 @@ .then(() => retrieve(key)) .then((headers) => { {%- if subtest.expected == none %} - assert_not_own_property(headers, '[%headerName%]'); + assert_not_own_property(headers, '[%subtest.headerName%]'); {%- else %} - assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); }, '[%subtest.description%]'); diff --git a/fetch/metadata/tools/templates/element-image.sub.html b/fetch/metadata/tools/templates/element-image.sub.html index cc90ec1025f75e..26811723a3d662 100644 --- a/fetch/metadata/tools/templates/element-image.sub.html +++ b/fetch/metadata/tools/templates/element-image.sub.html @@ -37,10 +37,10 @@ .then(() => retrieve(key)) .then((headers) => { {%- if subtest.expected == none %} - assert_not_own_property(headers, '[%headerName%]'); + assert_not_own_property(headers, '[%subtest.headerName%]'); {%- else %} - assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); }, '[%subtest.description%]'); diff --git a/fetch/metadata/tools/templates/element-script.sub.html b/fetch/metadata/tools/templates/element-script.sub.html index 74b3d6846e9c0d..cebd11a31cd416 100644 --- a/fetch/metadata/tools/templates/element-script.sub.html +++ b/fetch/metadata/tools/templates/element-script.sub.html @@ -41,10 +41,10 @@ .then(() => retrieve(key)) .then((headers) => { {%- if subtest.expected == none %} - assert_not_own_property(headers, '[%headerName%]'); + assert_not_own_property(headers, '[%subtest.headerName%]'); {%- else %} - assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); }, '[%subtest.description%]'); diff --git a/fetch/metadata/tools/templates/element-video.sub.html b/fetch/metadata/tools/templates/element-video.sub.html index 9ce5fc8136bea5..6e9b8d2cc0ea1f 100644 --- a/fetch/metadata/tools/templates/element-video.sub.html +++ b/fetch/metadata/tools/templates/element-video.sub.html @@ -37,10 +37,10 @@ .then(() => retrieve(key)) .then((headers) => { {%- if subtest.expected == none %} - assert_not_own_property(headers, '[%headerName%]'); + assert_not_own_property(headers, '[%subtest.headerName%]'); {%- else %} - assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); }, '[%subtest.description%]'); diff --git a/fetch/metadata/tools/templates/fetch.sub.html b/fetch/metadata/tools/templates/fetch.sub.html index 0a3e1317948a0f..492de293d320bf 100644 --- a/fetch/metadata/tools/templates/fetch.sub.html +++ b/fetch/metadata/tools/templates/fetch.sub.html @@ -28,10 +28,10 @@ .then(() => retrieve(key)) .then((headers) => { {%- if subtest.expected == none %} - assert_not_own_property(headers, '[%headerName%]'); + assert_not_own_property(headers, '[%subtest.headerName%]'); {%- else %} - assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); }, '[%subtest.description%]'); diff --git a/fetch/metadata/tools/templates/font.sub.html b/fetch/metadata/tools/templates/font.sub.html index 9cbfc2ef5df534..42a93d33afe4f5 100644 --- a/fetch/metadata/tools/templates/font.sub.html +++ b/fetch/metadata/tools/templates/font.sub.html @@ -43,10 +43,10 @@ }) .then((headers) => { {%- if subtest.expected == none %} - assert_not_own_property(headers, '[%headerName%]'); + assert_not_own_property(headers, '[%subtest.headerName%]'); {%- else %} - assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); }, '[%subtest.description%]'); diff --git a/fetch/metadata/tools/templates/form-submission.sub.html b/fetch/metadata/tools/templates/form-submission.sub.html index d55114d837404e..fa4f0ccb9d7bb5 100644 --- a/fetch/metadata/tools/templates/form-submission.sub.html +++ b/fetch/metadata/tools/templates/form-submission.sub.html @@ -71,10 +71,10 @@ .then(() => retrieve(key)) .then((headers) => { {%- if subtest.expected == none %} - assert_not_own_property(headers, '[%headerName%]'); + assert_not_own_property(headers, '[%subtest.headerName%]'); {%- else %} - assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); }, '[%subtest.description%]'); diff --git a/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html b/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html index b510c329e595d2..730f5534e3d8f1 100644 --- a/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html +++ b/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html @@ -21,10 +21,10 @@ .then(() => retrieve(key)) .then((headers) => { {%- if subtest.expected == none %} - assert_not_own_property(headers, '[%headerName%]'); + assert_not_own_property(headers, '[%subtest.headerName%]'); {%- else %} - assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); }, '[%subtest.description%]'); diff --git a/fetch/metadata/tools/templates/script-module-import-static.sub.html b/fetch/metadata/tools/templates/script-module-import-static.sub.html index 3ac7c0d6e4973e..7eec0e009972c3 100644 --- a/fetch/metadata/tools/templates/script-module-import-static.sub.html +++ b/fetch/metadata/tools/templates/script-module-import-static.sub.html @@ -40,10 +40,10 @@ .then(() => retrieve(key)) .then((headers) => { {%- if subtest.expected == none %} - assert_not_own_property(headers, '[%headerName%]'); + assert_not_own_property(headers, '[%subtest.headerName%]'); {%- else %} - assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); }, '[%subtest.description%]'); diff --git a/fetch/metadata/tools/templates/video-poster.sub.html b/fetch/metadata/tools/templates/video-poster.sub.html index d9973b80f46795..7795ff644ee960 100644 --- a/fetch/metadata/tools/templates/video-poster.sub.html +++ b/fetch/metadata/tools/templates/video-poster.sub.html @@ -30,10 +30,10 @@ return retrieve(key, { poll: true }) .then((headers) => { {%- if subtest.expected == none %} - assert_not_own_property(headers, '[%headerName%]'); + assert_not_own_property(headers, '[%subtest.headerName%]'); {%- else %} - assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); }, '[%subtest.description%]'); diff --git a/fetch/metadata/tools/templates/window-location.sub.html b/fetch/metadata/tools/templates/window-location.sub.html index f2eb08624413ef..503d91669abae9 100644 --- a/fetch/metadata/tools/templates/window-location.sub.html +++ b/fetch/metadata/tools/templates/window-location.sub.html @@ -60,10 +60,10 @@ .then(() => retrieve(key)) .then((headers) => { {%- if subtest.expected == none %} - assert_not_own_property(headers, '[%headerName%]'); + assert_not_own_property(headers, '[%subtest.headerName%]'); {%- else %} - assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); }, '[%subtest.description%]'); diff --git a/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html b/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html index c1b374e81eeef9..62753f89d0da94 100644 --- a/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html +++ b/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html @@ -35,10 +35,10 @@ .then(() => retrieve(key)) .then((headers) => { {%- if subtest.expected == none %} - assert_not_own_property(headers, '[%headerName%]'); + assert_not_own_property(headers, '[%subtest.headerName%]'); {%- else %} - assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); }, '[%subtest.description%]'); diff --git a/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html b/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html index 5ab538316f5957..b9967c77babb9a 100644 --- a/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html +++ b/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html @@ -40,10 +40,10 @@ .then(() => retrieve(key)) .then((headers) => { {%- if subtest.expected == none %} - assert_not_own_property(headers, '[%headerName%]'); + assert_not_own_property(headers, '[%subtest.headerName%]'); {%- else %} - assert_own_property(headers, '[%headerName%]'); - assert_equals(headers['[%headerName%]'], '[%subtest.expected%]'); + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); }, '[%subtest.description%]'); From 84c90d8324c641829f8796ac0028da1f6dcd3bd1 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 30 Apr 2020 21:43:15 -0400 Subject: [PATCH 078/127] Build subtest titles in templates --- ...lement-image-sec-fetch-dest.https.sub.html | 2 +- ...lement-image-sec-fetch-mode.https.sub.html | 6 +- ...-image-sec-fetch-site-mixed.https.sub.html | 2 +- ...lement-image-sec-fetch-site.https.sub.html | 20 +- .../element-image-sec-fetch-site.sub.html | 6 +- ...lement-image-sec-fetch-user.https.sub.html | 2 +- ...ement-script-sec-fetch-dest.https.sub.html | 2 +- ...ement-script-sec-fetch-mode.https.sub.html | 10 +- ...ement-script-sec-fetch-site.https.sub.html | 40 ++-- .../element-script-sec-fetch-site.sub.html | 12 +- ...ement-script-sec-fetch-user.https.sub.html | 2 +- ...lement-video-sec-fetch-dest.https.sub.html | 2 +- ...lement-video-sec-fetch-mode.https.sub.html | 6 +- ...-video-sec-fetch-site-mixed.https.sub.html | 2 +- ...lement-video-sec-fetch-site.https.sub.html | 20 +- .../element-video-sec-fetch-site.sub.html | 6 +- ...lement-video-sec-fetch-user.https.sub.html | 2 +- .../fetch-sec-fetch-dest.https.sub.html | 2 +- .../fetch-sec-fetch-mode.https.sub.html | 8 +- .../fetch-sec-fetch-site.https.sub.html | 20 +- .../generated/fetch-sec-fetch-site.sub.html | 6 +- .../fetch-sec-fetch-user.https.sub.html | 2 +- ...m-submission-sec-fetch-dest.https.sub.html | 4 +- ...m-submission-sec-fetch-user.https.sub.html | 8 +- ...-constructor-sec-fetch-dest.https.sub.html | 4 +- ...-constructor-sec-fetch-mode.https.sub.html | 4 +- ...-constructor-sec-fetch-user.https.sub.html | 4 +- fetch/metadata/tools/cases/master.yml | 205 ++++++------------ fetch/metadata/tools/generate.py | 36 ++- .../tools/templates/element-image.sub.html | 2 +- .../tools/templates/element-script.sub.html | 2 +- .../tools/templates/element-video.sub.html | 2 +- fetch/metadata/tools/templates/fetch.sub.html | 2 +- .../tools/templates/form-submission.sub.html | 2 +- .../tools/templates/window-location.sub.html | 2 +- .../worker-dedicated-constructor.sub.html | 2 +- 36 files changed, 204 insertions(+), 255 deletions(-) diff --git a/fetch/metadata/generated/element-image-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/element-image-sec-fetch-dest.https.sub.html index 3d760156289102..e8529155ca2ff1 100644 --- a/fetch/metadata/generated/element-image-sec-fetch-dest.https.sub.html +++ b/fetch/metadata/generated/element-image-sec-fetch-dest.https.sub.html @@ -40,7 +40,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'image'); }); - }, ''); + }, 'no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-image-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/element-image-sec-fetch-mode.https.sub.html index d9f08f34a33866..b7ec427ccb84d5 100644 --- a/fetch/metadata/generated/element-image-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/element-image-sec-fetch-mode.https.sub.html @@ -54,7 +54,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'crossorigin=""'); + }, 'attributes: crossorigin='); promise_test(() => { const key = '{{uuid()}}'; @@ -68,7 +68,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'crossorigin="anonymous"'); + }, 'attributes: crossorigin=anonymous'); promise_test(() => { const key = '{{uuid()}}'; @@ -82,7 +82,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'crossorigin="use-credentials"'); + }, 'attributes: crossorigin=use-credentials'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-image-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/element-image-sec-fetch-site-mixed.https.sub.html index 19d717c91d12dc..bab306e14dcd8b 100644 --- a/fetch/metadata/generated/element-image-sec-fetch-site-mixed.https.sub.html +++ b/fetch/metadata/generated/element-image-sec-fetch-site-mixed.https.sub.html @@ -40,7 +40,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade'); + }, 'HTTPS downgrade-upgrade, no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-image-sec-fetch-site.https.sub.html b/fetch/metadata/generated/element-image-sec-fetch-site.https.sub.html index 7b2c98ca89ee3a..e325619032132e 100644 --- a/fetch/metadata/generated/element-image-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/element-image-sec-fetch-site.https.sub.html @@ -40,7 +40,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -54,7 +54,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin'); + }, 'Cross-Site -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -68,7 +68,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site'); + }, 'Cross-Site -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -82,7 +82,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site'); + }, 'Cross-Site -> Cross-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -96,7 +96,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin'); + }, 'Same-Origin -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -110,7 +110,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site'); + }, 'Same-Origin -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -124,7 +124,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site'); + }, 'Same-Origin -> Cross-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -138,7 +138,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin'); + }, 'Same-Site -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -152,7 +152,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site'); + }, 'Same-Site -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -166,7 +166,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site'); + }, 'Same-Site -> Cross-Site, no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-image-sec-fetch-site.sub.html b/fetch/metadata/generated/element-image-sec-fetch-site.sub.html index 09124d0c2f06dd..8c6aa80e08b35a 100644 --- a/fetch/metadata/generated/element-image-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/element-image-sec-fetch-site.sub.html @@ -39,7 +39,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent)'); + }, 'HTTPS downgrade (header not sent), no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -53,7 +53,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade'); + }, 'HTTPS upgrade, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -67,7 +67,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade'); + }, 'HTTPS downgrade-upgrade, no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-image-sec-fetch-user.https.sub.html b/fetch/metadata/generated/element-image-sec-fetch-user.https.sub.html index b18ed282a26c99..4c8fe75b3a62a9 100644 --- a/fetch/metadata/generated/element-image-sec-fetch-user.https.sub.html +++ b/fetch/metadata/generated/element-image-sec-fetch-user.https.sub.html @@ -39,7 +39,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-user'); }); - }, ''); + }, 'no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-script-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/element-script-sec-fetch-dest.https.sub.html index c160db7ece9743..f4ae5acd693859 100644 --- a/fetch/metadata/generated/element-script-sec-fetch-dest.https.sub.html +++ b/fetch/metadata/generated/element-script-sec-fetch-dest.https.sub.html @@ -45,6 +45,6 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'script'); }); - }, ''); + }, 'no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-script-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/element-script-sec-fetch-mode.https.sub.html index 156dd0a6178b1b..ea9e2869832a82 100644 --- a/fetch/metadata/generated/element-script-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/element-script-sec-fetch-mode.https.sub.html @@ -45,7 +45,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'no-cors'); }); - }, 'classic script'); + }, 'no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -61,7 +61,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'module script'); + }, 'attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -77,7 +77,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'classic script, crossorigin=""'); + }, 'attributes: crossorigin='); promise_test(() => { const key = '{{uuid()}}'; @@ -93,7 +93,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'classic script, crossorigin="anonymous"'); + }, 'attributes: crossorigin=anonymous'); promise_test(() => { const key = '{{uuid()}}'; @@ -109,6 +109,6 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'classic script, crossorigin="use-credentials"'); + }, 'attributes: crossorigin=use-credentials'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-script-sec-fetch-site.https.sub.html b/fetch/metadata/generated/element-script-sec-fetch-site.https.sub.html index 42120cb2d91c30..6076a424981fde 100644 --- a/fetch/metadata/generated/element-script-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/element-script-sec-fetch-site.https.sub.html @@ -45,7 +45,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect - classic script'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -61,7 +61,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect - module script'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -77,7 +77,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin - classic script'); + }, 'Cross-Site -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -93,7 +93,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin - module script'); + }, 'Cross-Site -> Same Origin, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -109,7 +109,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site - classic script'); + }, 'Cross-Site -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -125,7 +125,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site - module script'); + }, 'Cross-Site -> Same-Site, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -141,7 +141,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site - classic script'); + }, 'Cross-Site -> Cross-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -157,7 +157,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site - module script'); + }, 'Cross-Site -> Cross-Site, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -173,7 +173,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin - classic script'); + }, 'Same-Origin -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -189,7 +189,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin - module script'); + }, 'Same-Origin -> Same Origin, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -205,7 +205,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site - classic script'); + }, 'Same-Origin -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -221,7 +221,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site - module script'); + }, 'Same-Origin -> Same-Site, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -237,7 +237,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site - classic script'); + }, 'Same-Origin -> Cross-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -253,7 +253,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site - module script'); + }, 'Same-Origin -> Cross-Site, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -269,7 +269,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin - classic script'); + }, 'Same-Site -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -285,7 +285,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin - module script'); + }, 'Same-Site -> Same Origin, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -301,7 +301,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site - classic script'); + }, 'Same-Site -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -317,7 +317,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site - module script'); + }, 'Same-Site -> Same-Site, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -333,7 +333,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site - classic script'); + }, 'Same-Site -> Cross-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -349,6 +349,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site - module script'); + }, 'Same-Site -> Cross-Site, attributes: type=module'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-script-sec-fetch-site.sub.html b/fetch/metadata/generated/element-script-sec-fetch-site.sub.html index 7a883c44a12f0e..a688cdc201ef30 100644 --- a/fetch/metadata/generated/element-script-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/element-script-sec-fetch-site.sub.html @@ -44,7 +44,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent) - classic script'); + }, 'HTTPS downgrade (header not sent), no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -59,7 +59,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent) - module script'); + }, 'HTTPS downgrade (header not sent), attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -75,7 +75,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade - classic script'); + }, 'HTTPS upgrade, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -91,7 +91,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade - module script'); + }, 'HTTPS upgrade, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -107,7 +107,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade - classic script'); + }, 'HTTPS downgrade-upgrade, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -123,6 +123,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade - module script'); + }, 'HTTPS downgrade-upgrade, attributes: type=module'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-script-sec-fetch-user.https.sub.html b/fetch/metadata/generated/element-script-sec-fetch-user.https.sub.html index 5e60a48d61ae4f..76be1b033c58c8 100644 --- a/fetch/metadata/generated/element-script-sec-fetch-user.https.sub.html +++ b/fetch/metadata/generated/element-script-sec-fetch-user.https.sub.html @@ -44,6 +44,6 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-user'); }); - }, ''); + }, 'no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/element-video-sec-fetch-dest.https.sub.html index 69d085b8ce52b3..c9a83a0be74367 100644 --- a/fetch/metadata/generated/element-video-sec-fetch-dest.https.sub.html +++ b/fetch/metadata/generated/element-video-sec-fetch-dest.https.sub.html @@ -40,7 +40,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'video'); }); - }, ''); + }, 'no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/element-video-sec-fetch-mode.https.sub.html index 1a84ce6c2191ca..a6cbec85581e07 100644 --- a/fetch/metadata/generated/element-video-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/element-video-sec-fetch-mode.https.sub.html @@ -54,7 +54,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'crossorigin=""'); + }, 'attributes: crossorigin='); promise_test(() => { const key = '{{uuid()}}'; @@ -68,7 +68,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'crossorigin="anonymous"'); + }, 'attributes: crossorigin=anonymous'); promise_test(() => { const key = '{{uuid()}}'; @@ -82,7 +82,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'crossorigin="use-credentials"'); + }, 'attributes: crossorigin=use-credentials'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/element-video-sec-fetch-site-mixed.https.sub.html index eb8be7ebf260f3..1fb3013ae4af32 100644 --- a/fetch/metadata/generated/element-video-sec-fetch-site-mixed.https.sub.html +++ b/fetch/metadata/generated/element-video-sec-fetch-site-mixed.https.sub.html @@ -40,7 +40,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade'); + }, 'HTTPS downgrade-upgrade, no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-site.https.sub.html b/fetch/metadata/generated/element-video-sec-fetch-site.https.sub.html index 9ddb5e998deed7..d8fc0558d844d2 100644 --- a/fetch/metadata/generated/element-video-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/element-video-sec-fetch-site.https.sub.html @@ -40,7 +40,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -54,7 +54,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin'); + }, 'Cross-Site -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -68,7 +68,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site'); + }, 'Cross-Site -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -82,7 +82,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site'); + }, 'Cross-Site -> Cross-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -96,7 +96,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin'); + }, 'Same-Origin -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -110,7 +110,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site'); + }, 'Same-Origin -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -124,7 +124,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site'); + }, 'Same-Origin -> Cross-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -138,7 +138,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin'); + }, 'Same-Site -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -152,7 +152,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site'); + }, 'Same-Site -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -166,7 +166,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site'); + }, 'Same-Site -> Cross-Site, no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-site.sub.html b/fetch/metadata/generated/element-video-sec-fetch-site.sub.html index 0016ffd9dac11a..30ee58271eb4e9 100644 --- a/fetch/metadata/generated/element-video-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/element-video-sec-fetch-site.sub.html @@ -39,7 +39,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent)'); + }, 'HTTPS downgrade (header not sent), no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -53,7 +53,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade'); + }, 'HTTPS upgrade, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -67,7 +67,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade'); + }, 'HTTPS downgrade-upgrade, no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-user.https.sub.html b/fetch/metadata/generated/element-video-sec-fetch-user.https.sub.html index 9fea4b03c731ed..0b1e6466308ecf 100644 --- a/fetch/metadata/generated/element-video-sec-fetch-user.https.sub.html +++ b/fetch/metadata/generated/element-video-sec-fetch-user.https.sub.html @@ -39,7 +39,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-user'); }); - }, ''); + }, 'no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/fetch-sec-fetch-dest.https.sub.html index c1c4efe4ad6f42..cdf4c69fdce5f2 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-dest.https.sub.html +++ b/fetch/metadata/generated/fetch-sec-fetch-dest.https.sub.html @@ -31,7 +31,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'empty'); }); - }, ''); + }, 'no init'); \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html index 9596fc34c9ebdd..c32965b3c2d63e 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html @@ -31,7 +31,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'no options'); + }, 'no init'); promise_test(() => { const key = '{{uuid()}}'; @@ -45,7 +45,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'mode: cors'); + }, 'init: mode=cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -59,7 +59,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'no-cors'); }); - }, 'mode: no-cors'); + }, 'init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -73,7 +73,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'same-origin'); }); - }, 'mode: same-origin'); + }, 'init: mode=same-origin'); \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html b/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html index c9e694866fcff4..fdfad418ae8c3c 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html @@ -31,7 +31,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'Same-Origin -> Cross-Site -> Same-Origin redirect, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -45,7 +45,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin'); + }, 'Cross-Site -> Same Origin, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -59,7 +59,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site'); + }, 'Cross-Site -> Same-Site, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -73,7 +73,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site'); + }, 'Cross-Site -> Cross-Site, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -87,7 +87,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin'); + }, 'Same-Origin -> Same Origin, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -101,7 +101,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site'); + }, 'Same-Origin -> Same-Site, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -115,7 +115,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site'); + }, 'Same-Origin -> Cross-Site, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -129,7 +129,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin'); + }, 'Same-Site -> Same Origin, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -143,7 +143,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site'); + }, 'Same-Site -> Same-Site, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -157,7 +157,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site'); + }, 'Same-Site -> Cross-Site, init: mode=no-cors'); \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-site.sub.html b/fetch/metadata/generated/fetch-sec-fetch-site.sub.html index dceabe21495fb5..f8b2c7321895aa 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/fetch-sec-fetch-site.sub.html @@ -30,7 +30,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent)'); + }, 'HTTPS downgrade (header not sent), no init'); promise_test(() => { const key = '{{uuid()}}'; @@ -44,7 +44,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade'); + }, 'HTTPS upgrade, no init'); promise_test(() => { const key = '{{uuid()}}'; @@ -58,7 +58,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade'); + }, 'HTTPS downgrade-upgrade, no init'); \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-user.https.sub.html b/fetch/metadata/generated/fetch-sec-fetch-user.https.sub.html index ef6f666ff4fba0..db57647e5c804e 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-user.https.sub.html +++ b/fetch/metadata/generated/fetch-sec-fetch-user.https.sub.html @@ -30,7 +30,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-user'); }); - }, ''); + }, 'no init'); \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html index fae14fdb5ad28e..c21f2a44f9857b 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html @@ -71,7 +71,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'document'); }); - }, ' - GET'); + }, 'GET'); promise_test(() => { const key = '{{uuid()}}'; @@ -83,7 +83,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'document'); }); - }, ' - POST'); + }, 'POST'); \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-user.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-user.https.sub.html index e85139f7cf528b..e8e4bedc5df529 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-user.https.sub.html +++ b/fetch/metadata/generated/form-submission-sec-fetch-user.https.sub.html @@ -71,7 +71,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-user'); }); - }, ' - GET'); + }, 'GET'); promise_test(() => { const key = '{{uuid()}}'; @@ -83,7 +83,7 @@ assert_own_property(headers, 'sec-fetch-user'); assert_equals(headers['sec-fetch-user'], '?1'); }); - }, ' - GET with user activation'); + }, 'GET with user activation'); promise_test(() => { const key = '{{uuid()}}'; @@ -94,7 +94,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-user'); }); - }, ' - POST'); + }, 'POST'); promise_test(() => { const key = '{{uuid()}}'; @@ -106,7 +106,7 @@ assert_own_property(headers, 'sec-fetch-user'); assert_equals(headers['sec-fetch-user'], '?1'); }); - }, ' - POST with user activation'); + }, 'POST with user activation'); \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.https.sub.html index 954f58f5a87a5d..6bd899c6621d2a 100644 --- a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.https.sub.html @@ -34,7 +34,7 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'worker'); }); - }, 'classic script'); + }, 'no options'); promise_test(() => { const key = '{{uuid()}}'; @@ -50,6 +50,6 @@ assert_own_property(headers, 'sec-fetch-dest'); assert_equals(headers['sec-fetch-dest'], 'worker'); }); - }, 'module script'); + }, 'options: type=module'); \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-mode.https.sub.html index 24720aa648ff78..3aea1a1efb4535 100644 --- a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-mode.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-mode.https.sub.html @@ -34,7 +34,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'same-origin'); }); - }, 'classic script'); + }, 'no options'); promise_test(() => { const key = '{{uuid()}}'; @@ -50,6 +50,6 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'same-origin'); }); - }, 'module script'); + }, 'options: type=module'); \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-user.https.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-user.https.sub.html index 80b844d65d8276..7b5b80c79e1391 100644 --- a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-user.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-user.https.sub.html @@ -33,7 +33,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-user'); }); - }, 'classic script'); + }, 'no options'); promise_test(() => { const key = '{{uuid()}}'; @@ -48,6 +48,6 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-user'); }); - }, 'module script'); + }, 'options: type=module'); \ No newline at end of file diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml index 12e9f55485766b..06f1a8630247b9 100644 --- a/fetch/metadata/tools/cases/master.yml +++ b/fetch/metadata/tools/cases/master.yml @@ -30,26 +30,19 @@ appcache-manifest.sub.https.html: [{}] element-image.sub.html: [{}] element-script.sub.html: - - description: ' - classic script' - - description: ' - module script' - elementAttrs: { type: module } + - {} + - elementAttrs: { type: module } element-video.sub.html: [{}] fetch.sub.html: [{}] font.sub.html: [{}] form-submission.sub.html: - - description: ' - GET' - method: GET - - description: ' - POST' - method: POST + - method: GET + - method: POST window-location.sub.html: - - description: ' - location' - api: location - - description: ' - location.href' - api: location.href - - description: ' - location.assign' - api: location.assign - - description: ' - location.replace' - api: location.replace + - api: location + - api: location.href + - api: location.assign + - api: location.replace script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] video-poster.sub.html: [{}] @@ -114,26 +107,19 @@ appcache-manifest.sub.https.html: [{}] element-image.sub.html: [{}] element-script.sub.html: - - description: ' - classic script' - - description: ' - module script' - elementAttrs: { type: module } + - {} + - elementAttrs: { type: module } element-video.sub.html: [{}] fetch.sub.html: [{ init: { mode: no-cors } }] font.sub.html: [{}] form-submission.sub.html: - - description: ' - GET' - method: GET - - description: ' - POST' - method: POST + - method: GET + - method: POST window-location.sub.html: - - description: ' - location' - api: location - - description: ' - location.href' - api: location.href - - description: ' - location.assign' - api: location.assign - - description: ' - location.replace' - api: location.replace + - api: location + - api: location.href + - api: location.assign + - api: location.replace script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] video-poster.sub.html: [{}] @@ -172,19 +158,13 @@ element-image.sub.html: [{}] element-video.sub.html: [{}] form-submission.sub.html: - - description: ' - GET' - method: GET - - description: ' - POST' - method: POST + - method: GET + - method: POST window-location.sub.html: - - description: ' - location' - api: location - - description: ' - location.href' - api: location.href - - description: ' - location.assign' - api: location.assign - - description: ' - location.replace' - api: location.replace + - api: location + - api: location.href + - api: location.assign + - api: location.replace video-poster.sub.html: [{}] - title: Fetch Metadata - Sec-Fetch-Mode @@ -206,77 +186,54 @@ cors-preflight.sub.html: - expected: cors element-image.sub.html: - - description: no attributes - expected: no-cors - - description: crossorigin="" - expected: cors + - expected: no-cors + - expected: cors elementAttrs: { crossorigin: '' } - - description: crossorigin="anonymous" - expected: cors + - expected: cors elementAttrs: { crossorigin: anonymous } - - description: crossorigin="use-credentials" - expected: cors + - expected: cors elementAttrs: { crossorigin: use-credentials } element-script.sub.html: - - description: classic script - expected: no-cors - - description: module script - expected: cors + - expected: no-cors + - expected: cors elementAttrs: { type: module } - - description: classic script, crossorigin="" - expected: cors + - expected: cors elementAttrs: { crossorigin: '' } - - description: classic script, crossorigin="anonymous" - expected: cors + - expected: cors elementAttrs: { crossorigin: anonymous } - - description: classic script, crossorigin="use-credentials" - expected: cors + - expected: cors elementAttrs: { crossorigin: use-credentials } element-video.sub.html: - - description: no attributes - expected: no-cors - - description: crossorigin="" - expected: cors + - expected: no-cors + - expected: cors elementAttrs: { crossorigin: '' } - - description: crossorigin="anonymous" - expected: cors + - expected: cors elementAttrs: { crossorigin: anonymous } - - description: crossorigin="use-credentials" - expected: cors + - expected: cors elementAttrs: { crossorigin: use-credentials } fetch.sub.html: - - description: no options - expected: cors - - description: 'mode: cors' - expected: cors + - expected: cors + - expected: cors init: { mode: cors } - - description: 'mode: no-cors' - expected: no-cors + - expected: no-cors init: { mode: no-cors } - - description: 'mode: same-origin' - expected: same-origin + - expected: same-origin init: { mode: same-origin } font.sub.html: - expected: cors form-submission.sub.html: - - description: GET - method: GET + - method: GET expected: navigate - - description: POST - method: POST + - method: POST expected: navigate window-location.sub.html: - - description: location - api: location + - api: location expected: navigate - - description: location.href - api: location.href + - api: location.href expected: navigate - - description: location.assign - api: location.assign + - api: location.assign expected: navigate - - description: location.replace - api: location.replace + - api: location.replace expected: navigate script-module-import-dynamic.sub.html: - expected: cors @@ -285,10 +242,8 @@ video-poster.sub.html: - expected: no-cors worker-dedicated-constructor.sub.html: - - description: classic script - expected: same-origin - - description: module script - options: { type: module } + - expected: same-origin + - options: { type: module } expected: same-origin - title: Fetch Metadata - Sec-Fetch-Dest @@ -311,24 +266,18 @@ font.sub.html: - expected: font form-submission.sub.html: - - description: ' - GET' - method: GET + - method: GET expected: document - - description: ' - POST' - method: POST + - method: POST expected: document window-location.sub.html: - - description: location - api: location + - api: location expected: document - - description: location.href - api: location.href + - api: location.href expected: document - - description: location.assign - api: location.assign + - api: location.assign expected: document - - description: location.replace - api: location.replace + - api: location.replace expected: document script-module-import-dynamic.sub.html: - expected: script @@ -337,10 +286,8 @@ video-poster.sub.html: - expected: image worker-dedicated-constructor.sub.html: - - description: classic script - expected: worker - - description: module script - options: { type: module } + - expected: worker + - options: { type: module } expected: worker worker-dedicated-importscripts.sub.html: - expected: script @@ -365,47 +312,35 @@ font.sub.html: - expected: NULL form-submission.sub.html: - - description: ' - GET' - method: GET + - method: GET expected: NULL - - description: ' - GET with user activation' - method: GET + - method: GET userActivated: TRUE expected: ?1 - - description: ' - POST' - method: POST + - method: POST expected: NULL - - description: ' - POST with user activation' - method: POST + - method: POST userActivated: TRUE expected: ?1 window-location.sub.html: - - description: location - api: location + - api: location expected: NULL - - description: location with user activation - api: location + - api: location userActivated: TRUE expected: ?1 - - description: location.href - api: location.href + - api: location.href expected: NULL - - description: location.href with user activation - api: location.href + - api: location.href userActivated: TRUE expected: ?1 - - description: location.assign - api: location.assign + - api: location.assign expected: NULL - - description: location.assign with user activation - api: location.assign + - api: location.assign userActivated: TRUE expected: ?1 - - description: location.replace - api: location.replace + - api: location.replace expected: NULL - - description: location.replace with user activation - api: location.replace + - api: location.replace userActivated: TRUE expected: ?1 script-module-import-dynamic.sub.html: @@ -415,10 +350,8 @@ video-poster.sub.html: - expected: NULL worker-dedicated-constructor.sub.html: - - description: classic script - expected: NULL - - description: module script - options: { type: module } + - expected: NULL + - options: { type: module } expected: NULL worker-dedicated-importscripts.sub.html: - expected: NULL diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index b2dd5e3c7e1d8b..a4aec4045c1083 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -2,7 +2,7 @@ import os -from jinja2 import Template +import jinja2 import yaml HERE = os.path.abspath(os.path.dirname(__file__)) @@ -35,10 +35,6 @@ def cross(a, b): merged.update(a_object) merged.update(b_object) - if 'description' in a_object and 'description' in b_object: - merged['description'] = '{}{}'.format( - a_object['description'], b_object['description'] - ) if 'origins' not in merged: merged['origins'] = [] @@ -52,15 +48,35 @@ def make_provenance(project_root, cases, template): '- {}'.format(os.path.relpath(template, project_root)) ]) +def collection_filter(obj, title): + if not obj: + return 'no {}'.format(title) + + members = [] + for name, value in obj.items(): + members.append('{}={}'.format(name, value)) + + return '{}: {}'.format(title, ', '.join(members)) + +def pad_filter(value, side, padding): + if not value: + return '' + if side == 'start': + return padding + value + + return value + padding + def main(project_root, templates_directory, cases_file, out_directory): + environment = jinja2.Environment( + variable_start_string='[%', + variable_end_string='%]' + ) + environment.filters['collection'] = collection_filter + environment.filters['pad'] = pad_filter templates = {} for template_name, path in find_templates(templates_directory): with open(path, 'r') as handle: - templates[template_name] = Template( - handle.read(), - variable_start_string='[%', - variable_end_string='%]' - ) + templates[template_name] = environment.from_string(handle.read()) with open(cases_file, 'r') as handle: cases = yaml.safe_load(handle.read()) diff --git a/fetch/metadata/tools/templates/element-image.sub.html b/fetch/metadata/tools/templates/element-image.sub.html index 26811723a3d662..a68301246b1120 100644 --- a/fetch/metadata/tools/templates/element-image.sub.html +++ b/fetch/metadata/tools/templates/element-image.sub.html @@ -43,7 +43,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description%]'); + }, '[%subtest.description | pad("end", ", ")%][%subtest.elementAttrs | collection("attributes")%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/element-script.sub.html b/fetch/metadata/tools/templates/element-script.sub.html index cebd11a31cd416..28b1c3fc785d8a 100644 --- a/fetch/metadata/tools/templates/element-script.sub.html +++ b/fetch/metadata/tools/templates/element-script.sub.html @@ -47,7 +47,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description%]'); + }, '[%subtest.description | pad("end", ", ")%][%-subtest.elementAttrs | collection("attributes")%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/element-video.sub.html b/fetch/metadata/tools/templates/element-video.sub.html index 6e9b8d2cc0ea1f..2b641765dce49b 100644 --- a/fetch/metadata/tools/templates/element-video.sub.html +++ b/fetch/metadata/tools/templates/element-video.sub.html @@ -43,7 +43,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description%]'); + }, '[%subtest.description | pad("end", ", ")%][%subtest.elementAttrs | collection("attributes")%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/fetch.sub.html b/fetch/metadata/tools/templates/fetch.sub.html index 492de293d320bf..891a30e3276f05 100644 --- a/fetch/metadata/tools/templates/fetch.sub.html +++ b/fetch/metadata/tools/templates/fetch.sub.html @@ -34,7 +34,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description%]'); + }, '[%subtest.description | pad("end", ", ")%][%subtest.init | collection("init")%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/form-submission.sub.html b/fetch/metadata/tools/templates/form-submission.sub.html index fa4f0ccb9d7bb5..0af2afdf139ba5 100644 --- a/fetch/metadata/tools/templates/form-submission.sub.html +++ b/fetch/metadata/tools/templates/form-submission.sub.html @@ -77,7 +77,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description%]'); + }, '[%subtest.description | pad("end", " - ")%][%subtest.method | default("POST")%][%" with user activation" if subtest.userActivated%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/window-location.sub.html b/fetch/metadata/tools/templates/window-location.sub.html index 503d91669abae9..52a1ce38922f39 100644 --- a/fetch/metadata/tools/templates/window-location.sub.html +++ b/fetch/metadata/tools/templates/window-location.sub.html @@ -66,7 +66,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description%]'); + }, '[%subtest.description | pad("right", " - ")%][%subtest.api%][% " with user activation" if subtest.userActivated%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html b/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html index 62753f89d0da94..8d3922eead9702 100644 --- a/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html +++ b/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html @@ -41,7 +41,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description%]'); + }, '[%subtest.description | pad("end", ", ")%][%subtest.options|collection("options")%]'); {%- endfor %} From 8da4245c1b10b0125990842e26975a8dcccf1e7b Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 30 Apr 2020 21:02:20 -0400 Subject: [PATCH 079/127] Group all subtests by template Extend subtest titles to support uniqueness in this context --- ...nifest-sec-fetch-dest.https.sub.https.html | 58 --- ...nifest-sec-fetch-mode.https.sub.https.html | 58 --- ...-sec-fetch-site-mixed.https.sub.https.html | 58 --- ...nifest-sec-fetch-user.https.sub.https.html | 57 --- ....html => appcache-manifest.sub.https.html} | 10 +- ...=> appcache-manifest.sub.https.https.html} | 83 +++- ...rs-preflight-sec-fetch-dest.https.sub.html | 38 -- ...rs-preflight-sec-fetch-mode.https.sub.html | 38 -- ...rs-preflight-sec-fetch-user.https.sub.html | 37 -- .../generated/cors-preflight.sub.https.html | 71 ++++ ...lement-image-sec-fetch-dest.https.sub.html | 46 --- ...lement-image-sec-fetch-mode.https.sub.html | 88 ---- ...-image-sec-fetch-site-mixed.https.sub.html | 46 --- ...lement-image-sec-fetch-user.https.sub.html | 45 --- ...h-site.sub.html => element-image.sub.html} | 10 +- ....sub.html => element-image.sub.https.html} | 121 +++++- ...ement-script-sec-fetch-dest.https.sub.html | 50 --- ...ement-script-sec-fetch-mode.https.sub.html | 114 ------ ...ement-script-sec-fetch-user.https.sub.html | 49 --- ...-site.sub.html => element-script.sub.html} | 16 +- ...sub.html => element-script.sub.https.html} | 155 ++++++- ...lement-video-sec-fetch-dest.https.sub.html | 46 --- ...lement-video-sec-fetch-mode.https.sub.html | 88 ---- ...-video-sec-fetch-site-mixed.https.sub.html | 46 --- ...lement-video-sec-fetch-user.https.sub.html | 45 --- ...h-site.sub.html => element-video.sub.html} | 10 +- ....sub.html => element-video.sub.https.html} | 121 +++++- .../fetch-sec-fetch-dest.https.sub.html | 37 -- .../fetch-sec-fetch-mode.https.sub.html | 79 ---- .../fetch-sec-fetch-user.https.sub.html | 36 -- ...sec-fetch-site.sub.html => fetch.sub.html} | 10 +- ...te.https.sub.html => fetch.sub.https.html} | 107 ++++- .../font-sec-fetch-dest.https.sub.html | 52 --- .../font-sec-fetch-mode.https.sub.html | 52 --- .../font-sec-fetch-user.https.sub.html | 51 --- ...-sec-fetch-site.sub.html => font.sub.html} | 10 +- ...ite.https.sub.html => font.sub.https.html} | 62 ++- ...m-submission-sec-fetch-dest.https.sub.html | 89 ---- ...m-submission-sec-fetch-mode.https.sub.html | 89 ---- ...ission-sec-fetch-site-mixed.https.sub.html | 89 ---- ...m-submission-sec-fetch-user.https.sub.html | 112 ----- ...site.sub.html => form-submission.sub.html} | 16 +- ...ub.html => form-submission.sub.https.html} | 163 +++++++- ...port-dynamic-sec-fetch-dest.https.sub.html | 30 -- ...port-dynamic-sec-fetch-mode.https.sub.html | 30 -- ...port-dynamic-sec-fetch-user.https.sub.html | 29 -- ... => script-module-import-dynamic.sub.html} | 8 +- ...ript-module-import-dynamic.sub.https.html} | 63 ++- ...mport-static-sec-fetch-dest.https.sub.html | 49 --- ...mport-static-sec-fetch-mode.https.sub.html | 49 --- ...mport-static-sec-fetch-user.https.sub.html | 48 --- ...l => script-module-import-static.sub.html} | 10 +- ...cript-module-import-static.sub.https.html} | 68 +++- ...video-poster-sec-fetch-dest.https.sub.html | 39 -- ...video-poster-sec-fetch-mode.https.sub.html | 39 -- ...poster-sec-fetch-site-mixed.https.sub.html | 39 -- ...video-poster-sec-fetch-user.https.sub.html | 38 -- ...ch-site.sub.html => video-poster.sub.html} | 10 +- ...s.sub.html => video-poster.sub.https.html} | 71 +++- ...dow-location-sec-fetch-dest.https.sub.html | 105 ----- ...dow-location-sec-fetch-mode.https.sub.html | 105 ----- ...cation-sec-fetch-site-mixed.https.sub.html | 105 ----- ...dow-location-sec-fetch-user.https.sub.html | 162 -------- ...site.sub.html => window-location.sub.html} | 28 +- ...ub.html => window-location.sub.https.html} | 381 ++++++++++++++++-- ...-constructor-sec-fetch-dest.https.sub.html | 55 --- ...-constructor-sec-fetch-mode.https.sub.html | 55 --- ...-constructor-sec-fetch-user.https.sub.html | 53 --- ...orker-dedicated-constructor.sub.https.html | 117 ++++++ ...mportscripts-sec-fetch-dest.https.sub.html | 44 -- ...mportscripts-sec-fetch-user.https.sub.html | 43 -- ...> worker-dedicated-importscripts.sub.html} | 8 +- ...er-dedicated-importscripts.sub.https.html} | 49 ++- fetch/metadata/tools/README.md | 2 +- fetch/metadata/tools/cases/master.yml | 357 ---------------- fetch/metadata/tools/fetch-metadata.conf.yml | 372 +++++++++++++++++ fetch/metadata/tools/generate.py | 93 +++-- .../appcache-manifest.sub.https.html | 2 +- .../tools/templates/cors-preflight.sub.html | 2 +- .../tools/templates/element-image.sub.html | 2 +- .../tools/templates/element-script.sub.html | 2 +- .../tools/templates/element-video.sub.html | 2 +- fetch/metadata/tools/templates/fetch.sub.html | 2 +- fetch/metadata/tools/templates/font.sub.html | 2 +- .../tools/templates/form-submission.sub.html | 2 +- .../script-module-import-dynamic.sub.html | 2 +- .../script-module-import-static.sub.html | 2 +- .../tools/templates/video-poster.sub.html | 2 +- .../tools/templates/window-location.sub.html | 2 +- .../worker-dedicated-constructor.sub.html | 2 +- .../worker-dedicated-importscripts.sub.html | 2 +- 91 files changed, 1952 insertions(+), 3488 deletions(-) delete mode 100644 fetch/metadata/generated/appcache-manifest-sec-fetch-dest.https.sub.https.html delete mode 100644 fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html delete mode 100644 fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html delete mode 100644 fetch/metadata/generated/appcache-manifest-sec-fetch-user.https.sub.https.html rename fetch/metadata/generated/{appcache-manifest-sec-fetch-site.sub.https.html => appcache-manifest.sub.https.html} (91%) rename fetch/metadata/generated/{appcache-manifest-sec-fetch-site.https.sub.https.html => appcache-manifest.sub.https.https.html} (70%) delete mode 100644 fetch/metadata/generated/cors-preflight-sec-fetch-dest.https.sub.html delete mode 100644 fetch/metadata/generated/cors-preflight-sec-fetch-mode.https.sub.html delete mode 100644 fetch/metadata/generated/cors-preflight-sec-fetch-user.https.sub.html create mode 100644 fetch/metadata/generated/cors-preflight.sub.https.html delete mode 100644 fetch/metadata/generated/element-image-sec-fetch-dest.https.sub.html delete mode 100644 fetch/metadata/generated/element-image-sec-fetch-mode.https.sub.html delete mode 100644 fetch/metadata/generated/element-image-sec-fetch-site-mixed.https.sub.html delete mode 100644 fetch/metadata/generated/element-image-sec-fetch-user.https.sub.html rename fetch/metadata/generated/{element-image-sec-fetch-site.sub.html => element-image.sub.html} (87%) rename fetch/metadata/generated/{element-image-sec-fetch-site.https.sub.html => element-image.sub.https.html} (55%) delete mode 100644 fetch/metadata/generated/element-script-sec-fetch-dest.https.sub.html delete mode 100644 fetch/metadata/generated/element-script-sec-fetch-mode.https.sub.html delete mode 100644 fetch/metadata/generated/element-script-sec-fetch-user.https.sub.html rename fetch/metadata/generated/{element-script-sec-fetch-site.sub.html => element-script.sub.html} (87%) rename fetch/metadata/generated/{element-script-sec-fetch-site.https.sub.html => element-script.sub.https.html} (67%) delete mode 100644 fetch/metadata/generated/element-video-sec-fetch-dest.https.sub.html delete mode 100644 fetch/metadata/generated/element-video-sec-fetch-mode.https.sub.html delete mode 100644 fetch/metadata/generated/element-video-sec-fetch-site-mixed.https.sub.html delete mode 100644 fetch/metadata/generated/element-video-sec-fetch-user.https.sub.html rename fetch/metadata/generated/{element-video-sec-fetch-site.sub.html => element-video.sub.html} (87%) rename fetch/metadata/generated/{element-video-sec-fetch-site.https.sub.html => element-video.sub.https.html} (55%) delete mode 100644 fetch/metadata/generated/fetch-sec-fetch-dest.https.sub.html delete mode 100644 fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html delete mode 100644 fetch/metadata/generated/fetch-sec-fetch-user.https.sub.html rename fetch/metadata/generated/{fetch-sec-fetch-site.sub.html => fetch.sub.html} (86%) rename fetch/metadata/generated/{fetch-sec-fetch-site.https.sub.html => fetch.sub.https.html} (58%) delete mode 100644 fetch/metadata/generated/font-sec-fetch-dest.https.sub.html delete mode 100644 fetch/metadata/generated/font-sec-fetch-mode.https.sub.html delete mode 100644 fetch/metadata/generated/font-sec-fetch-user.https.sub.html rename fetch/metadata/generated/{font-sec-fetch-site.sub.html => font.sub.html} (89%) rename fetch/metadata/generated/{font-sec-fetch-site.https.sub.html => font.sub.https.html} (73%) delete mode 100644 fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html delete mode 100644 fetch/metadata/generated/form-submission-sec-fetch-mode.https.sub.html delete mode 100644 fetch/metadata/generated/form-submission-sec-fetch-site-mixed.https.sub.html delete mode 100644 fetch/metadata/generated/form-submission-sec-fetch-user.https.sub.html rename fetch/metadata/generated/{form-submission-sec-fetch-site.sub.html => form-submission.sub.html} (91%) rename fetch/metadata/generated/{form-submission-sec-fetch-site.https.sub.html => form-submission.sub.https.html} (64%) delete mode 100644 fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.https.sub.html delete mode 100644 fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.https.sub.html delete mode 100644 fetch/metadata/generated/script-module-import-dynamic-sec-fetch-user.https.sub.html rename fetch/metadata/generated/{script-module-import-dynamic-sec-fetch-site.sub.html => script-module-import-dynamic.sub.html} (88%) rename fetch/metadata/generated/{script-module-import-dynamic-sec-fetch-site.https.sub.html => script-module-import-dynamic.sub.https.html} (72%) delete mode 100644 fetch/metadata/generated/script-module-import-static-sec-fetch-dest.https.sub.html delete mode 100644 fetch/metadata/generated/script-module-import-static-sec-fetch-mode.https.sub.html delete mode 100644 fetch/metadata/generated/script-module-import-static-sec-fetch-user.https.sub.html rename fetch/metadata/generated/{script-module-import-static-sec-fetch-site.sub.html => script-module-import-static.sub.html} (90%) rename fetch/metadata/generated/{script-module-import-static-sec-fetch-site.https.sub.html => script-module-import-static.sub.https.html} (74%) delete mode 100644 fetch/metadata/generated/video-poster-sec-fetch-dest.https.sub.html delete mode 100644 fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html delete mode 100644 fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html delete mode 100644 fetch/metadata/generated/video-poster-sec-fetch-user.https.sub.html rename fetch/metadata/generated/{video-poster-sec-fetch-site.sub.html => video-poster.sub.html} (88%) rename fetch/metadata/generated/{video-poster-sec-fetch-site.https.sub.html => video-poster.sub.https.html} (67%) delete mode 100644 fetch/metadata/generated/window-location-sec-fetch-dest.https.sub.html delete mode 100644 fetch/metadata/generated/window-location-sec-fetch-mode.https.sub.html delete mode 100644 fetch/metadata/generated/window-location-sec-fetch-site-mixed.https.sub.html delete mode 100644 fetch/metadata/generated/window-location-sec-fetch-user.https.sub.html rename fetch/metadata/generated/{window-location-sec-fetch-site.sub.html => window-location.sub.html} (88%) rename fetch/metadata/generated/{window-location-sec-fetch-site.https.sub.html => window-location.sub.https.html} (61%) delete mode 100644 fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.https.sub.html delete mode 100644 fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-mode.https.sub.html delete mode 100644 fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-user.https.sub.html create mode 100644 fetch/metadata/generated/worker-dedicated-constructor.sub.https.html delete mode 100644 fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.https.sub.html delete mode 100644 fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-user.https.sub.html rename fetch/metadata/generated/{worker-dedicated-importscripts-sec-fetch-site.sub.html => worker-dedicated-importscripts.sub.html} (91%) rename fetch/metadata/generated/{worker-dedicated-importscripts-sec-fetch-site.https.sub.html => worker-dedicated-importscripts.sub.https.html} (78%) delete mode 100644 fetch/metadata/tools/cases/master.yml create mode 100644 fetch/metadata/tools/fetch-metadata.conf.yml diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.https.sub.https.html deleted file mode 100644 index 699a68724cd1ae..00000000000000 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-dest.https.sub.https.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Dest - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html deleted file mode 100644 index ad6ff2b138fd8b..00000000000000 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-mode.https.sub.https.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html deleted file mode 100644 index ad22774c147a3d..00000000000000 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site-mixed.https.sub.https.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Site - redirection with mixed content - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-user.https.sub.https.html b/fetch/metadata/generated/appcache-manifest-sec-fetch-user.https.sub.https.html deleted file mode 100644 index e66684ded12ebf..00000000000000 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-user.https.sub.https.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-User - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html b/fetch/metadata/generated/appcache-manifest.sub.https.html similarity index 91% rename from fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html rename to fetch/metadata/generated/appcache-manifest.sub.https.html index 269cc3fe57458e..cd656f150cc8e1 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest.sub.https.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTP + @@ -51,7 +51,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent)'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent)'); promise_test(() => { const key = '{{uuid()}}'; @@ -66,7 +66,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade'); + }, 'sec-fetch-site - HTTPS upgrade'); promise_test(() => { const key = '{{uuid()}}'; @@ -81,7 +81,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html b/fetch/metadata/generated/appcache-manifest.sub.https.https.html similarity index 70% rename from fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html rename to fetch/metadata/generated/appcache-manifest.sub.https.https.html index cc21f17918e9c1..fdc0fb714905ce 100644 --- a/fetch/metadata/generated/appcache-manifest-sec-fetch-site.https.sub.https.html +++ b/fetch/metadata/generated/appcache-manifest.sub.https.https.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + @@ -52,7 +52,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); promise_test(() => { const key = '{{uuid()}}'; @@ -67,7 +67,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin'); + }, 'sec-fetch-site - Cross-Site -> Same Origin'); promise_test(() => { const key = '{{uuid()}}'; @@ -82,7 +82,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site'); + }, 'sec-fetch-site - Cross-Site -> Same-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -97,7 +97,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -112,7 +112,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin'); + }, 'sec-fetch-site - Same-Origin -> Same Origin'); promise_test(() => { const key = '{{uuid()}}'; @@ -127,7 +127,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site'); + }, 'sec-fetch-site - Same-Origin -> Same-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -142,7 +142,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -157,7 +157,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin'); + }, 'sec-fetch-site - Same-Site -> Same Origin'); promise_test(() => { const key = '{{uuid()}}'; @@ -172,7 +172,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site'); + }, 'sec-fetch-site - Same-Site -> Same-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -187,7 +187,66 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site'); + }, 'sec-fetch-site - Same-Site -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + assert_precondition( + !!window.applicationCache, + 'Application Cache is not supported.' + ); + + return induceRequest(makeRequestURL(key, ['sameOrigin', 'httpOrigin', 'sameOrigin'])) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + + promise_test(() => { + const key = '{{uuid()}}'; + assert_precondition( + !!window.applicationCache, + 'Application Cache is not supported.' + ); + + return induceRequest(makeRequestURL(key, [])) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'no-cors'); + }); + }, 'sec-fetch-mode'); + + promise_test(() => { + const key = '{{uuid()}}'; + assert_precondition( + !!window.applicationCache, + 'Application Cache is not supported.' + ); + + return induceRequest(makeRequestURL(key, [])) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-dest'); + assert_equals(headers['sec-fetch-dest'], 'empty'); + }); + }, 'sec-fetch-dest'); + + promise_test(() => { + const key = '{{uuid()}}'; + assert_precondition( + !!window.applicationCache, + 'Application Cache is not supported.' + ); + + return induceRequest(makeRequestURL(key, [])) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-user'); + }); + }, 'sec-fetch-user'); \ No newline at end of file diff --git a/fetch/metadata/generated/cors-preflight-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/cors-preflight-sec-fetch-dest.https.sub.html deleted file mode 100644 index a9077959eb00bd..00000000000000 --- a/fetch/metadata/generated/cors-preflight-sec-fetch-dest.https.sub.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Dest - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/cors-preflight-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/cors-preflight-sec-fetch-mode.https.sub.html deleted file mode 100644 index 6544a90fc0f6c4..00000000000000 --- a/fetch/metadata/generated/cors-preflight-sec-fetch-mode.https.sub.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/cors-preflight-sec-fetch-user.https.sub.html b/fetch/metadata/generated/cors-preflight-sec-fetch-user.https.sub.html deleted file mode 100644 index a614c710a66aa1..00000000000000 --- a/fetch/metadata/generated/cors-preflight-sec-fetch-user.https.sub.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-User - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/cors-preflight.sub.https.html b/fetch/metadata/generated/cors-preflight.sub.https.html new file mode 100644 index 00000000000000..d68d0558ff6334 --- /dev/null +++ b/fetch/metadata/generated/cors-preflight.sub.https.html @@ -0,0 +1,71 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/element-image-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/element-image-sec-fetch-dest.https.sub.html deleted file mode 100644 index e8529155ca2ff1..00000000000000 --- a/fetch/metadata/generated/element-image-sec-fetch-dest.https.sub.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Dest - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/element-image-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/element-image-sec-fetch-mode.https.sub.html deleted file mode 100644 index b7ec427ccb84d5..00000000000000 --- a/fetch/metadata/generated/element-image-sec-fetch-mode.https.sub.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/element-image-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/element-image-sec-fetch-site-mixed.https.sub.html deleted file mode 100644 index bab306e14dcd8b..00000000000000 --- a/fetch/metadata/generated/element-image-sec-fetch-site-mixed.https.sub.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Site - redirection with mixed content - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/element-image-sec-fetch-user.https.sub.html b/fetch/metadata/generated/element-image-sec-fetch-user.https.sub.html deleted file mode 100644 index 4c8fe75b3a62a9..00000000000000 --- a/fetch/metadata/generated/element-image-sec-fetch-user.https.sub.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-User - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/element-image-sec-fetch-site.sub.html b/fetch/metadata/generated/element-image.sub.html similarity index 87% rename from fetch/metadata/generated/element-image-sec-fetch-site.sub.html rename to fetch/metadata/generated/element-image.sub.html index 8c6aa80e08b35a..81e659e928b3e3 100644 --- a/fetch/metadata/generated/element-image-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/element-image.sub.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTP + @@ -39,7 +39,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent), no attributes'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent), no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -53,7 +53,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade, no attributes'); + }, 'sec-fetch-site - HTTPS upgrade, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -67,7 +67,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade, no attributes'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade, no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-image-sec-fetch-site.https.sub.html b/fetch/metadata/generated/element-image.sub.https.html similarity index 55% rename from fetch/metadata/generated/element-image-sec-fetch-site.https.sub.html rename to fetch/metadata/generated/element-image.sub.https.html index e325619032132e..5755e0243c278b 100644 --- a/fetch/metadata/generated/element-image-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/element-image.sub.https.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + @@ -40,7 +40,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect, no attributes'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -54,7 +54,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin, no attributes'); + }, 'sec-fetch-site - Cross-Site -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -68,7 +68,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site, no attributes'); + }, 'sec-fetch-site - Cross-Site -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -82,7 +82,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site, no attributes'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -96,7 +96,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin, no attributes'); + }, 'sec-fetch-site - Same-Origin -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -110,7 +110,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site, no attributes'); + }, 'sec-fetch-site - Same-Origin -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -124,7 +124,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site, no attributes'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -138,7 +138,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin, no attributes'); + }, 'sec-fetch-site - Same-Site -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -152,7 +152,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site, no attributes'); + }, 'sec-fetch-site - Same-Site -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -166,7 +166,104 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site, no attributes'); + }, 'sec-fetch-site - Same-Site -> Cross-Site, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['sameOrigin', 'httpOrigin', 'sameOrigin']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'sec-fetch-site - HTTPS downgrade-upgrade, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'no-cors'); + }); + }, 'sec-fetch-mode - no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {"crossorigin": ""} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'cors'); + }); + }, 'sec-fetch-mode - attributes: crossorigin='); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {"crossorigin": "anonymous"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'cors'); + }); + }, 'sec-fetch-mode - attributes: crossorigin=anonymous'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {"crossorigin": "use-credentials"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'cors'); + }); + }, 'sec-fetch-mode - attributes: crossorigin=use-credentials'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-dest'); + assert_equals(headers['sec-fetch-dest'], 'image'); + }); + }, 'sec-fetch-dest - no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-user'); + }); + }, 'sec-fetch-user - no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-script-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/element-script-sec-fetch-dest.https.sub.html deleted file mode 100644 index f4ae5acd693859..00000000000000 --- a/fetch/metadata/generated/element-script-sec-fetch-dest.https.sub.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Dest - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/element-script-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/element-script-sec-fetch-mode.https.sub.html deleted file mode 100644 index ea9e2869832a82..00000000000000 --- a/fetch/metadata/generated/element-script-sec-fetch-mode.https.sub.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/element-script-sec-fetch-user.https.sub.html b/fetch/metadata/generated/element-script-sec-fetch-user.https.sub.html deleted file mode 100644 index 76be1b033c58c8..00000000000000 --- a/fetch/metadata/generated/element-script-sec-fetch-user.https.sub.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-User - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/element-script-sec-fetch-site.sub.html b/fetch/metadata/generated/element-script.sub.html similarity index 87% rename from fetch/metadata/generated/element-script-sec-fetch-site.sub.html rename to fetch/metadata/generated/element-script.sub.html index a688cdc201ef30..d61f9ef7a36d7c 100644 --- a/fetch/metadata/generated/element-script-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/element-script.sub.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTP + @@ -44,7 +44,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent), no attributes'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent), no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -59,7 +59,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent), attributes: type=module'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent), attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -75,7 +75,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade, no attributes'); + }, 'sec-fetch-site - HTTPS upgrade, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -91,7 +91,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade, attributes: type=module'); + }, 'sec-fetch-site - HTTPS upgrade, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -107,7 +107,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade, no attributes'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -123,6 +123,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade, attributes: type=module'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade, attributes: type=module'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-script-sec-fetch-site.https.sub.html b/fetch/metadata/generated/element-script.sub.https.html similarity index 67% rename from fetch/metadata/generated/element-script-sec-fetch-site.https.sub.html rename to fetch/metadata/generated/element-script.sub.https.html index 6076a424981fde..05256bb40e5a0c 100644 --- a/fetch/metadata/generated/element-script-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/element-script.sub.https.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + @@ -45,7 +45,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect, no attributes'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -61,7 +61,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect, attributes: type=module'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -77,7 +77,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin, no attributes'); + }, 'sec-fetch-site - Cross-Site -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -93,7 +93,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin, attributes: type=module'); + }, 'sec-fetch-site - Cross-Site -> Same Origin, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -109,7 +109,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site, no attributes'); + }, 'sec-fetch-site - Cross-Site -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -125,7 +125,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site, attributes: type=module'); + }, 'sec-fetch-site - Cross-Site -> Same-Site, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -141,7 +141,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site, no attributes'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -157,7 +157,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site, attributes: type=module'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -173,7 +173,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin, no attributes'); + }, 'sec-fetch-site - Same-Origin -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -189,7 +189,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin, attributes: type=module'); + }, 'sec-fetch-site - Same-Origin -> Same Origin, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -205,7 +205,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site, no attributes'); + }, 'sec-fetch-site - Same-Origin -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -221,7 +221,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site, attributes: type=module'); + }, 'sec-fetch-site - Same-Origin -> Same-Site, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -237,7 +237,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site, no attributes'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -253,7 +253,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site, attributes: type=module'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -269,7 +269,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin, no attributes'); + }, 'sec-fetch-site - Same-Site -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -285,7 +285,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin, attributes: type=module'); + }, 'sec-fetch-site - Same-Site -> Same Origin, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -301,7 +301,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site, no attributes'); + }, 'sec-fetch-site - Same-Site -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -317,7 +317,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site, attributes: type=module'); + }, 'sec-fetch-site - Same-Site -> Same-Site, attributes: type=module'); promise_test(() => { const key = '{{uuid()}}'; @@ -333,7 +333,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site, no attributes'); + }, 'sec-fetch-site - Same-Site -> Cross-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -349,6 +349,117 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site, attributes: type=module'); + }, 'sec-fetch-site - Same-Site -> Cross-Site, attributes: type=module'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, [], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'no-cors'); + }); + }, 'sec-fetch-mode - no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, [], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"type": "module"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'cors'); + }); + }, 'sec-fetch-mode - attributes: type=module'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, [], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"crossorigin": ""} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'cors'); + }); + }, 'sec-fetch-mode - attributes: crossorigin='); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, [], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"crossorigin": "anonymous"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'cors'); + }); + }, 'sec-fetch-mode - attributes: crossorigin=anonymous'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, [], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {"crossorigin": "use-credentials"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'cors'); + }); + }, 'sec-fetch-mode - attributes: crossorigin=use-credentials'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, [], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-dest'); + assert_equals(headers['sec-fetch-dest'], 'script'); + }); + }, 'sec-fetch-dest - no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, [], { mime: 'application/javascript' } + ); + + return induceRequest(url, + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-user'); + }); + }, 'sec-fetch-user - no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/element-video-sec-fetch-dest.https.sub.html deleted file mode 100644 index c9a83a0be74367..00000000000000 --- a/fetch/metadata/generated/element-video-sec-fetch-dest.https.sub.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Dest - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/element-video-sec-fetch-mode.https.sub.html deleted file mode 100644 index a6cbec85581e07..00000000000000 --- a/fetch/metadata/generated/element-video-sec-fetch-mode.https.sub.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/element-video-sec-fetch-site-mixed.https.sub.html deleted file mode 100644 index 1fb3013ae4af32..00000000000000 --- a/fetch/metadata/generated/element-video-sec-fetch-site-mixed.https.sub.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Site - redirection with mixed content - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-user.https.sub.html b/fetch/metadata/generated/element-video-sec-fetch-user.https.sub.html deleted file mode 100644 index 0b1e6466308ecf..00000000000000 --- a/fetch/metadata/generated/element-video-sec-fetch-user.https.sub.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-User - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-site.sub.html b/fetch/metadata/generated/element-video.sub.html similarity index 87% rename from fetch/metadata/generated/element-video-sec-fetch-site.sub.html rename to fetch/metadata/generated/element-video.sub.html index 30ee58271eb4e9..94ba615e7622a7 100644 --- a/fetch/metadata/generated/element-video-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/element-video.sub.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTP + @@ -39,7 +39,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent), no attributes'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent), no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -53,7 +53,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade, no attributes'); + }, 'sec-fetch-site - HTTPS upgrade, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -67,7 +67,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade, no attributes'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade, no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/element-video-sec-fetch-site.https.sub.html b/fetch/metadata/generated/element-video.sub.https.html similarity index 55% rename from fetch/metadata/generated/element-video-sec-fetch-site.https.sub.html rename to fetch/metadata/generated/element-video.sub.https.html index d8fc0558d844d2..d65b60b2ccf88d 100644 --- a/fetch/metadata/generated/element-video-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/element-video.sub.https.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + @@ -40,7 +40,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect, no attributes'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -54,7 +54,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin, no attributes'); + }, 'sec-fetch-site - Cross-Site -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -68,7 +68,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site, no attributes'); + }, 'sec-fetch-site - Cross-Site -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -82,7 +82,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site, no attributes'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -96,7 +96,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin, no attributes'); + }, 'sec-fetch-site - Same-Origin -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -110,7 +110,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site, no attributes'); + }, 'sec-fetch-site - Same-Origin -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -124,7 +124,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site, no attributes'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -138,7 +138,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin, no attributes'); + }, 'sec-fetch-site - Same-Site -> Same Origin, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -152,7 +152,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site, no attributes'); + }, 'sec-fetch-site - Same-Site -> Same-Site, no attributes'); promise_test(() => { const key = '{{uuid()}}'; @@ -166,7 +166,104 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site, no attributes'); + }, 'sec-fetch-site - Same-Site -> Cross-Site, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, ['sameOrigin', 'httpOrigin', 'sameOrigin']), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'sec-fetch-site - HTTPS downgrade-upgrade, no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'no-cors'); + }); + }, 'sec-fetch-mode - no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {"crossorigin": ""} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'cors'); + }); + }, 'sec-fetch-mode - attributes: crossorigin='); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {"crossorigin": "anonymous"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'cors'); + }); + }, 'sec-fetch-mode - attributes: crossorigin=anonymous'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {"crossorigin": "use-credentials"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'cors'); + }); + }, 'sec-fetch-mode - attributes: crossorigin=use-credentials'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-dest'); + assert_equals(headers['sec-fetch-dest'], 'video'); + }); + }, 'sec-fetch-dest - no attributes'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-user'); + }); + }, 'sec-fetch-user - no attributes'); \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/fetch-sec-fetch-dest.https.sub.html deleted file mode 100644 index cdf4c69fdce5f2..00000000000000 --- a/fetch/metadata/generated/fetch-sec-fetch-dest.https.sub.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Dest - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html deleted file mode 100644 index c32965b3c2d63e..00000000000000 --- a/fetch/metadata/generated/fetch-sec-fetch-mode.https.sub.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-user.https.sub.html b/fetch/metadata/generated/fetch-sec-fetch-user.https.sub.html deleted file mode 100644 index db57647e5c804e..00000000000000 --- a/fetch/metadata/generated/fetch-sec-fetch-user.https.sub.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-User - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-site.sub.html b/fetch/metadata/generated/fetch.sub.html similarity index 86% rename from fetch/metadata/generated/fetch-sec-fetch-site.sub.html rename to fetch/metadata/generated/fetch.sub.html index f8b2c7321895aa..5c3d2f458c9919 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/fetch.sub.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTP + @@ -30,7 +30,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent), no init'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent), no init'); promise_test(() => { const key = '{{uuid()}}'; @@ -44,7 +44,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade, no init'); + }, 'sec-fetch-site - HTTPS upgrade, no init'); promise_test(() => { const key = '{{uuid()}}'; @@ -58,7 +58,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade, no init'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade, no init'); \ No newline at end of file diff --git a/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html b/fetch/metadata/generated/fetch.sub.https.html similarity index 58% rename from fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html rename to fetch/metadata/generated/fetch.sub.https.html index fdfad418ae8c3c..222177829a4657 100644 --- a/fetch/metadata/generated/fetch-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/fetch.sub.https.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + @@ -31,7 +31,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect, init: mode=no-cors'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -45,7 +45,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin, init: mode=no-cors'); + }, 'sec-fetch-site - Cross-Site -> Same Origin, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -59,7 +59,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site, init: mode=no-cors'); + }, 'sec-fetch-site - Cross-Site -> Same-Site, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -73,7 +73,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site, init: mode=no-cors'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -87,7 +87,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin, init: mode=no-cors'); + }, 'sec-fetch-site - Same-Origin -> Same Origin, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -101,7 +101,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site, init: mode=no-cors'); + }, 'sec-fetch-site - Same-Origin -> Same-Site, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -115,7 +115,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site, init: mode=no-cors'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -129,7 +129,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin, init: mode=no-cors'); + }, 'sec-fetch-site - Same-Site -> Same Origin, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -143,7 +143,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site, init: mode=no-cors'); + }, 'sec-fetch-site - Same-Site -> Same-Site, init: mode=no-cors'); promise_test(() => { const key = '{{uuid()}}'; @@ -157,7 +157,90 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site, init: mode=no-cors'); + }, 'sec-fetch-site - Same-Site -> Cross-Site, init: mode=no-cors'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'cors'); + }); + }, 'sec-fetch-mode - no init'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {"mode": "cors"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'cors'); + }); + }, 'sec-fetch-mode - init: mode=cors'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {"mode": "no-cors"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'no-cors'); + }); + }, 'sec-fetch-mode - init: mode=no-cors'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {"mode": "same-origin"} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'same-origin'); + }); + }, 'sec-fetch-mode - init: mode=same-origin'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-dest'); + assert_equals(headers['sec-fetch-dest'], 'empty'); + }); + }, 'sec-fetch-dest - no init'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL(key, []), + {} + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-user'); + }); + }, 'sec-fetch-user - no init'); \ No newline at end of file diff --git a/fetch/metadata/generated/font-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/font-sec-fetch-dest.https.sub.html deleted file mode 100644 index 81ebf53b492550..00000000000000 --- a/fetch/metadata/generated/font-sec-fetch-dest.https.sub.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Dest - - - - -
test
- - - \ No newline at end of file diff --git a/fetch/metadata/generated/font-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/font-sec-fetch-mode.https.sub.html deleted file mode 100644 index 71df14edb5ffb4..00000000000000 --- a/fetch/metadata/generated/font-sec-fetch-mode.https.sub.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - - - - -
test
- - - \ No newline at end of file diff --git a/fetch/metadata/generated/font-sec-fetch-user.https.sub.html b/fetch/metadata/generated/font-sec-fetch-user.https.sub.html deleted file mode 100644 index a7df6076eeb3ba..00000000000000 --- a/fetch/metadata/generated/font-sec-fetch-user.https.sub.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-User - - - - -
test
- - - \ No newline at end of file diff --git a/fetch/metadata/generated/font-sec-fetch-site.sub.html b/fetch/metadata/generated/font.sub.html similarity index 89% rename from fetch/metadata/generated/font-sec-fetch-site.sub.html rename to fetch/metadata/generated/font.sub.html index a10c1da32c7b4a..fb6d5e774662ff 100644 --- a/fetch/metadata/generated/font-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/font.sub.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTP + @@ -45,7 +45,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent)'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent)'); promise_test((t) => { const key = '{{uuid()}}'; @@ -58,7 +58,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade'); + }, 'sec-fetch-site - HTTPS upgrade'); promise_test((t) => { const key = '{{uuid()}}'; @@ -71,7 +71,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/font-sec-fetch-site.https.sub.html b/fetch/metadata/generated/font.sub.https.html similarity index 73% rename from fetch/metadata/generated/font-sec-fetch-site.https.sub.html rename to fetch/metadata/generated/font.sub.https.html index f5370022228df7..9c172865e9a6f8 100644 --- a/fetch/metadata/generated/font-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/font.sub.https.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + @@ -46,7 +46,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); promise_test((t) => { const key = '{{uuid()}}'; @@ -59,7 +59,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin'); + }, 'sec-fetch-site - Cross-Site -> Same Origin'); promise_test((t) => { const key = '{{uuid()}}'; @@ -72,7 +72,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site'); + }, 'sec-fetch-site - Cross-Site -> Same-Site'); promise_test((t) => { const key = '{{uuid()}}'; @@ -85,7 +85,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site'); promise_test((t) => { const key = '{{uuid()}}'; @@ -98,7 +98,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin'); + }, 'sec-fetch-site - Same-Origin -> Same Origin'); promise_test((t) => { const key = '{{uuid()}}'; @@ -111,7 +111,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site'); + }, 'sec-fetch-site - Same-Origin -> Same-Site'); promise_test((t) => { const key = '{{uuid()}}'; @@ -124,7 +124,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site'); promise_test((t) => { const key = '{{uuid()}}'; @@ -137,7 +137,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin'); + }, 'sec-fetch-site - Same-Site -> Same Origin'); promise_test((t) => { const key = '{{uuid()}}'; @@ -150,7 +150,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site'); + }, 'sec-fetch-site - Same-Site -> Same-Site'); promise_test((t) => { const key = '{{uuid()}}'; @@ -163,7 +163,45 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site'); + }, 'sec-fetch-site - Same-Site -> Cross-Site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, [])) + .then(function() { + return retrieve(key); + }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'cors'); + }); + }, 'sec-fetch-mode'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, [])) + .then(function() { + return retrieve(key); + }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-dest'); + assert_equals(headers['sec-fetch-dest'], 'font'); + }); + }, 'sec-fetch-dest'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + return induceRequest(t, makeRequestURL(key, [])) + .then(function() { + return retrieve(key); + }) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-user'); + }); + }, 'sec-fetch-user'); \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html deleted file mode 100644 index c21f2a44f9857b..00000000000000 --- a/fetch/metadata/generated/form-submission-sec-fetch-dest.https.sub.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Dest - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-mode.https.sub.html deleted file mode 100644 index e9d39de446fca0..00000000000000 --- a/fetch/metadata/generated/form-submission-sec-fetch-mode.https.sub.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-site-mixed.https.sub.html deleted file mode 100644 index 6cfeb4ca32ae52..00000000000000 --- a/fetch/metadata/generated/form-submission-sec-fetch-site-mixed.https.sub.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Site - redirection with mixed content - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-user.https.sub.html b/fetch/metadata/generated/form-submission-sec-fetch-user.https.sub.html deleted file mode 100644 index e8e4bedc5df529..00000000000000 --- a/fetch/metadata/generated/form-submission-sec-fetch-user.https.sub.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-User - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html b/fetch/metadata/generated/form-submission.sub.html similarity index 91% rename from fetch/metadata/generated/form-submission-sec-fetch-site.sub.html rename to fetch/metadata/generated/form-submission.sub.html index ae4e194acc7835..baf75d71e56287 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/form-submission.sub.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTP + @@ -70,7 +70,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent) - GET'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent) - GET'); promise_test(() => { const key = '{{uuid()}}'; @@ -81,7 +81,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent) - POST'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent) - POST'); promise_test(() => { const key = '{{uuid()}}'; @@ -93,7 +93,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade - GET'); + }, 'sec-fetch-site - HTTPS upgrade - GET'); promise_test(() => { const key = '{{uuid()}}'; @@ -105,7 +105,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade - POST'); + }, 'sec-fetch-site - HTTPS upgrade - POST'); promise_test(() => { const key = '{{uuid()}}'; @@ -117,7 +117,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade - GET'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade - GET'); promise_test(() => { const key = '{{uuid()}}'; @@ -129,7 +129,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade - POST'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade - POST'); \ No newline at end of file diff --git a/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html b/fetch/metadata/generated/form-submission.sub.https.html similarity index 64% rename from fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html rename to fetch/metadata/generated/form-submission.sub.https.html index acd4df39c4c331..2165d73bf27b21 100644 --- a/fetch/metadata/generated/form-submission-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/form-submission.sub.https.html @@ -2,14 +2,15 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + + \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.https.sub.html deleted file mode 100644 index 2c316a1dab1370..00000000000000 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-dest.https.sub.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.https.sub.html deleted file mode 100644 index a475405cb9c135..00000000000000 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-mode.https.sub.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-user.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-user.https.sub.html deleted file mode 100644 index e8ac737acba879..00000000000000 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-user.https.sub.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html b/fetch/metadata/generated/script-module-import-dynamic.sub.html similarity index 88% rename from fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html rename to fetch/metadata/generated/script-module-import-dynamic.sub.html index 80181dc13cb6e2..1adfe73c0df8db 100644 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic.sub.html @@ -2,7 +2,7 @@ @@ -24,7 +24,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent)'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent)'); promise_test(() => { const key = '{{uuid()}}'; @@ -38,7 +38,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade'); + }, 'sec-fetch-site - HTTPS upgrade'); promise_test(() => { const key = '{{uuid()}}'; @@ -52,6 +52,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic.sub.https.html similarity index 72% rename from fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html rename to fetch/metadata/generated/script-module-import-dynamic.sub.https.html index dd03ed0e860e9b..87906f87013628 100644 --- a/fetch/metadata/generated/script-module-import-dynamic-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic.sub.https.html @@ -2,7 +2,7 @@ @@ -25,7 +25,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); promise_test(() => { const key = '{{uuid()}}'; @@ -39,7 +39,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin'); + }, 'sec-fetch-site - Cross-Site -> Same Origin'); promise_test(() => { const key = '{{uuid()}}'; @@ -53,7 +53,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site'); + }, 'sec-fetch-site - Cross-Site -> Same-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -67,7 +67,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -81,7 +81,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin'); + }, 'sec-fetch-site - Same-Origin -> Same Origin'); promise_test(() => { const key = '{{uuid()}}'; @@ -95,7 +95,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site'); + }, 'sec-fetch-site - Same-Origin -> Same-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -109,7 +109,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -123,7 +123,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin'); + }, 'sec-fetch-site - Same-Site -> Same Origin'); promise_test(() => { const key = '{{uuid()}}'; @@ -137,7 +137,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site'); + }, 'sec-fetch-site - Same-Site -> Same-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -151,6 +151,47 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site'); + }, 'sec-fetch-site - Same-Site -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, [], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'cors'); + }); + }, 'sec-fetch-mode'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, [], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-dest'); + assert_equals(headers['sec-fetch-dest'], 'script'); + }); + }, 'sec-fetch-dest'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, [], { mime: 'application/javascript' } + ); + + return import(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-user'); + }); + }, 'sec-fetch-user'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.https.sub.html deleted file mode 100644 index 3a50b6cf91e953..00000000000000 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-dest.https.sub.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Dest - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-mode.https.sub.html deleted file mode 100644 index 5d8d7f0cbebe3b..00000000000000 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-mode.https.sub.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-user.https.sub.html b/fetch/metadata/generated/script-module-import-static-sec-fetch-user.https.sub.html deleted file mode 100644 index 5787b455dce53d..00000000000000 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-user.https.sub.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-User - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html b/fetch/metadata/generated/script-module-import-static.sub.html similarity index 90% rename from fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html rename to fetch/metadata/generated/script-module-import-static.sub.html index eebd45dd5fc025..299522b922bc45 100644 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/script-module-import-static.sub.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTP + @@ -43,7 +43,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent)'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent)'); promise_test(() => { const key = '{{uuid()}}'; @@ -58,7 +58,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade'); + }, 'sec-fetch-site - HTTPS upgrade'); promise_test(() => { const key = '{{uuid()}}'; @@ -73,6 +73,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html b/fetch/metadata/generated/script-module-import-static.sub.https.html similarity index 74% rename from fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html rename to fetch/metadata/generated/script-module-import-static.sub.https.html index f85447fb0e5290..611e8a36e4f5f8 100644 --- a/fetch/metadata/generated/script-module-import-static-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/script-module-import-static.sub.https.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + @@ -44,7 +44,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); promise_test(() => { const key = '{{uuid()}}'; @@ -59,7 +59,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin'); + }, 'sec-fetch-site - Cross-Site -> Same Origin'); promise_test(() => { const key = '{{uuid()}}'; @@ -74,7 +74,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site'); + }, 'sec-fetch-site - Cross-Site -> Same-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -89,7 +89,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -104,7 +104,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin'); + }, 'sec-fetch-site - Same-Origin -> Same Origin'); promise_test(() => { const key = '{{uuid()}}'; @@ -119,7 +119,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site'); + }, 'sec-fetch-site - Same-Origin -> Same-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -134,7 +134,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -149,7 +149,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin'); + }, 'sec-fetch-site - Same-Site -> Same Origin'); promise_test(() => { const key = '{{uuid()}}'; @@ -164,7 +164,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site'); + }, 'sec-fetch-site - Same-Site -> Same-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -179,6 +179,50 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site'); + }, 'sec-fetch-site - Same-Site -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, [], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'cors'); + }); + }, 'sec-fetch-mode'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, [], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-dest'); + assert_equals(headers['sec-fetch-dest'], 'script'); + }); + }, 'sec-fetch-dest'); + + promise_test(() => { + const key = '{{uuid()}}'; + + return induceRequest( + makeRequestURL( + key, [], { mime: 'application/javascript' } + ) + ) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-user'); + }); + }, 'sec-fetch-user'); \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-dest.https.sub.html deleted file mode 100644 index 4477255fb5170a..00000000000000 --- a/fetch/metadata/generated/video-poster-sec-fetch-dest.https.sub.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Dest - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html deleted file mode 100644 index accec7cba2fafd..00000000000000 --- a/fetch/metadata/generated/video-poster-sec-fetch-mode.https.sub.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html deleted file mode 100644 index 72daa019b8ba48..00000000000000 --- a/fetch/metadata/generated/video-poster-sec-fetch-site-mixed.https.sub.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Site - redirection with mixed content - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-user.https.sub.html b/fetch/metadata/generated/video-poster-sec-fetch-user.https.sub.html deleted file mode 100644 index 8968f064e2a1c3..00000000000000 --- a/fetch/metadata/generated/video-poster-sec-fetch-user.https.sub.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-User - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html b/fetch/metadata/generated/video-poster.sub.html similarity index 88% rename from fetch/metadata/generated/video-poster-sec-fetch-site.sub.html rename to fetch/metadata/generated/video-poster.sub.html index 81e6ec62179edc..1dd3549fb9d027 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/video-poster.sub.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTP + @@ -32,7 +32,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent)'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent)'); promise_test((t) => { const key = '{{uuid()}}'; @@ -44,7 +44,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade'); + }, 'sec-fetch-site - HTTPS upgrade'); promise_test((t) => { const key = '{{uuid()}}'; @@ -56,7 +56,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html b/fetch/metadata/generated/video-poster.sub.https.html similarity index 67% rename from fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html rename to fetch/metadata/generated/video-poster.sub.https.html index 331a284b7301f6..ac4a666b490f98 100644 --- a/fetch/metadata/generated/video-poster-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/video-poster.sub.https.html @@ -2,12 +2,12 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + @@ -33,7 +33,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); promise_test((t) => { const key = '{{uuid()}}'; @@ -45,7 +45,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin'); + }, 'sec-fetch-site - Cross-Site -> Same Origin'); promise_test((t) => { const key = '{{uuid()}}'; @@ -57,7 +57,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site'); + }, 'sec-fetch-site - Cross-Site -> Same-Site'); promise_test((t) => { const key = '{{uuid()}}'; @@ -69,7 +69,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site'); promise_test((t) => { const key = '{{uuid()}}'; @@ -81,7 +81,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin'); + }, 'sec-fetch-site - Same-Origin -> Same Origin'); promise_test((t) => { const key = '{{uuid()}}'; @@ -93,7 +93,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site'); + }, 'sec-fetch-site - Same-Origin -> Same-Site'); promise_test((t) => { const key = '{{uuid()}}'; @@ -105,7 +105,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site'); promise_test((t) => { const key = '{{uuid()}}'; @@ -117,7 +117,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin'); + }, 'sec-fetch-site - Same-Site -> Same Origin'); promise_test((t) => { const key = '{{uuid()}}'; @@ -129,7 +129,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site'); + }, 'sec-fetch-site - Same-Site -> Same-Site'); promise_test((t) => { const key = '{{uuid()}}'; @@ -141,7 +141,54 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site'); + }, 'sec-fetch-site - Same-Site -> Cross-Site'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, ['sameOrigin', 'httpOrigin', 'sameOrigin'])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-site'); + assert_equals(headers['sec-fetch-site'], 'cross-site'); + }); + }, 'sec-fetch-site - HTTPS downgrade-upgrade'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, [])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'no-cors'); + }); + }, 'sec-fetch-mode'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, [])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-dest'); + assert_equals(headers['sec-fetch-dest'], 'image'); + }); + }, 'sec-fetch-dest'); + + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest(t, makeRequestURL(key, [])); + + return retrieve(key, { poll: true }) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-user'); + }); + }, 'sec-fetch-user'); \ No newline at end of file diff --git a/fetch/metadata/generated/window-location-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/window-location-sec-fetch-dest.https.sub.html deleted file mode 100644 index 1a988785febaac..00000000000000 --- a/fetch/metadata/generated/window-location-sec-fetch-dest.https.sub.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Dest - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/window-location-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/window-location-sec-fetch-mode.https.sub.html deleted file mode 100644 index 41a72a6485c660..00000000000000 --- a/fetch/metadata/generated/window-location-sec-fetch-mode.https.sub.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Mode - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/window-location-sec-fetch-site-mixed.https.sub.html b/fetch/metadata/generated/window-location-sec-fetch-site-mixed.https.sub.html deleted file mode 100644 index 6808220b808e48..00000000000000 --- a/fetch/metadata/generated/window-location-sec-fetch-site-mixed.https.sub.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-Site - redirection with mixed content - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/window-location-sec-fetch-user.https.sub.html b/fetch/metadata/generated/window-location-sec-fetch-user.https.sub.html deleted file mode 100644 index 0c089e7c03ffa2..00000000000000 --- a/fetch/metadata/generated/window-location-sec-fetch-user.https.sub.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - Fetch Metadata - Sec-Fetch-User - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/window-location-sec-fetch-site.sub.html b/fetch/metadata/generated/window-location.sub.html similarity index 88% rename from fetch/metadata/generated/window-location-sec-fetch-site.sub.html rename to fetch/metadata/generated/window-location.sub.html index 13693058292560..9065ec6771c8aa 100644 --- a/fetch/metadata/generated/window-location-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/window-location.sub.html @@ -2,13 +2,13 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTP + @@ -54,7 +54,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent) - location'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent) - location'); promise_test(() => { const key = '{{uuid()}}'; @@ -68,7 +68,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent) - location.href'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent) - location.href'); promise_test(() => { const key = '{{uuid()}}'; @@ -82,7 +82,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent) - location.assign'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent) - location.assign'); promise_test(() => { const key = '{{uuid()}}'; @@ -96,7 +96,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent) - location.replace'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent) - location.replace'); promise_test(() => { const key = '{{uuid()}}'; @@ -111,7 +111,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade - location'); + }, 'sec-fetch-site - HTTPS upgrade - location'); promise_test(() => { const key = '{{uuid()}}'; @@ -126,7 +126,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade - location.href'); + }, 'sec-fetch-site - HTTPS upgrade - location.href'); promise_test(() => { const key = '{{uuid()}}'; @@ -141,7 +141,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade - location.assign'); + }, 'sec-fetch-site - HTTPS upgrade - location.assign'); promise_test(() => { const key = '{{uuid()}}'; @@ -156,7 +156,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade - location.replace'); + }, 'sec-fetch-site - HTTPS upgrade - location.replace'); promise_test(() => { const key = '{{uuid()}}'; @@ -171,7 +171,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade - location'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade - location'); promise_test(() => { const key = '{{uuid()}}'; @@ -186,7 +186,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade - location.href'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.href'); promise_test(() => { const key = '{{uuid()}}'; @@ -201,7 +201,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade - location.assign'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.assign'); promise_test(() => { const key = '{{uuid()}}'; @@ -216,7 +216,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade - location.replace'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.replace'); \ No newline at end of file diff --git a/fetch/metadata/generated/window-location-sec-fetch-site.https.sub.html b/fetch/metadata/generated/window-location.sub.https.html similarity index 61% rename from fetch/metadata/generated/window-location-sec-fetch-site.https.sub.html rename to fetch/metadata/generated/window-location.sub.https.html index 353e546c746bf3..a5a0dda737a45f 100644 --- a/fetch/metadata/generated/window-location-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/window-location.sub.https.html @@ -2,15 +2,16 @@ - Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS + + \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.https.sub.html deleted file mode 100644 index 6bd899c6621d2a..00000000000000 --- a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-dest.https.sub.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-mode.https.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-mode.https.sub.html deleted file mode 100644 index 3aea1a1efb4535..00000000000000 --- a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-mode.https.sub.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-user.https.sub.html b/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-user.https.sub.html deleted file mode 100644 index 7b5b80c79e1391..00000000000000 --- a/fetch/metadata/generated/worker-dedicated-constructor-sec-fetch-user.https.sub.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-constructor.sub.https.html b/fetch/metadata/generated/worker-dedicated-constructor.sub.https.html new file mode 100644 index 00000000000000..f52f2d2289d8fd --- /dev/null +++ b/fetch/metadata/generated/worker-dedicated-constructor.sub.https.html @@ -0,0 +1,117 @@ + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.https.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.https.sub.html deleted file mode 100644 index a4f41c6352f569..00000000000000 --- a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-dest.https.sub.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-user.https.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-user.https.sub.html deleted file mode 100644 index 51877f7ee4e1e8..00000000000000 --- a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-user.https.sub.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts.sub.html similarity index 91% rename from fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.sub.html rename to fetch/metadata/generated/worker-dedicated-importscripts.sub.html index e0f01b30fc5463..67467b69964cae 100644 --- a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.sub.html +++ b/fetch/metadata/generated/worker-dedicated-importscripts.sub.html @@ -2,7 +2,7 @@ @@ -38,7 +38,7 @@ .then((headers) => { assert_not_own_property(headers, 'sec-fetch-site'); }); - }, 'HTTPS downgrade (header not sent)'); + }, 'sec-fetch-site - HTTPS downgrade (header not sent)'); promise_test(() => { const key = '{{uuid()}}'; @@ -52,7 +52,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS upgrade'); + }, 'sec-fetch-site - HTTPS upgrade'); promise_test(() => { const key = '{{uuid()}}'; @@ -66,6 +66,6 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'HTTPS downgrade-upgrade'); + }, 'sec-fetch-site - HTTPS downgrade-upgrade'); \ No newline at end of file diff --git a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.https.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts.sub.https.html similarity index 78% rename from fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.https.sub.html rename to fetch/metadata/generated/worker-dedicated-importscripts.sub.https.html index fe8d6fc4cae055..301716102733d6 100644 --- a/fetch/metadata/generated/worker-dedicated-importscripts-sec-fetch-site.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-importscripts.sub.https.html @@ -2,7 +2,7 @@ @@ -39,7 +39,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site -> Same-Origin redirect'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect'); promise_test(() => { const key = '{{uuid()}}'; @@ -53,7 +53,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same Origin'); + }, 'sec-fetch-site - Cross-Site -> Same Origin'); promise_test(() => { const key = '{{uuid()}}'; @@ -67,7 +67,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Same-Site'); + }, 'sec-fetch-site - Cross-Site -> Same-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -81,7 +81,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Cross-Site -> Cross-Site'); + }, 'sec-fetch-site - Cross-Site -> Cross-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -95,7 +95,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-origin'); }); - }, 'Same-Origin -> Same Origin'); + }, 'sec-fetch-site - Same-Origin -> Same Origin'); promise_test(() => { const key = '{{uuid()}}'; @@ -109,7 +109,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Origin -> Same-Site'); + }, 'sec-fetch-site - Same-Origin -> Same-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -123,7 +123,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Origin -> Cross-Site'); + }, 'sec-fetch-site - Same-Origin -> Cross-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -137,7 +137,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same Origin'); + }, 'sec-fetch-site - Same-Site -> Same Origin'); promise_test(() => { const key = '{{uuid()}}'; @@ -151,7 +151,7 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'same-site'); }); - }, 'Same-Site -> Same-Site'); + }, 'sec-fetch-site - Same-Site -> Same-Site'); promise_test(() => { const key = '{{uuid()}}'; @@ -165,6 +165,33 @@ assert_own_property(headers, 'sec-fetch-site'); assert_equals(headers['sec-fetch-site'], 'cross-site'); }); - }, 'Same-Site -> Cross-Site'); + }, 'sec-fetch-site - Same-Site -> Cross-Site'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, [], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-dest'); + assert_equals(headers['sec-fetch-dest'], 'script'); + }); + }, 'sec-fetch-dest'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, [], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_not_own_property(headers, 'sec-fetch-user'); + }); + }, 'sec-fetch-user'); \ No newline at end of file diff --git a/fetch/metadata/tools/README.md b/fetch/metadata/tools/README.md index 929b20a9f59b5f..86198130469236 100644 --- a/fetch/metadata/tools/README.md +++ b/fetch/metadata/tools/README.md @@ -13,4 +13,4 @@ To run: - Invoke the executable: - $ python3 ./generate.py + $ python3 ./generate.py ./path/to/configuration-file.yml diff --git a/fetch/metadata/tools/cases/master.yml b/fetch/metadata/tools/cases/master.yml deleted file mode 100644 index 06f1a8630247b9..00000000000000 --- a/fetch/metadata/tools/cases/master.yml +++ /dev/null @@ -1,357 +0,0 @@ ---- -- title: Fetch Metadata - Sec-Fetch-Site - redirection from HTTP - fileName: sec-fetch-site - all_subtests: - - description: HTTPS downgrade (header not sent) - headerName: sec-fetch-site - origins: [sameOrigin, httpOrigin] - expected: NULL - - description: HTTPS upgrade - headerName: sec-fetch-site - origins: [httpOrigin, sameOrigin] - expected: cross-site - - description: HTTPS downgrade-upgrade - headerName: sec-fetch-site - origins: [sameOrigin, httpOrigin, sameOrigin] - expected: cross-site - each_subtest: - # Unused - # TODO(jugglinmike) document rationale - cors-preflight.sub.html: [] - # Unused - # - the request mode of all "classic" worker scripts is set to - # "same-origin" - # https://html.spec.whatwg.org/#fetch-a-classic-worker-script - # - the request mode of all "top-level "module" worker scripts is set to - # "same-origin": - # https://html.spec.whatwg.org/#fetch-a-single-module-script - worker-dedicated-constructor.sub.html: [] - - appcache-manifest.sub.https.html: [{}] - element-image.sub.html: [{}] - element-script.sub.html: - - {} - - elementAttrs: { type: module } - element-video.sub.html: [{}] - fetch.sub.html: [{}] - font.sub.html: [{}] - form-submission.sub.html: - - method: GET - - method: POST - window-location.sub.html: - - api: location - - api: location.href - - api: location.assign - - api: location.replace - script-module-import-dynamic.sub.html: [{}] - script-module-import-static.sub.html: [{}] - video-poster.sub.html: [{}] - worker-dedicated-importscripts.sub.html: [{}] - -- title: Fetch Metadata - Sec-Fetch-Site - redirection from HTTPS - fileName: sec-fetch-site.https - all_subtests: - - description: Same-Origin -> Cross-Site -> Same-Origin redirect - headerName: sec-fetch-site - origins: [sameOrigin, crossSite, sameOrigin] - expected: cross-site - - description: Cross-Site -> Same Origin - headerName: sec-fetch-site - origins: [crossSite, sameOrigin] - expected: cross-site - - description: Cross-Site -> Same-Site - headerName: sec-fetch-site - origins: [crossSite, sameSite] - expected: cross-site - - description: Cross-Site -> Cross-Site - headerName: sec-fetch-site - origins: [crossSite, crossSite] - expected: cross-site - - description: Same-Origin -> Same Origin - headerName: sec-fetch-site - origins: [sameOrigin, sameOrigin] - expected: same-origin - - description: Same-Origin -> Same-Site - headerName: sec-fetch-site - origins: [sameOrigin, sameSite] - expected: same-site - - description: Same-Origin -> Cross-Site - headerName: sec-fetch-site - origins: [sameOrigin, crossSite] - expected: cross-site - - description: Same-Site -> Same Origin - headerName: sec-fetch-site - origins: [sameSite, sameOrigin] - expected: same-site - - description: Same-Site -> Same-Site - headerName: sec-fetch-site - origins: [sameSite, sameSite] - expected: same-site - - description: Same-Site -> Cross-Site - headerName: sec-fetch-site - origins: [sameSite, crossSite] - expected: cross-site - each_subtest: - # Unused - # TODO(jugglinmike) document rationale - cors-preflight.sub.html: [] - # Unused - # - the request mode of all "classic" worker scripts is set to - # "same-origin" - # https://html.spec.whatwg.org/#fetch-a-classic-worker-script - # - the request mode of all "top-level "module" worker scripts is set to - # "same-origin": - # https://html.spec.whatwg.org/#fetch-a-single-module-script - worker-dedicated-constructor.sub.html: [] - - appcache-manifest.sub.https.html: [{}] - element-image.sub.html: [{}] - element-script.sub.html: - - {} - - elementAttrs: { type: module } - element-video.sub.html: [{}] - fetch.sub.html: [{ init: { mode: no-cors } }] - font.sub.html: [{}] - form-submission.sub.html: - - method: GET - - method: POST - window-location.sub.html: - - api: location - - api: location.href - - api: location.assign - - api: location.replace - script-module-import-dynamic.sub.html: [{}] - script-module-import-static.sub.html: [{}] - video-poster.sub.html: [{}] - worker-dedicated-importscripts.sub.html: [{}] - -- title: Fetch Metadata - Sec-Fetch-Site - redirection with mixed content - # These tests verify the effect that redirection has on the request's "site". - # The initial request must be made to a resource that is "same-site" with its - # origin. This avoids false positives because if the request were made to a - # cross-site resource, the value of "cross-site" would be assigned regardless - # of the subseqent redirection. - # - # Because these conditions necessarily warrant mixed content, only templates - # which can be configured to allow mixed content [1] can be used. - # - # [1] https://w3c.github.io/webappsec-mixed-content/#should-block-fetch - fileName: sec-fetch-site-mixed.https - all_subtests: - - description: HTTPS downgrade-upgrade - headerName: sec-fetch-site - origins: [sameOrigin, httpOrigin, sameOrigin] - expected: cross-site - each_subtest: - # Unused - # TODO(jugglinmike) document rationale - element-script.sub.html: [] - fetch.sub.html: [] - font.sub.html: [] - script-module-import-static.sub.html: [] - script-module-import-dynamic.sub.html: [] - cors-preflight.sub.html: [] - worker-dedicated-constructor.sub.html: [] - worker-dedicated-importscripts.sub.html: [] - - appcache-manifest.sub.https.html: [{}] - element-image.sub.html: [{}] - element-video.sub.html: [{}] - form-submission.sub.html: - - method: GET - - method: POST - window-location.sub.html: - - api: location - - api: location.href - - api: location.assign - - api: location.replace - video-poster.sub.html: [{}] - -- title: Fetch Metadata - Sec-Fetch-Mode - # These tests are served over HTTPS so the induced requests will be both - # same-origin with the document [1] and a potentially-trustworthy URL [2]. - # - # [1] https://html.spec.whatwg.org/multipage/origin.html#same-origin - # [2] https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-url - fileName: sec-fetch-mode.https - all_subtests: - - headerName: sec-fetch-mode - each_subtest: - # Unused - # TODO(jugglinmike) document rationale - worker-dedicated-importscripts.sub.html: [] - - appcache-manifest.sub.https.html: - - expected: no-cors - cors-preflight.sub.html: - - expected: cors - element-image.sub.html: - - expected: no-cors - - expected: cors - elementAttrs: { crossorigin: '' } - - expected: cors - elementAttrs: { crossorigin: anonymous } - - expected: cors - elementAttrs: { crossorigin: use-credentials } - element-script.sub.html: - - expected: no-cors - - expected: cors - elementAttrs: { type: module } - - expected: cors - elementAttrs: { crossorigin: '' } - - expected: cors - elementAttrs: { crossorigin: anonymous } - - expected: cors - elementAttrs: { crossorigin: use-credentials } - element-video.sub.html: - - expected: no-cors - - expected: cors - elementAttrs: { crossorigin: '' } - - expected: cors - elementAttrs: { crossorigin: anonymous } - - expected: cors - elementAttrs: { crossorigin: use-credentials } - fetch.sub.html: - - expected: cors - - expected: cors - init: { mode: cors } - - expected: no-cors - init: { mode: no-cors } - - expected: same-origin - init: { mode: same-origin } - font.sub.html: - - expected: cors - form-submission.sub.html: - - method: GET - expected: navigate - - method: POST - expected: navigate - window-location.sub.html: - - api: location - expected: navigate - - api: location.href - expected: navigate - - api: location.assign - expected: navigate - - api: location.replace - expected: navigate - script-module-import-dynamic.sub.html: - - expected: cors - script-module-import-static.sub.html: - - expected: cors - video-poster.sub.html: - - expected: no-cors - worker-dedicated-constructor.sub.html: - - expected: same-origin - - options: { type: module } - expected: same-origin - -- title: Fetch Metadata - Sec-Fetch-Dest - fileName: sec-fetch-dest.https - all_subtests: - - headerName: sec-fetch-dest - each_subtest: - appcache-manifest.sub.https.html: - - expected: empty - cors-preflight.sub.html: - - expected: empty - element-image.sub.html: - - expected: image - element-script.sub.html: - - expected: script - element-video.sub.html: - - expected: video - fetch.sub.html: - - expected: empty - font.sub.html: - - expected: font - form-submission.sub.html: - - method: GET - expected: document - - method: POST - expected: document - window-location.sub.html: - - api: location - expected: document - - api: location.href - expected: document - - api: location.assign - expected: document - - api: location.replace - expected: document - script-module-import-dynamic.sub.html: - - expected: script - script-module-import-static.sub.html: - - expected: script - video-poster.sub.html: - - expected: image - worker-dedicated-constructor.sub.html: - - expected: worker - - options: { type: module } - expected: worker - worker-dedicated-importscripts.sub.html: - - expected: script - -- title: Fetch Metadata - Sec-Fetch-User - fileName: sec-fetch-user.https - all_subtests: - - headerName: sec-fetch-user - each_subtest: - appcache-manifest.sub.https.html: - - expected: NULL - cors-preflight.sub.html: - - expected: NULL - element-image.sub.html: - - expected: NULL - element-script.sub.html: - - expected: NULL - element-video.sub.html: - - expected: NULL - fetch.sub.html: - - expected: NULL - font.sub.html: - - expected: NULL - form-submission.sub.html: - - method: GET - expected: NULL - - method: GET - userActivated: TRUE - expected: ?1 - - method: POST - expected: NULL - - method: POST - userActivated: TRUE - expected: ?1 - window-location.sub.html: - - api: location - expected: NULL - - api: location - userActivated: TRUE - expected: ?1 - - api: location.href - expected: NULL - - api: location.href - userActivated: TRUE - expected: ?1 - - api: location.assign - expected: NULL - - api: location.assign - userActivated: TRUE - expected: ?1 - - api: location.replace - expected: NULL - - api: location.replace - userActivated: TRUE - expected: ?1 - script-module-import-dynamic.sub.html: - - expected: NULL - script-module-import-static.sub.html: - - expected: NULL - video-poster.sub.html: - - expected: NULL - worker-dedicated-constructor.sub.html: - - expected: NULL - - options: { type: module } - expected: NULL - worker-dedicated-importscripts.sub.html: - - expected: NULL diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml new file mode 100644 index 00000000000000..2e0a5411a28fef --- /dev/null +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -0,0 +1,372 @@ +--- +templates: templates +output_directory: generated +cases: + # Sec-Fetch-Site - redirection from HTTP + - all_subtests: + - description: HTTPS downgrade (header not sent) + headerName: sec-fetch-site + origins: [sameOrigin, httpOrigin] + expected: NULL + filename_flags: [] + - description: HTTPS upgrade + headerName: sec-fetch-site + origins: [httpOrigin, sameOrigin] + expected: cross-site + filename_flags: [] + - description: HTTPS downgrade-upgrade + headerName: sec-fetch-site + origins: [sameOrigin, httpOrigin, sameOrigin] + expected: cross-site + filename_flags: [] + each_subtest: + # Unused + # TODO(jugglinmike) document rationale + cors-preflight.sub.html: [] + # Unused + # - the request mode of all "classic" worker scripts is set to + # "same-origin" + # https://html.spec.whatwg.org/#fetch-a-classic-worker-script + # - the request mode of all "top-level "module" worker scripts is set to + # "same-origin": + # https://html.spec.whatwg.org/#fetch-a-single-module-script + worker-dedicated-constructor.sub.html: [] + + appcache-manifest.sub.https.html: [{}] + element-image.sub.html: [{}] + element-script.sub.html: + - {} + - elementAttrs: { type: module } + element-video.sub.html: [{}] + fetch.sub.html: [{}] + font.sub.html: [{}] + form-submission.sub.html: + - method: GET + - method: POST + window-location.sub.html: + - api: location + - api: location.href + - api: location.assign + - api: location.replace + script-module-import-dynamic.sub.html: [{}] + script-module-import-static.sub.html: [{}] + video-poster.sub.html: [{}] + worker-dedicated-importscripts.sub.html: [{}] + + # Sec-Fetch-Site - redirection from HTTPS + - all_subtests: + - description: Same-Origin -> Cross-Site -> Same-Origin redirect + headerName: sec-fetch-site + origins: [sameOrigin, crossSite, sameOrigin] + expected: cross-site + filename_flags: [https] + - description: Cross-Site -> Same Origin + headerName: sec-fetch-site + origins: [crossSite, sameOrigin] + expected: cross-site + filename_flags: [https] + - description: Cross-Site -> Same-Site + headerName: sec-fetch-site + origins: [crossSite, sameSite] + expected: cross-site + filename_flags: [https] + - description: Cross-Site -> Cross-Site + headerName: sec-fetch-site + origins: [crossSite, crossSite] + expected: cross-site + filename_flags: [https] + - description: Same-Origin -> Same Origin + headerName: sec-fetch-site + origins: [sameOrigin, sameOrigin] + expected: same-origin + filename_flags: [https] + - description: Same-Origin -> Same-Site + headerName: sec-fetch-site + origins: [sameOrigin, sameSite] + expected: same-site + filename_flags: [https] + - description: Same-Origin -> Cross-Site + headerName: sec-fetch-site + origins: [sameOrigin, crossSite] + expected: cross-site + filename_flags: [https] + - description: Same-Site -> Same Origin + headerName: sec-fetch-site + origins: [sameSite, sameOrigin] + expected: same-site + filename_flags: [https] + - description: Same-Site -> Same-Site + headerName: sec-fetch-site + origins: [sameSite, sameSite] + expected: same-site + filename_flags: [https] + - description: Same-Site -> Cross-Site + headerName: sec-fetch-site + origins: [sameSite, crossSite] + expected: cross-site + filename_flags: [https] + each_subtest: + # Unused + # TODO(jugglinmike) document rationale + cors-preflight.sub.html: [] + # Unused + # - the request mode of all "classic" worker scripts is set to + # "same-origin" + # https://html.spec.whatwg.org/#fetch-a-classic-worker-script + # - the request mode of all "top-level "module" worker scripts is set to + # "same-origin": + # https://html.spec.whatwg.org/#fetch-a-single-module-script + worker-dedicated-constructor.sub.html: [] + + appcache-manifest.sub.https.html: [{}] + element-image.sub.html: [{}] + element-script.sub.html: + - {} + - elementAttrs: { type: module } + element-video.sub.html: [{}] + fetch.sub.html: [{ init: { mode: no-cors } }] + font.sub.html: [{}] + form-submission.sub.html: + - method: GET + - method: POST + window-location.sub.html: + - api: location + - api: location.href + - api: location.assign + - api: location.replace + script-module-import-dynamic.sub.html: [{}] + script-module-import-static.sub.html: [{}] + video-poster.sub.html: [{}] + worker-dedicated-importscripts.sub.html: [{}] + + # Sec-Fetch-Site - redirection with mixed content + # These tests verify the effect that redirection has on the request's "site". + # The initial request must be made to a resource that is "same-site" with its + # origin. This avoids false positives because if the request were made to a + # cross-site resource, the value of "cross-site" would be assigned regardless + # of the subseqent redirection. + # + # Because these conditions necessarily warrant mixed content, only templates + # which can be configured to allow mixed content [1] can be used. + # + # [1] https://w3c.github.io/webappsec-mixed-content/#should-block-fetch + + - all_subtests: + - description: HTTPS downgrade-upgrade + headerName: sec-fetch-site + origins: [sameOrigin, httpOrigin, sameOrigin] + expected: cross-site + filename_flags: [https] + each_subtest: + # Unused + # TODO(jugglinmike) document rationale + element-script.sub.html: [] + fetch.sub.html: [] + font.sub.html: [] + script-module-import-static.sub.html: [] + script-module-import-dynamic.sub.html: [] + cors-preflight.sub.html: [] + worker-dedicated-constructor.sub.html: [] + worker-dedicated-importscripts.sub.html: [] + + appcache-manifest.sub.https.html: [{}] + element-image.sub.html: [{}] + element-video.sub.html: [{}] + form-submission.sub.html: + - method: GET + - method: POST + window-location.sub.html: + - api: location + - api: location.href + - api: location.assign + - api: location.replace + video-poster.sub.html: [{}] + + # Sec-Fetch-Mode + # These tests are served over HTTPS so the induced requests will be both + # same-origin with the document [1] and a potentially-trustworthy URL [2]. + # + # [1] https://html.spec.whatwg.org/multipage/origin.html#same-origin + # [2] https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-url + - all_subtests: + - headerName: sec-fetch-mode + filename_flags: [https] + each_subtest: + # Unused + # TODO(jugglinmike) document rationale + worker-dedicated-importscripts.sub.html: [] + + appcache-manifest.sub.https.html: + - expected: no-cors + cors-preflight.sub.html: + - expected: cors + element-image.sub.html: + - expected: no-cors + - expected: cors + elementAttrs: { crossorigin: '' } + - expected: cors + elementAttrs: { crossorigin: anonymous } + - expected: cors + elementAttrs: { crossorigin: use-credentials } + element-script.sub.html: + - expected: no-cors + - expected: cors + elementAttrs: { type: module } + - expected: cors + elementAttrs: { crossorigin: '' } + - expected: cors + elementAttrs: { crossorigin: anonymous } + - expected: cors + elementAttrs: { crossorigin: use-credentials } + element-video.sub.html: + - expected: no-cors + - expected: cors + elementAttrs: { crossorigin: '' } + - expected: cors + elementAttrs: { crossorigin: anonymous } + - expected: cors + elementAttrs: { crossorigin: use-credentials } + fetch.sub.html: + - expected: cors + - expected: cors + init: { mode: cors } + - expected: no-cors + init: { mode: no-cors } + - expected: same-origin + init: { mode: same-origin } + font.sub.html: + - expected: cors + form-submission.sub.html: + - method: GET + expected: navigate + - method: POST + expected: navigate + window-location.sub.html: + - api: location + expected: navigate + - api: location.href + expected: navigate + - api: location.assign + expected: navigate + - api: location.replace + expected: navigate + script-module-import-dynamic.sub.html: + - expected: cors + script-module-import-static.sub.html: + - expected: cors + video-poster.sub.html: + - expected: no-cors + worker-dedicated-constructor.sub.html: + - expected: same-origin + - options: { type: module } + expected: same-origin + + # Sec-Fetch-Dest + - all_subtests: + - headerName: sec-fetch-dest + filename_flags: [https] + each_subtest: + appcache-manifest.sub.https.html: + - expected: empty + cors-preflight.sub.html: + - expected: empty + element-image.sub.html: + - expected: image + element-script.sub.html: + - expected: script + element-video.sub.html: + - expected: video + fetch.sub.html: + - expected: empty + font.sub.html: + - expected: font + form-submission.sub.html: + - method: GET + expected: document + - method: POST + expected: document + window-location.sub.html: + - api: location + expected: document + - api: location.href + expected: document + - api: location.assign + expected: document + - api: location.replace + expected: document + script-module-import-dynamic.sub.html: + - expected: script + script-module-import-static.sub.html: + - expected: script + video-poster.sub.html: + - expected: image + worker-dedicated-constructor.sub.html: + - expected: worker + - options: { type: module } + expected: worker + worker-dedicated-importscripts.sub.html: + - expected: script + + # Sec-Fetch-User + - all_subtests: + - headerName: sec-fetch-user + filename_flags: [https] + each_subtest: + appcache-manifest.sub.https.html: + - expected: NULL + cors-preflight.sub.html: + - expected: NULL + element-image.sub.html: + - expected: NULL + element-script.sub.html: + - expected: NULL + element-video.sub.html: + - expected: NULL + fetch.sub.html: + - expected: NULL + font.sub.html: + - expected: NULL + form-submission.sub.html: + - method: GET + expected: NULL + - method: GET + userActivated: TRUE + expected: ?1 + - method: POST + expected: NULL + - method: POST + userActivated: TRUE + expected: ?1 + window-location.sub.html: + - api: location + expected: NULL + - api: location + userActivated: TRUE + expected: ?1 + - api: location.href + expected: NULL + - api: location.href + userActivated: TRUE + expected: ?1 + - api: location.assign + expected: NULL + - api: location.assign + userActivated: TRUE + expected: ?1 + - api: location.replace + expected: NULL + - api: location.replace + userActivated: TRUE + expected: ?1 + script-module-import-dynamic.sub.html: + - expected: NULL + script-module-import-static.sub.html: + - expected: NULL + video-poster.sub.html: + - expected: NULL + worker-dedicated-constructor.sub.html: + - expected: NULL + - options: { type: module } + expected: NULL + worker-dedicated-importscripts.sub.html: + - expected: NULL diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index a4aec4045c1083..60efe811b9931f 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -1,14 +1,13 @@ #!/usr/bin/env python3 +import argparse +import itertools import os import jinja2 import yaml HERE = os.path.abspath(os.path.dirname(__file__)) -OUT_DIR = os.path.normpath(os.path.join(HERE, '..', 'generated')) -TEMPLATES_DIR = os.path.join(HERE, 'templates') -CASES = os.path.join(HERE, 'cases', 'master.yml') PROJECT_ROOT = os.path.join(HERE, '..', '..', '..') def find_templates(starting_directory): @@ -18,15 +17,12 @@ def find_templates(starting_directory): continue yield file_name, os.path.join(directory, file_name) -# template_name | case_name | test_name -# --------------------|------------|---------- -# template.html | case | template-case.html -# template.html | case.sub | template-case.sub.html -# template.https.html | case | template-case.https.html -# template.sub.html | case.https | template-case.https.sub.html -def test_name(template_name, case_name): - prefix, suffix = template_name.split('.', 1) - return '{}-{}.{}'.format(prefix, case_name, suffix) +def test_name(directory, template_name, flags): + parts = list(os.path.splitext(template_name)) + if parts[1]: + parts[1] = parts[1][1:] + parts[1:1] = flags + return os.path.join(directory, '.'.join(parts)) def cross(a, b): for a_object in a: @@ -66,7 +62,14 @@ def pad_filter(value, side, padding): return value + padding -def main(project_root, templates_directory, cases_file, out_directory): +def main(config_file): + with open(config_file) as handle: + config = yaml.safe_load(handle.read()) + + templates_directory = os.path.normpath( + os.path.join(os.path.dirname(config_file), config['templates']) + ) + environment = jinja2.Environment( variable_start_string='[%', variable_end_string='%]' @@ -74,14 +77,14 @@ def main(project_root, templates_directory, cases_file, out_directory): environment.filters['collection'] = collection_filter environment.filters['pad'] = pad_filter templates = {} + subtests = {} + for template_name, path in find_templates(templates_directory): + subtests[template_name] = [] with open(path, 'r') as handle: templates[template_name] = environment.from_string(handle.read()) - with open(cases_file, 'r') as handle: - cases = yaml.safe_load(handle.read()) - - for case in cases: + for case in config['cases']: unused_templates = set(templates) - set(case['each_subtest']) # This warning is intended to help authors avoid mistakenly omitting @@ -90,36 +93,44 @@ def main(project_root, templates_directory, cases_file, out_directory): # unused. if unused_templates: print( - 'Warning: case "{}" does not '.format(case['title']) + - 'reference the following templates:' + 'Warning: case does not reference the following templates:' ) print('\n'.join('- {}'.format(name) for name in unused_templates)) for template_name, concise_subtests in case['each_subtest'].items(): - out_file_name = os.path.join( - out_directory, - test_name(template_name, case['fileName']) + subtests[template_name].extend( + [subtest for subtest in cross( + case['all_subtests'], concise_subtests + )] ) - context = dict( - subtests=[subtest for subtest in cross( - case.get('all_subtests', [{}]), concise_subtests - )], - **case, - provenance=make_provenance( - project_root, - cases_file, - os.path.join(templates_directory, template_name) - ) + + for template_name, template in templates.items(): + provenance = make_provenance( + PROJECT_ROOT, + config_file, + os.path.join(templates_directory, template_name) + ) + get_filename_flags = lambda subtest: subtest['filename_flags'] + subtests_by_flag = itertools.groupby( + sorted(subtests[template_name], key=get_filename_flags), + key=get_filename_flags + ) + for flags, some_subtests in subtests_by_flag: + out_file_name = test_name( + config['output_directory'], template_name, flags ) - context.pop('all_subtests', None) - context.pop('each_subtest') - # Ignore expansions with zero subtests--this is the intended - # mechanism for authors to explicitly communicate that a given - # template is undesired. - if len(context['subtests']): - with open(out_file_name, 'w') as handle: - handle.write(templates[template_name].render(**context)) + with open(out_file_name, 'w') as handle: + handle.write(templates[template_name].render( + subtests=list(some_subtests), + provenance=provenance + )) if __name__ == '__main__': - main(PROJECT_ROOT, TEMPLATES_DIR, CASES, OUT_DIR) + parser = argparse.ArgumentParser() + parser.add_argument( + 'config_file', + type=str, + help='Path to a YAML-formatted configuration file' + ) + main(**vars(parser.parse_args())) diff --git a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html index 6439992a9607cd..5d264c28599a77 100644 --- a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html +++ b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html @@ -55,7 +55,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description%]'); + }, '[%subtest.headerName%][%subtest.description | pad("start", " - ")%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/cors-preflight.sub.html b/fetch/metadata/tools/templates/cors-preflight.sub.html index cd250cb3741492..ee8478924fc513 100644 --- a/fetch/metadata/tools/templates/cors-preflight.sub.html +++ b/fetch/metadata/tools/templates/cors-preflight.sub.html @@ -35,7 +35,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description%]'); + }, '[%subtest.headerName%][%subtest.description | pad("start", " - ")%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/element-image.sub.html b/fetch/metadata/tools/templates/element-image.sub.html index a68301246b1120..0507d6575be517 100644 --- a/fetch/metadata/tools/templates/element-image.sub.html +++ b/fetch/metadata/tools/templates/element-image.sub.html @@ -43,7 +43,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description | pad("end", ", ")%][%subtest.elementAttrs | collection("attributes")%]'); + }, '[%subtest.headerName%] - [%subtest.description | pad("end", ", ")%][%subtest.elementAttrs | collection("attributes")%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/element-script.sub.html b/fetch/metadata/tools/templates/element-script.sub.html index 28b1c3fc785d8a..aecea0b1b62dd5 100644 --- a/fetch/metadata/tools/templates/element-script.sub.html +++ b/fetch/metadata/tools/templates/element-script.sub.html @@ -47,7 +47,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description | pad("end", ", ")%][%-subtest.elementAttrs | collection("attributes")%]'); + }, '[%subtest.headerName%] - [%subtest.description | pad("end", ", ")%][%-subtest.elementAttrs | collection("attributes")%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/element-video.sub.html b/fetch/metadata/tools/templates/element-video.sub.html index 2b641765dce49b..823176601affa2 100644 --- a/fetch/metadata/tools/templates/element-video.sub.html +++ b/fetch/metadata/tools/templates/element-video.sub.html @@ -43,7 +43,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description | pad("end", ", ")%][%subtest.elementAttrs | collection("attributes")%]'); + }, '[%subtest.headerName%] - [%subtest.description | pad("end", ", ")%][%subtest.elementAttrs | collection("attributes")%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/fetch.sub.html b/fetch/metadata/tools/templates/fetch.sub.html index 891a30e3276f05..e0858dd131e260 100644 --- a/fetch/metadata/tools/templates/fetch.sub.html +++ b/fetch/metadata/tools/templates/fetch.sub.html @@ -34,7 +34,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description | pad("end", ", ")%][%subtest.init | collection("init")%]'); + }, '[%subtest.headerName%] - [%subtest.description | pad("end", ", ")%][%subtest.init | collection("init")%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/font.sub.html b/fetch/metadata/tools/templates/font.sub.html index 42a93d33afe4f5..828578a5267a02 100644 --- a/fetch/metadata/tools/templates/font.sub.html +++ b/fetch/metadata/tools/templates/font.sub.html @@ -49,7 +49,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description%]'); + }, '[%subtest.headerName%][%subtest.description | pad("start", " - ")%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/form-submission.sub.html b/fetch/metadata/tools/templates/form-submission.sub.html index 0af2afdf139ba5..130fc26100af37 100644 --- a/fetch/metadata/tools/templates/form-submission.sub.html +++ b/fetch/metadata/tools/templates/form-submission.sub.html @@ -77,7 +77,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description | pad("end", " - ")%][%subtest.method | default("POST")%][%" with user activation" if subtest.userActivated%]'); + }, '[%subtest.headerName%] - [%subtest.description | pad("end", " - ")%][%subtest.method | default("POST")%][%" with user activation" if subtest.userActivated%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html b/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html index 730f5534e3d8f1..9c714c94af16fe 100644 --- a/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html +++ b/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html @@ -27,7 +27,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description%]'); + }, '[%subtest.headerName%][%subtest.description | pad("start", " - ")%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/script-module-import-static.sub.html b/fetch/metadata/tools/templates/script-module-import-static.sub.html index 7eec0e009972c3..181318ab18ac93 100644 --- a/fetch/metadata/tools/templates/script-module-import-static.sub.html +++ b/fetch/metadata/tools/templates/script-module-import-static.sub.html @@ -46,7 +46,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description%]'); + }, '[%subtest.headerName%][%subtest.description | pad("start", " - ")%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/video-poster.sub.html b/fetch/metadata/tools/templates/video-poster.sub.html index 7795ff644ee960..417941bd160a49 100644 --- a/fetch/metadata/tools/templates/video-poster.sub.html +++ b/fetch/metadata/tools/templates/video-poster.sub.html @@ -36,7 +36,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description%]'); + }, '[%subtest.headerName%][%subtest.description | pad("start", " - ")%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/window-location.sub.html b/fetch/metadata/tools/templates/window-location.sub.html index 52a1ce38922f39..fb2cc7d7e498ea 100644 --- a/fetch/metadata/tools/templates/window-location.sub.html +++ b/fetch/metadata/tools/templates/window-location.sub.html @@ -66,7 +66,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description | pad("right", " - ")%][%subtest.api%][% " with user activation" if subtest.userActivated%]'); + }, '[%subtest.headerName%] - [%subtest.description | pad("right", " - ")%][%subtest.api%][% " with user activation" if subtest.userActivated%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html b/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html index 8d3922eead9702..0f7e501323fac8 100644 --- a/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html +++ b/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html @@ -41,7 +41,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description | pad("end", ", ")%][%subtest.options|collection("options")%]'); + }, '[%subtest.headerName%] - [%subtest.description | pad("end", ", ")%][%subtest.options|collection("options")%]'); {%- endfor %} diff --git a/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html b/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html index b9967c77babb9a..3893652657d5be 100644 --- a/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html +++ b/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html @@ -46,7 +46,7 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.description%]'); + }, '[%subtest.headerName%][%subtest.description | pad("start", " - ")%]'); {%- endfor %} From d1fe665c6e2722a8764dc0eb4e9fb1a70acb5ac2 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 1 May 2020 14:06:56 -0400 Subject: [PATCH 080/127] Poll for video poster loading on the client --- .../metadata/generated/video-poster.sub.html | 34 +++++-- .../generated/video-poster.sub.https.html | 89 ++++++++++--------- .../tools/templates/video-poster.sub.html | 24 ++++- 3 files changed, 93 insertions(+), 54 deletions(-) diff --git a/fetch/metadata/generated/video-poster.sub.html b/fetch/metadata/generated/video-poster.sub.html index 1dd3549fb9d027..af39c13ea793bd 100644 --- a/fetch/metadata/generated/video-poster.sub.html +++ b/fetch/metadata/generated/video-poster.sub.html @@ -15,20 +15,38 @@ - - - - - - \ No newline at end of file diff --git a/fetch/metadata/generated/cors-preflight.sub.https.html b/fetch/metadata/generated/cors-preflight.https.sub.html similarity index 100% rename from fetch/metadata/generated/cors-preflight.sub.https.html rename to fetch/metadata/generated/cors-preflight.https.sub.html diff --git a/fetch/metadata/generated/element-image.sub.https.html b/fetch/metadata/generated/element-image.https.sub.html similarity index 100% rename from fetch/metadata/generated/element-image.sub.https.html rename to fetch/metadata/generated/element-image.https.sub.html diff --git a/fetch/metadata/generated/element-script.sub.https.html b/fetch/metadata/generated/element-script.https.sub.html similarity index 100% rename from fetch/metadata/generated/element-script.sub.https.html rename to fetch/metadata/generated/element-script.https.sub.html diff --git a/fetch/metadata/generated/element-video.sub.https.html b/fetch/metadata/generated/element-video.https.sub.html similarity index 100% rename from fetch/metadata/generated/element-video.sub.https.html rename to fetch/metadata/generated/element-video.https.sub.html diff --git a/fetch/metadata/generated/fetch.sub.https.html b/fetch/metadata/generated/fetch.https.sub.html similarity index 100% rename from fetch/metadata/generated/fetch.sub.https.html rename to fetch/metadata/generated/fetch.https.sub.html diff --git a/fetch/metadata/generated/font.sub.https.html b/fetch/metadata/generated/font.https.sub.html similarity index 100% rename from fetch/metadata/generated/font.sub.https.html rename to fetch/metadata/generated/font.https.sub.html diff --git a/fetch/metadata/generated/form-submission.sub.https.html b/fetch/metadata/generated/form-submission.https.sub.html similarity index 100% rename from fetch/metadata/generated/form-submission.sub.https.html rename to fetch/metadata/generated/form-submission.https.sub.html diff --git a/fetch/metadata/generated/script-module-import-dynamic.sub.https.html b/fetch/metadata/generated/script-module-import-dynamic.https.sub.html similarity index 100% rename from fetch/metadata/generated/script-module-import-dynamic.sub.https.html rename to fetch/metadata/generated/script-module-import-dynamic.https.sub.html diff --git a/fetch/metadata/generated/script-module-import-static.sub.https.html b/fetch/metadata/generated/script-module-import-static.https.sub.html similarity index 100% rename from fetch/metadata/generated/script-module-import-static.sub.https.html rename to fetch/metadata/generated/script-module-import-static.https.sub.html diff --git a/fetch/metadata/generated/video-poster.sub.https.html b/fetch/metadata/generated/video-poster.https.sub.html similarity index 100% rename from fetch/metadata/generated/video-poster.sub.https.html rename to fetch/metadata/generated/video-poster.https.sub.html diff --git a/fetch/metadata/generated/window-location.sub.https.html b/fetch/metadata/generated/window-location.https.sub.html similarity index 100% rename from fetch/metadata/generated/window-location.sub.https.html rename to fetch/metadata/generated/window-location.https.sub.html diff --git a/fetch/metadata/generated/worker-dedicated-constructor.sub.https.html b/fetch/metadata/generated/worker-dedicated-constructor.https.sub.html similarity index 100% rename from fetch/metadata/generated/worker-dedicated-constructor.sub.https.html rename to fetch/metadata/generated/worker-dedicated-constructor.https.sub.html diff --git a/fetch/metadata/generated/worker-dedicated-importscripts.sub.https.html b/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html similarity index 100% rename from fetch/metadata/generated/worker-dedicated-importscripts.sub.https.html rename to fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index 60efe811b9931f..7a7d913b65bac0 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -17,12 +17,36 @@ def find_templates(starting_directory): continue yield file_name, os.path.join(directory, file_name) -def test_name(directory, template_name, flags): - parts = list(os.path.splitext(template_name)) - if parts[1]: - parts[1] = parts[1][1:] - parts[1:1] = flags - return os.path.join(directory, '.'.join(parts)) +def test_name(directory, template_name, subtest_flags): + ''' + Create a test name based on a template and the WPT file name flags [1] + required for a given subtest. This name is used to determine how subtests + may be grouped together. In order to promote grouping, the combination uses + a few aspects of how file name flags are interpreted: + + - repeated flags have no effect, so duplicates are removed + - flag sequence does not matter, so flags are consistently sorted + + directory | template_name | subtest_flags | result + ----------|------------------|-----------------|------- + cors | image.html | [] | cors/image.html + cors | image.https.html | [] | cors/image.https.html + cors | image.html | [https] | cors/image.https.html + cors | image.https.html | [https] | cors/image.https.html + cors | image.https.html | [https] | cors/image.https.html + cors | image.sub.html | [https] | cors/image.https.sub.html + cors | image.https.html | [sub] | cors/image.https.sub.html + + [1] docs/writing-tests/file-names.md + ''' + template_name_parts = template_name.split('.') + flags = set(subtest_flags) | set(template_name_parts[1:-1]) + test_name_parts = [ + template_name_parts[0], + *sorted(flags), + template_name_parts[-1] + ] + return os.path.join(directory, '.'.join(test_name_parts)) def cross(a, b): for a_object in a: @@ -110,17 +134,17 @@ def main(config_file): config_file, os.path.join(templates_directory, template_name) ) - get_filename_flags = lambda subtest: subtest['filename_flags'] - subtests_by_flag = itertools.groupby( - sorted(subtests[template_name], key=get_filename_flags), - key=get_filename_flags + get_filename = lambda subtest: test_name( + config['output_directory'], + template_name, + subtest['filename_flags'] ) - for flags, some_subtests in subtests_by_flag: - out_file_name = test_name( - config['output_directory'], template_name, flags - ) - - with open(out_file_name, 'w') as handle: + subtests_by_filename = itertools.groupby( + sorted(subtests[template_name], key=get_filename), + key=get_filename + ) + for filename, some_subtests in subtests_by_filename: + with open(filename, 'w') as handle: handle.write(templates[template_name].render( subtests=list(some_subtests), provenance=provenance From f3e0d2a153bbf2044e1fdf523742b0071dd772f2 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 11 May 2020 19:38:34 -0400 Subject: [PATCH 082/127] Generalize generator & increase case literalness --- fetch/metadata/tools/fetch-metadata.conf.yml | 3 +++ fetch/metadata/tools/generate.py | 23 +++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 2e0a5411a28fef..5b165d718c986d 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -191,6 +191,7 @@ cases: - all_subtests: - headerName: sec-fetch-mode filename_flags: [https] + origins: [] each_subtest: # Unused # TODO(jugglinmike) document rationale @@ -265,6 +266,7 @@ cases: - all_subtests: - headerName: sec-fetch-dest filename_flags: [https] + origins: [] each_subtest: appcache-manifest.sub.https.html: - expected: empty @@ -311,6 +313,7 @@ cases: - all_subtests: - headerName: sec-fetch-user filename_flags: [https] + origins: [] each_subtest: appcache-manifest.sub.https.html: - expected: NULL diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index 7a7d913b65bac0..6ddfab3ade41c5 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -48,16 +48,29 @@ def test_name(directory, template_name, subtest_flags): ] return os.path.join(directory, '.'.join(test_name_parts)) -def cross(a, b): +def product(a, b): + ''' + Given two lists of objects, compute their Cartesian product by merging the + elements together. For example, + + product( + [{'a': 1}, {'b': 2}], + [{'c': 3}, {'d': 4}] + ) + + returns a generator which yields the following values: + + {'a': 1, 'c': 3} + {'a': 1, 'd': 4} + {'b': 2, 'c': 3} + {'b': 2, 'd': 4} + ''' for a_object in a: for b_object in b: merged = {} merged.update(a_object) merged.update(b_object) - if 'origins' not in merged: - merged['origins'] = [] - yield merged def make_provenance(project_root, cases, template): @@ -123,7 +136,7 @@ def main(config_file): for template_name, concise_subtests in case['each_subtest'].items(): subtests[template_name].extend( - [subtest for subtest in cross( + [subtest for subtest in product( case['all_subtests'], concise_subtests )] ) From 6f9b8da682c0cd7c045d25b798bdc90ed3048564 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 11 May 2020 22:54:39 -0400 Subject: [PATCH 083/127] Improve terminology and reduce repetition --- fetch/metadata/tools/fetch-metadata.conf.yml | 52 ++++++-------------- fetch/metadata/tools/generate.py | 22 +++++---- 2 files changed, 29 insertions(+), 45 deletions(-) diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 5b165d718c986d..f4128dc0fa95ec 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -4,22 +4,19 @@ output_directory: generated cases: # Sec-Fetch-Site - redirection from HTTP - all_subtests: + headerName: sec-fetch-site + filename_flags: [] + common_axis: - description: HTTPS downgrade (header not sent) - headerName: sec-fetch-site origins: [sameOrigin, httpOrigin] expected: NULL - filename_flags: [] - description: HTTPS upgrade - headerName: sec-fetch-site origins: [httpOrigin, sameOrigin] expected: cross-site - filename_flags: [] - description: HTTPS downgrade-upgrade - headerName: sec-fetch-site origins: [sameOrigin, httpOrigin, sameOrigin] expected: cross-site - filename_flags: [] - each_subtest: + template_axes: # Unused # TODO(jugglinmike) document rationale cors-preflight.sub.html: [] @@ -55,57 +52,40 @@ cases: # Sec-Fetch-Site - redirection from HTTPS - all_subtests: + headerName: sec-fetch-site + filename_flags: [https] + common_axis: - description: Same-Origin -> Cross-Site -> Same-Origin redirect - headerName: sec-fetch-site origins: [sameOrigin, crossSite, sameOrigin] expected: cross-site - filename_flags: [https] - description: Cross-Site -> Same Origin - headerName: sec-fetch-site origins: [crossSite, sameOrigin] expected: cross-site - filename_flags: [https] - description: Cross-Site -> Same-Site - headerName: sec-fetch-site origins: [crossSite, sameSite] expected: cross-site - filename_flags: [https] - description: Cross-Site -> Cross-Site - headerName: sec-fetch-site origins: [crossSite, crossSite] expected: cross-site - filename_flags: [https] - description: Same-Origin -> Same Origin - headerName: sec-fetch-site origins: [sameOrigin, sameOrigin] expected: same-origin - filename_flags: [https] - description: Same-Origin -> Same-Site - headerName: sec-fetch-site origins: [sameOrigin, sameSite] expected: same-site - filename_flags: [https] - description: Same-Origin -> Cross-Site - headerName: sec-fetch-site origins: [sameOrigin, crossSite] expected: cross-site - filename_flags: [https] - description: Same-Site -> Same Origin - headerName: sec-fetch-site origins: [sameSite, sameOrigin] expected: same-site - filename_flags: [https] - description: Same-Site -> Same-Site - headerName: sec-fetch-site origins: [sameSite, sameSite] expected: same-site - filename_flags: [https] - description: Same-Site -> Cross-Site - headerName: sec-fetch-site origins: [sameSite, crossSite] expected: cross-site - filename_flags: [https] - each_subtest: + template_axes: # Unused # TODO(jugglinmike) document rationale cors-preflight.sub.html: [] @@ -151,13 +131,13 @@ cases: # # [1] https://w3c.github.io/webappsec-mixed-content/#should-block-fetch - - all_subtests: + - common_axis: - description: HTTPS downgrade-upgrade headerName: sec-fetch-site origins: [sameOrigin, httpOrigin, sameOrigin] expected: cross-site filename_flags: [https] - each_subtest: + template_axes: # Unused # TODO(jugglinmike) document rationale element-script.sub.html: [] @@ -188,11 +168,11 @@ cases: # # [1] https://html.spec.whatwg.org/multipage/origin.html#same-origin # [2] https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-url - - all_subtests: + - common_axis: - headerName: sec-fetch-mode filename_flags: [https] origins: [] - each_subtest: + template_axes: # Unused # TODO(jugglinmike) document rationale worker-dedicated-importscripts.sub.html: [] @@ -263,11 +243,11 @@ cases: expected: same-origin # Sec-Fetch-Dest - - all_subtests: + - common_axis: - headerName: sec-fetch-dest filename_flags: [https] origins: [] - each_subtest: + template_axes: appcache-manifest.sub.https.html: - expected: empty cors-preflight.sub.html: @@ -310,11 +290,11 @@ cases: - expected: script # Sec-Fetch-User - - all_subtests: + - common_axis: - headerName: sec-fetch-user filename_flags: [https] origins: [] - each_subtest: + template_axes: appcache-manifest.sub.https.html: - expected: NULL cors-preflight.sub.html: diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index 6ddfab3ade41c5..b75fd65cd0d053 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -65,13 +65,17 @@ def product(a, b): {'b': 2, 'c': 3} {'b': 2, 'd': 4} ''' + result = [] + for a_object in a: for b_object in b: merged = {} merged.update(a_object) merged.update(b_object) - yield merged + result.append(merged) + + return result def make_provenance(project_root, cases, template): return '\n'.join([ @@ -122,10 +126,10 @@ def main(config_file): templates[template_name] = environment.from_string(handle.read()) for case in config['cases']: - unused_templates = set(templates) - set(case['each_subtest']) + unused_templates = set(templates) - set(case['template_axes']) # This warning is intended to help authors avoid mistakenly omitting - # templates. It can be silenced by extending the`each_subtest` + # templates. It can be silenced by extending the`template_axes` # dictionary with an empty list for templates which are intentionally # unused. if unused_templates: @@ -134,12 +138,12 @@ def main(config_file): ) print('\n'.join('- {}'.format(name) for name in unused_templates)) - for template_name, concise_subtests in case['each_subtest'].items(): - subtests[template_name].extend( - [subtest for subtest in product( - case['all_subtests'], concise_subtests - )] - ) + common_axis = product( + case['common_axis'], [case.get('all_subtests', {})] + ) + + for template_name, template_axis in case['template_axes'].items(): + subtests[template_name].extend(product(common_axis, template_axis)) for template_name, template in templates.items(): provenance = make_provenance( From 9d2b386e8b45feeb35547248ec27db099cbf3ae5 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 12 May 2020 14:01:30 -0400 Subject: [PATCH 084/127] Add tests for HTML audio element --- .../generated/element-audio.https.sub.html | 269 ++++++++++++++++++ .../metadata/generated/element-audio.sub.html | 73 +++++ fetch/metadata/tools/fetch-metadata.conf.yml | 15 + .../tools/templates/element-audio.sub.html | 51 ++++ 4 files changed, 408 insertions(+) create mode 100644 fetch/metadata/generated/element-audio.https.sub.html create mode 100644 fetch/metadata/generated/element-audio.sub.html create mode 100644 fetch/metadata/tools/templates/element-audio.sub.html diff --git a/fetch/metadata/generated/element-audio.https.sub.html b/fetch/metadata/generated/element-audio.https.sub.html new file mode 100644 index 00000000000000..26c8267fc4a25e --- /dev/null +++ b/fetch/metadata/generated/element-audio.https.sub.html @@ -0,0 +1,269 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/element-audio.sub.html b/fetch/metadata/generated/element-audio.sub.html new file mode 100644 index 00000000000000..f4aff82a815948 --- /dev/null +++ b/fetch/metadata/generated/element-audio.sub.html @@ -0,0 +1,73 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index f4128dc0fa95ec..90dda143caad48 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -30,6 +30,7 @@ cases: worker-dedicated-constructor.sub.html: [] appcache-manifest.sub.https.html: [{}] + element-audio.sub.html: [{}] element-image.sub.html: [{}] element-script.sub.html: - {} @@ -99,6 +100,7 @@ cases: worker-dedicated-constructor.sub.html: [] appcache-manifest.sub.https.html: [{}] + element-audio.sub.html: [{}] element-image.sub.html: [{}] element-script.sub.html: - {} @@ -150,6 +152,7 @@ cases: worker-dedicated-importscripts.sub.html: [] appcache-manifest.sub.https.html: [{}] + element-audio.sub.html: [{}] element-image.sub.html: [{}] element-video.sub.html: [{}] form-submission.sub.html: @@ -181,6 +184,14 @@ cases: - expected: no-cors cors-preflight.sub.html: - expected: cors + element-audio.sub.html: + - expected: no-cors + - expected: cors + elementAttrs: { crossorigin: '' } + - expected: cors + elementAttrs: { crossorigin: anonymous } + - expected: cors + elementAttrs: { crossorigin: use-credentials } element-image.sub.html: - expected: no-cors - expected: cors @@ -252,6 +263,8 @@ cases: - expected: empty cors-preflight.sub.html: - expected: empty + element-audio.sub.html: + - expected: audio element-image.sub.html: - expected: image element-script.sub.html: @@ -299,6 +312,8 @@ cases: - expected: NULL cors-preflight.sub.html: - expected: NULL + element-audio.sub.html: + - expected: NULL element-image.sub.html: - expected: NULL element-script.sub.html: diff --git a/fetch/metadata/tools/templates/element-audio.sub.html b/fetch/metadata/tools/templates/element-audio.sub.html new file mode 100644 index 00000000000000..2392301273983b --- /dev/null +++ b/fetch/metadata/tools/templates/element-audio.sub.html @@ -0,0 +1,51 @@ + + + + + [%title%] + + + + + + + From 62ff43e10fe9a43c2dbf10870d9bc496faad9646 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 12 May 2020 19:42:56 -0400 Subject: [PATCH 085/127] Add tests for AudioWorklet --- .../generated/audioworklet.https.sub.html | 214 ++++++++++++++++++ fetch/metadata/tools/fetch-metadata.conf.yml | 13 ++ .../templates/audioworklet.https.sub.html | 52 +++++ 3 files changed, 279 insertions(+) create mode 100644 fetch/metadata/generated/audioworklet.https.sub.html create mode 100644 fetch/metadata/tools/templates/audioworklet.https.sub.html diff --git a/fetch/metadata/generated/audioworklet.https.sub.html b/fetch/metadata/generated/audioworklet.https.sub.html new file mode 100644 index 00000000000000..021bc8f5a8b73c --- /dev/null +++ b/fetch/metadata/generated/audioworklet.https.sub.html @@ -0,0 +1,214 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 90dda143caad48..37bb1a971b0275 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -18,6 +18,9 @@ cases: expected: cross-site template_axes: # Unused + # The `audioWorklet` interface is only available in secure contexts + # https://webaudio.github.io/web-audio-api/#BaseAudioContext + audioworklet.https.sub.html: [] # TODO(jugglinmike) document rationale cors-preflight.sub.html: [] # Unused @@ -100,6 +103,7 @@ cases: worker-dedicated-constructor.sub.html: [] appcache-manifest.sub.https.html: [{}] + audioworklet.https.sub.html: [{}] element-audio.sub.html: [{}] element-image.sub.html: [{}] element-script.sub.html: @@ -142,6 +146,7 @@ cases: template_axes: # Unused # TODO(jugglinmike) document rationale + audioworklet.https.sub.html: [] element-script.sub.html: [] fetch.sub.html: [] font.sub.html: [] @@ -182,6 +187,9 @@ cases: appcache-manifest.sub.https.html: - expected: no-cors + audioworklet.https.sub.html: + # https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-single-module-script + - expected: cors cors-preflight.sub.html: - expected: cors element-audio.sub.html: @@ -261,6 +269,9 @@ cases: template_axes: appcache-manifest.sub.https.html: - expected: empty + audioworklet.https.sub.html: + # https://github.com/WebAudio/web-audio-api/issues/2203 + - expected: audioworklet cors-preflight.sub.html: - expected: empty element-audio.sub.html: @@ -310,6 +321,8 @@ cases: template_axes: appcache-manifest.sub.https.html: - expected: NULL + audioworklet.https.sub.html: + - expected: NULL cors-preflight.sub.html: - expected: NULL element-audio.sub.html: diff --git a/fetch/metadata/tools/templates/audioworklet.https.sub.html b/fetch/metadata/tools/templates/audioworklet.https.sub.html new file mode 100644 index 00000000000000..9ab592857aaffd --- /dev/null +++ b/fetch/metadata/tools/templates/audioworklet.https.sub.html @@ -0,0 +1,52 @@ + + + + + [%title%] + + + + + + + + From 3d8667484349cb1fc3c6d41316e2c5d114f3f4c5 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 12 May 2020 20:17:58 -0400 Subject: [PATCH 086/127] Document rationale --- fetch/metadata/tools/fetch-metadata.conf.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 37bb1a971b0275..b1e61b1137edf6 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -144,8 +144,10 @@ cases: expected: cross-site filename_flags: [https] template_axes: - # Unused - # TODO(jugglinmike) document rationale + # Mixed Content considers only a small subset of requests as + # "optionally-blockable." These are the only requests that can be tested + # for the "downgrade-upgrade" scenario, so all other templates must be + # explicitly ignored. audioworklet.https.sub.html: [] element-script.sub.html: [] fetch.sub.html: [] From 1e56fa6631660334b5b1a2d6dc8b2746ff512a23 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Tue, 12 May 2020 23:13:01 -0400 Subject: [PATCH 087/127] Add tests for frames and iframes --- .../generated/element-frame.https.sub.html | 248 ++++++++++++++++++ .../metadata/generated/element-frame.sub.html | 82 ++++++ .../generated/element-iframe.https.sub.html | 248 ++++++++++++++++++ .../generated/element-iframe.sub.html | 82 ++++++ fetch/metadata/tools/fetch-metadata.conf.yml | 24 ++ .../tools/templates/element-frame.sub.html | 61 +++++ .../tools/templates/element-iframe.sub.html | 61 +++++ 7 files changed, 806 insertions(+) create mode 100644 fetch/metadata/generated/element-frame.https.sub.html create mode 100644 fetch/metadata/generated/element-frame.sub.html create mode 100644 fetch/metadata/generated/element-iframe.https.sub.html create mode 100644 fetch/metadata/generated/element-iframe.sub.html create mode 100644 fetch/metadata/tools/templates/element-frame.sub.html create mode 100644 fetch/metadata/tools/templates/element-iframe.sub.html diff --git a/fetch/metadata/generated/element-frame.https.sub.html b/fetch/metadata/generated/element-frame.https.sub.html new file mode 100644 index 00000000000000..ca89a5fb465627 --- /dev/null +++ b/fetch/metadata/generated/element-frame.https.sub.html @@ -0,0 +1,248 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/element-frame.sub.html b/fetch/metadata/generated/element-frame.sub.html new file mode 100644 index 00000000000000..f0ab8effa79da0 --- /dev/null +++ b/fetch/metadata/generated/element-frame.sub.html @@ -0,0 +1,82 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/element-iframe.https.sub.html b/fetch/metadata/generated/element-iframe.https.sub.html new file mode 100644 index 00000000000000..902fb8edeef475 --- /dev/null +++ b/fetch/metadata/generated/element-iframe.https.sub.html @@ -0,0 +1,248 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/generated/element-iframe.sub.html b/fetch/metadata/generated/element-iframe.sub.html new file mode 100644 index 00000000000000..8deda8fbca2223 --- /dev/null +++ b/fetch/metadata/generated/element-iframe.sub.html @@ -0,0 +1,82 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index b1e61b1137edf6..f4bbd0fe1792b4 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -34,6 +34,8 @@ cases: appcache-manifest.sub.https.html: [{}] element-audio.sub.html: [{}] + element-frame.sub.html: [{}] + element-iframe.sub.html: [{}] element-image.sub.html: [{}] element-script.sub.html: - {} @@ -105,6 +107,8 @@ cases: appcache-manifest.sub.https.html: [{}] audioworklet.https.sub.html: [{}] element-audio.sub.html: [{}] + element-frame.sub.html: [{}] + element-iframe.sub.html: [{}] element-image.sub.html: [{}] element-script.sub.html: - {} @@ -149,6 +153,8 @@ cases: # for the "downgrade-upgrade" scenario, so all other templates must be # explicitly ignored. audioworklet.https.sub.html: [] + element-frame.sub.html: [] + element-iframe.sub.html: [] element-script.sub.html: [] fetch.sub.html: [] font.sub.html: [] @@ -202,6 +208,10 @@ cases: elementAttrs: { crossorigin: anonymous } - expected: cors elementAttrs: { crossorigin: use-credentials } + element-frame.sub.html: + - expected: navigate + element-iframe.sub.html: + - expected: navigate element-image.sub.html: - expected: no-cors - expected: cors @@ -278,6 +288,12 @@ cases: - expected: empty element-audio.sub.html: - expected: audio + element-frame.sub.html: + # https://github.com/whatwg/html/pull/4976 + - expected: frame + element-iframe.sub.html: + # https://github.com/whatwg/html/pull/4976 + - expected: iframe element-image.sub.html: - expected: image element-script.sub.html: @@ -329,6 +345,14 @@ cases: - expected: NULL element-audio.sub.html: - expected: NULL + element-frame.sub.html: + - expected: NULL + - userActivated: TRUE + expected: ?1 + element-iframe.sub.html: + - expected: NULL + - userActivated: TRUE + expected: ?1 element-image.sub.html: - expected: NULL element-script.sub.html: diff --git a/fetch/metadata/tools/templates/element-frame.sub.html b/fetch/metadata/tools/templates/element-frame.sub.html new file mode 100644 index 00000000000000..97b19f8296d7a6 --- /dev/null +++ b/fetch/metadata/tools/templates/element-frame.sub.html @@ -0,0 +1,61 @@ + + + + + [%title%] + + + {%- if subtests|selectattr('userActivated')|list %} + + {%- endif %} + + + + + diff --git a/fetch/metadata/tools/templates/element-iframe.sub.html b/fetch/metadata/tools/templates/element-iframe.sub.html new file mode 100644 index 00000000000000..9fef7d5e6dc6b3 --- /dev/null +++ b/fetch/metadata/tools/templates/element-iframe.sub.html @@ -0,0 +1,61 @@ + + + + + [%title%] + + + {%- if subtests|selectattr('userActivated')|list %} + + {%- endif %} + + + + + From 00f7f54a55384f05ea4936bd18e9a69763b5e325 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 13 May 2020 00:21:53 -0400 Subject: [PATCH 088/127] Improve subtest title filter --- fetch/metadata/generated/element-audio.https.sub.html | 2 +- fetch/metadata/generated/element-image.https.sub.html | 2 +- fetch/metadata/generated/element-script.https.sub.html | 2 +- fetch/metadata/generated/element-video.https.sub.html | 2 +- fetch/metadata/tools/generate.py | 5 ++++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/fetch/metadata/generated/element-audio.https.sub.html b/fetch/metadata/generated/element-audio.https.sub.html index 26c8267fc4a25e..11d7116c0166a7 100644 --- a/fetch/metadata/generated/element-audio.https.sub.html +++ b/fetch/metadata/generated/element-audio.https.sub.html @@ -208,7 +208,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - attributes: crossorigin='); + }, 'sec-fetch-mode - attributes: crossorigin'); promise_test(() => { const key = '{{uuid()}}'; diff --git a/fetch/metadata/generated/element-image.https.sub.html b/fetch/metadata/generated/element-image.https.sub.html index 5755e0243c278b..14dbb0769ffd89 100644 --- a/fetch/metadata/generated/element-image.https.sub.html +++ b/fetch/metadata/generated/element-image.https.sub.html @@ -208,7 +208,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - attributes: crossorigin='); + }, 'sec-fetch-mode - attributes: crossorigin'); promise_test(() => { const key = '{{uuid()}}'; diff --git a/fetch/metadata/generated/element-script.https.sub.html b/fetch/metadata/generated/element-script.https.sub.html index 05256bb40e5a0c..bd60e4be67952b 100644 --- a/fetch/metadata/generated/element-script.https.sub.html +++ b/fetch/metadata/generated/element-script.https.sub.html @@ -397,7 +397,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - attributes: crossorigin='); + }, 'sec-fetch-mode - attributes: crossorigin'); promise_test(() => { const key = '{{uuid()}}'; diff --git a/fetch/metadata/generated/element-video.https.sub.html b/fetch/metadata/generated/element-video.https.sub.html index d65b60b2ccf88d..34c226be13e7d2 100644 --- a/fetch/metadata/generated/element-video.https.sub.html +++ b/fetch/metadata/generated/element-video.https.sub.html @@ -208,7 +208,7 @@ assert_own_property(headers, 'sec-fetch-mode'); assert_equals(headers['sec-fetch-mode'], 'cors'); }); - }, 'sec-fetch-mode - attributes: crossorigin='); + }, 'sec-fetch-mode - attributes: crossorigin'); promise_test(() => { const key = '{{uuid()}}'; diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index b75fd65cd0d053..749c33fe8e227c 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -91,7 +91,10 @@ def collection_filter(obj, title): members = [] for name, value in obj.items(): - members.append('{}={}'.format(name, value)) + if value is '': + members.append(name) + else: + members.append('{}={}'.format(name, value)) return '{}: {}'.format(title, ', '.join(members)) From f8e0bdf49d9f7e04c6912c459c26689f0b9c406f Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 13 May 2020 00:22:58 -0400 Subject: [PATCH 089/127] Add tests for anchor element --- .../generated/element-a.https.sub.html | 326 ++++++++++++++++++ fetch/metadata/generated/element-a.sub.html | 104 ++++++ fetch/metadata/tools/fetch-metadata.conf.yml | 14 + .../tools/templates/element-a.sub.html | 79 +++++ 4 files changed, 523 insertions(+) create mode 100644 fetch/metadata/generated/element-a.https.sub.html create mode 100644 fetch/metadata/generated/element-a.sub.html create mode 100644 fetch/metadata/tools/templates/element-a.sub.html diff --git a/fetch/metadata/generated/element-a.https.sub.html b/fetch/metadata/generated/element-a.https.sub.html new file mode 100644 index 00000000000000..128c562c4469c5 --- /dev/null +++ b/fetch/metadata/generated/element-a.https.sub.html @@ -0,0 +1,326 @@ + + + + + + + + + + + + + diff --git a/fetch/metadata/generated/element-a.sub.html b/fetch/metadata/generated/element-a.sub.html new file mode 100644 index 00000000000000..f8fded94dadfc2 --- /dev/null +++ b/fetch/metadata/generated/element-a.sub.html @@ -0,0 +1,104 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index f4bbd0fe1792b4..b8ea9089713f33 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -33,6 +33,7 @@ cases: worker-dedicated-constructor.sub.html: [] appcache-manifest.sub.https.html: [{}] + element-a.sub.html: [{}] element-audio.sub.html: [{}] element-frame.sub.html: [{}] element-iframe.sub.html: [{}] @@ -106,6 +107,7 @@ cases: appcache-manifest.sub.https.html: [{}] audioworklet.https.sub.html: [{}] + element-a.sub.html: [{}] element-audio.sub.html: [{}] element-frame.sub.html: [{}] element-iframe.sub.html: [{}] @@ -165,6 +167,7 @@ cases: worker-dedicated-importscripts.sub.html: [] appcache-manifest.sub.https.html: [{}] + element-a.sub.html: [{}] element-audio.sub.html: [{}] element-image.sub.html: [{}] element-video.sub.html: [{}] @@ -200,6 +203,8 @@ cases: - expected: cors cors-preflight.sub.html: - expected: cors + element-a.sub.html: + - expected: navigate element-audio.sub.html: - expected: no-cors - expected: cors @@ -286,6 +291,11 @@ cases: - expected: audioworklet cors-preflight.sub.html: - expected: empty + element-a.sub.html: + - expected: document + # https://html.spec.whatwg.org/multipage/links.html#downloading-hyperlinks + - elementAttrs: {download: ''} + expected: empty element-audio.sub.html: - expected: audio element-frame.sub.html: @@ -343,6 +353,10 @@ cases: - expected: NULL cors-preflight.sub.html: - expected: NULL + element-a.sub.html: + - expected: NULL + - userActivated: TRUE + expected: ?! element-audio.sub.html: - expected: NULL element-frame.sub.html: diff --git a/fetch/metadata/tools/templates/element-a.sub.html b/fetch/metadata/tools/templates/element-a.sub.html new file mode 100644 index 00000000000000..28a67718917dcd --- /dev/null +++ b/fetch/metadata/tools/templates/element-a.sub.html @@ -0,0 +1,79 @@ + + + + + [%title%] + + + {%- if subtests|selectattr('userActivated')|list %} + + {%- endif %} + + + + + + From 9d7d743d02ae1ae5837303f7b552c5d039dcee91 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 13 May 2020 13:24:11 -0400 Subject: [PATCH 090/127] Remove empty line --- fetch/metadata/generated/element-a.https.sub.html | 2 +- fetch/metadata/generated/element-a.sub.html | 2 +- fetch/metadata/tools/templates/element-a.sub.html | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fetch/metadata/generated/element-a.https.sub.html b/fetch/metadata/generated/element-a.https.sub.html index 128c562c4469c5..10b6607dc800aa 100644 --- a/fetch/metadata/generated/element-a.https.sub.html +++ b/fetch/metadata/generated/element-a.https.sub.html @@ -323,4 +323,4 @@ }, 'sec-fetch-user - no attributes with user activation'); - + \ No newline at end of file diff --git a/fetch/metadata/generated/element-a.sub.html b/fetch/metadata/generated/element-a.sub.html index f8fded94dadfc2..d34fe1f2f98960 100644 --- a/fetch/metadata/generated/element-a.sub.html +++ b/fetch/metadata/generated/element-a.sub.html @@ -101,4 +101,4 @@ }, 'sec-fetch-site - HTTPS downgrade-upgrade - no attributes'); - + \ No newline at end of file diff --git a/fetch/metadata/tools/templates/element-a.sub.html b/fetch/metadata/tools/templates/element-a.sub.html index 28a67718917dcd..f8d712e407c50e 100644 --- a/fetch/metadata/tools/templates/element-a.sub.html +++ b/fetch/metadata/tools/templates/element-a.sub.html @@ -76,4 +76,3 @@ - From e49f4bc3e8fdc354ab6fff090ac25a21875d6745 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 13 May 2020 13:34:41 -0400 Subject: [PATCH 091/127] Add trailing newline to generated files --- fetch/metadata/generated/appcache-manifest.https.sub.html | 2 +- fetch/metadata/generated/audioworklet.https.sub.html | 2 +- fetch/metadata/generated/cors-preflight.https.sub.html | 2 +- fetch/metadata/generated/element-a.https.sub.html | 2 +- fetch/metadata/generated/element-a.sub.html | 2 +- fetch/metadata/generated/element-audio.https.sub.html | 2 +- fetch/metadata/generated/element-audio.sub.html | 2 +- fetch/metadata/generated/element-frame.https.sub.html | 2 +- fetch/metadata/generated/element-frame.sub.html | 2 +- fetch/metadata/generated/element-iframe.https.sub.html | 2 +- fetch/metadata/generated/element-iframe.sub.html | 2 +- fetch/metadata/generated/element-image.https.sub.html | 2 +- fetch/metadata/generated/element-image.sub.html | 2 +- fetch/metadata/generated/element-script.https.sub.html | 2 +- fetch/metadata/generated/element-script.sub.html | 2 +- fetch/metadata/generated/element-video.https.sub.html | 2 +- fetch/metadata/generated/element-video.sub.html | 2 +- fetch/metadata/generated/fetch.https.sub.html | 2 +- fetch/metadata/generated/fetch.sub.html | 2 +- fetch/metadata/generated/font.https.sub.html | 2 +- fetch/metadata/generated/font.sub.html | 2 +- fetch/metadata/generated/form-submission.https.sub.html | 2 +- fetch/metadata/generated/form-submission.sub.html | 2 +- .../generated/script-module-import-dynamic.https.sub.html | 2 +- fetch/metadata/generated/script-module-import-dynamic.sub.html | 2 +- .../generated/script-module-import-static.https.sub.html | 2 +- fetch/metadata/generated/script-module-import-static.sub.html | 2 +- fetch/metadata/generated/video-poster.https.sub.html | 2 +- fetch/metadata/generated/video-poster.sub.html | 2 +- fetch/metadata/generated/window-location.https.sub.html | 2 +- fetch/metadata/generated/window-location.sub.html | 2 +- .../generated/worker-dedicated-constructor.https.sub.html | 2 +- .../generated/worker-dedicated-importscripts.https.sub.html | 2 +- .../metadata/generated/worker-dedicated-importscripts.sub.html | 2 +- fetch/metadata/tools/generate.py | 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) diff --git a/fetch/metadata/generated/appcache-manifest.https.sub.html b/fetch/metadata/generated/appcache-manifest.https.sub.html index 5d9c0a933a266d..cc547daae0e50e 100644 --- a/fetch/metadata/generated/appcache-manifest.https.sub.html +++ b/fetch/metadata/generated/appcache-manifest.https.sub.html @@ -293,4 +293,4 @@ }, 'sec-fetch-user'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/audioworklet.https.sub.html b/fetch/metadata/generated/audioworklet.https.sub.html index 021bc8f5a8b73c..7699bbf47137e0 100644 --- a/fetch/metadata/generated/audioworklet.https.sub.html +++ b/fetch/metadata/generated/audioworklet.https.sub.html @@ -211,4 +211,4 @@ }, 'sec-fetch-user'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/cors-preflight.https.sub.html b/fetch/metadata/generated/cors-preflight.https.sub.html index d68d0558ff6334..e67012f9e64757 100644 --- a/fetch/metadata/generated/cors-preflight.https.sub.html +++ b/fetch/metadata/generated/cors-preflight.https.sub.html @@ -68,4 +68,4 @@ }, 'sec-fetch-user'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/element-a.https.sub.html b/fetch/metadata/generated/element-a.https.sub.html index 10b6607dc800aa..128c562c4469c5 100644 --- a/fetch/metadata/generated/element-a.https.sub.html +++ b/fetch/metadata/generated/element-a.https.sub.html @@ -323,4 +323,4 @@ }, 'sec-fetch-user - no attributes with user activation'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/element-a.sub.html b/fetch/metadata/generated/element-a.sub.html index d34fe1f2f98960..f8fded94dadfc2 100644 --- a/fetch/metadata/generated/element-a.sub.html +++ b/fetch/metadata/generated/element-a.sub.html @@ -101,4 +101,4 @@ }, 'sec-fetch-site - HTTPS downgrade-upgrade - no attributes'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/element-audio.https.sub.html b/fetch/metadata/generated/element-audio.https.sub.html index 11d7116c0166a7..e1e053f1e17410 100644 --- a/fetch/metadata/generated/element-audio.https.sub.html +++ b/fetch/metadata/generated/element-audio.https.sub.html @@ -266,4 +266,4 @@ }, 'sec-fetch-user - no attributes'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/element-audio.sub.html b/fetch/metadata/generated/element-audio.sub.html index f4aff82a815948..a71fd7be7602fc 100644 --- a/fetch/metadata/generated/element-audio.sub.html +++ b/fetch/metadata/generated/element-audio.sub.html @@ -70,4 +70,4 @@ }, 'sec-fetch-site - HTTPS downgrade-upgrade, no attributes'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/element-frame.https.sub.html b/fetch/metadata/generated/element-frame.https.sub.html index ca89a5fb465627..bfb68e35c23bab 100644 --- a/fetch/metadata/generated/element-frame.https.sub.html +++ b/fetch/metadata/generated/element-frame.https.sub.html @@ -245,4 +245,4 @@ }, 'sec-fetch-user with user activation'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/element-frame.sub.html b/fetch/metadata/generated/element-frame.sub.html index f0ab8effa79da0..784c17ede93f7b 100644 --- a/fetch/metadata/generated/element-frame.sub.html +++ b/fetch/metadata/generated/element-frame.sub.html @@ -79,4 +79,4 @@ }, 'sec-fetch-site - HTTPS downgrade-upgrade'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/element-iframe.https.sub.html b/fetch/metadata/generated/element-iframe.https.sub.html index 902fb8edeef475..656fb17aa02f70 100644 --- a/fetch/metadata/generated/element-iframe.https.sub.html +++ b/fetch/metadata/generated/element-iframe.https.sub.html @@ -245,4 +245,4 @@ }, 'sec-fetch-user with user activation'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/element-iframe.sub.html b/fetch/metadata/generated/element-iframe.sub.html index 8deda8fbca2223..52272fccb951b7 100644 --- a/fetch/metadata/generated/element-iframe.sub.html +++ b/fetch/metadata/generated/element-iframe.sub.html @@ -79,4 +79,4 @@ }, 'sec-fetch-site - HTTPS downgrade-upgrade'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/element-image.https.sub.html b/fetch/metadata/generated/element-image.https.sub.html index 14dbb0769ffd89..e419397d7eacdf 100644 --- a/fetch/metadata/generated/element-image.https.sub.html +++ b/fetch/metadata/generated/element-image.https.sub.html @@ -266,4 +266,4 @@ }, 'sec-fetch-user - no attributes'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/element-image.sub.html b/fetch/metadata/generated/element-image.sub.html index 81e659e928b3e3..22a9b9ef346cf3 100644 --- a/fetch/metadata/generated/element-image.sub.html +++ b/fetch/metadata/generated/element-image.sub.html @@ -70,4 +70,4 @@ }, 'sec-fetch-site - HTTPS downgrade-upgrade, no attributes'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/element-script.https.sub.html b/fetch/metadata/generated/element-script.https.sub.html index bd60e4be67952b..52635cf1ee5347 100644 --- a/fetch/metadata/generated/element-script.https.sub.html +++ b/fetch/metadata/generated/element-script.https.sub.html @@ -462,4 +462,4 @@ }); }, 'sec-fetch-user - no attributes'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/element-script.sub.html b/fetch/metadata/generated/element-script.sub.html index d61f9ef7a36d7c..fd3b67493f6fe1 100644 --- a/fetch/metadata/generated/element-script.sub.html +++ b/fetch/metadata/generated/element-script.sub.html @@ -125,4 +125,4 @@ }); }, 'sec-fetch-site - HTTPS downgrade-upgrade, attributes: type=module'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/element-video.https.sub.html b/fetch/metadata/generated/element-video.https.sub.html index 34c226be13e7d2..fffd4ee53ed47f 100644 --- a/fetch/metadata/generated/element-video.https.sub.html +++ b/fetch/metadata/generated/element-video.https.sub.html @@ -266,4 +266,4 @@ }, 'sec-fetch-user - no attributes'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/element-video.sub.html b/fetch/metadata/generated/element-video.sub.html index 94ba615e7622a7..e53cf74a2b805c 100644 --- a/fetch/metadata/generated/element-video.sub.html +++ b/fetch/metadata/generated/element-video.sub.html @@ -70,4 +70,4 @@ }, 'sec-fetch-site - HTTPS downgrade-upgrade, no attributes'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/fetch.https.sub.html b/fetch/metadata/generated/fetch.https.sub.html index 222177829a4657..8d81d1eacdde66 100644 --- a/fetch/metadata/generated/fetch.https.sub.html +++ b/fetch/metadata/generated/fetch.https.sub.html @@ -243,4 +243,4 @@ }, 'sec-fetch-user - no init'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/fetch.sub.html b/fetch/metadata/generated/fetch.sub.html index 5c3d2f458c9919..9b850b7f780077 100644 --- a/fetch/metadata/generated/fetch.sub.html +++ b/fetch/metadata/generated/fetch.sub.html @@ -61,4 +61,4 @@ }, 'sec-fetch-site - HTTPS downgrade-upgrade, no init'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/font.https.sub.html b/fetch/metadata/generated/font.https.sub.html index 9c172865e9a6f8..0774d94e857653 100644 --- a/fetch/metadata/generated/font.https.sub.html +++ b/fetch/metadata/generated/font.https.sub.html @@ -204,4 +204,4 @@ }, 'sec-fetch-user'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/font.sub.html b/fetch/metadata/generated/font.sub.html index fb6d5e774662ff..0ae0f36aa5c875 100644 --- a/fetch/metadata/generated/font.sub.html +++ b/fetch/metadata/generated/font.sub.html @@ -74,4 +74,4 @@ }, 'sec-fetch-site - HTTPS downgrade-upgrade'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/form-submission.https.sub.html b/fetch/metadata/generated/form-submission.https.sub.html index 2165d73bf27b21..3a5aa6f152db75 100644 --- a/fetch/metadata/generated/form-submission.https.sub.html +++ b/fetch/metadata/generated/form-submission.https.sub.html @@ -421,4 +421,4 @@ }, 'sec-fetch-user - POST with user activation'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/form-submission.sub.html b/fetch/metadata/generated/form-submission.sub.html index baf75d71e56287..9faaa10356f491 100644 --- a/fetch/metadata/generated/form-submission.sub.html +++ b/fetch/metadata/generated/form-submission.sub.html @@ -132,4 +132,4 @@ }, 'sec-fetch-site - HTTPS downgrade-upgrade - POST'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/script-module-import-dynamic.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic.https.sub.html index 87906f87013628..1bd58f72970bbb 100644 --- a/fetch/metadata/generated/script-module-import-dynamic.https.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic.https.sub.html @@ -194,4 +194,4 @@ }); }, 'sec-fetch-user'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/script-module-import-dynamic.sub.html b/fetch/metadata/generated/script-module-import-dynamic.sub.html index 1adfe73c0df8db..b83168153638e2 100644 --- a/fetch/metadata/generated/script-module-import-dynamic.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic.sub.html @@ -54,4 +54,4 @@ }); }, 'sec-fetch-site - HTTPS downgrade-upgrade'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/script-module-import-static.https.sub.html b/fetch/metadata/generated/script-module-import-static.https.sub.html index 611e8a36e4f5f8..612da01248e8b7 100644 --- a/fetch/metadata/generated/script-module-import-static.https.sub.html +++ b/fetch/metadata/generated/script-module-import-static.https.sub.html @@ -225,4 +225,4 @@ }); }, 'sec-fetch-user'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/script-module-import-static.sub.html b/fetch/metadata/generated/script-module-import-static.sub.html index 299522b922bc45..6c1e6cde9ec002 100644 --- a/fetch/metadata/generated/script-module-import-static.sub.html +++ b/fetch/metadata/generated/script-module-import-static.sub.html @@ -75,4 +75,4 @@ }); }, 'sec-fetch-site - HTTPS downgrade-upgrade'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/video-poster.https.sub.html b/fetch/metadata/generated/video-poster.https.sub.html index a74108a194a8f0..6c20fda2a979d1 100644 --- a/fetch/metadata/generated/video-poster.https.sub.html +++ b/fetch/metadata/generated/video-poster.https.sub.html @@ -196,4 +196,4 @@ }, 'sec-fetch-user'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/video-poster.sub.html b/fetch/metadata/generated/video-poster.sub.html index af39c13ea793bd..1c9de175bd85f7 100644 --- a/fetch/metadata/generated/video-poster.sub.html +++ b/fetch/metadata/generated/video-poster.sub.html @@ -75,4 +75,4 @@ }, 'sec-fetch-site - HTTPS downgrade-upgrade'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/window-location.https.sub.html b/fetch/metadata/generated/window-location.https.sub.html index a5a0dda737a45f..70a1b5423148ad 100644 --- a/fetch/metadata/generated/window-location.https.sub.html +++ b/fetch/metadata/generated/window-location.https.sub.html @@ -940,4 +940,4 @@ }, 'sec-fetch-user - location.replace with user activation'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/window-location.sub.html b/fetch/metadata/generated/window-location.sub.html index 9065ec6771c8aa..8b46c8a1909a4c 100644 --- a/fetch/metadata/generated/window-location.sub.html +++ b/fetch/metadata/generated/window-location.sub.html @@ -219,4 +219,4 @@ }, 'sec-fetch-site - HTTPS downgrade-upgrade - location.replace'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/worker-dedicated-constructor.https.sub.html b/fetch/metadata/generated/worker-dedicated-constructor.https.sub.html index f52f2d2289d8fd..641f4f275948ef 100644 --- a/fetch/metadata/generated/worker-dedicated-constructor.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-constructor.https.sub.html @@ -114,4 +114,4 @@ }); }, 'sec-fetch-user - options: type=module'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html index 301716102733d6..37cf18b0202164 100644 --- a/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html @@ -194,4 +194,4 @@ }); }, 'sec-fetch-user'); - \ No newline at end of file + diff --git a/fetch/metadata/generated/worker-dedicated-importscripts.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts.sub.html index 67467b69964cae..c564b5877829f5 100644 --- a/fetch/metadata/generated/worker-dedicated-importscripts.sub.html +++ b/fetch/metadata/generated/worker-dedicated-importscripts.sub.html @@ -68,4 +68,4 @@ }); }, 'sec-fetch-site - HTTPS downgrade-upgrade'); - \ No newline at end of file + diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index 749c33fe8e227c..47aa2a82eaa9c9 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -168,7 +168,7 @@ def main(config_file): handle.write(templates[template_name].render( subtests=list(some_subtests), provenance=provenance - )) + ) + '\n') if __name__ == '__main__': parser = argparse.ArgumentParser() From ebbd78586051c5a8529a93a6b92c9f605c3e5485 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 13 May 2020 15:02:34 -0400 Subject: [PATCH 092/127] Refactor tests to support anchor's `download` attr --- .../generated/element-a.https.sub.html | 393 ++++++++++-------- fetch/metadata/generated/element-a.sub.html | 107 +++-- .../tools/templates/element-a.sub.html | 62 ++- 3 files changed, 299 insertions(+), 263 deletions(-) diff --git a/fetch/metadata/generated/element-a.https.sub.html b/fetch/metadata/generated/element-a.https.sub.html index 128c562c4469c5..0401c88b526541 100644 --- a/fetch/metadata/generated/element-a.https.sub.html +++ b/fetch/metadata/generated/element-a.https.sub.html @@ -16,306 +16,355 @@ diff --git a/fetch/metadata/tools/templates/element-a.sub.html b/fetch/metadata/tools/templates/element-a.sub.html index 48176df690de88..7e3b38e06d8dae 100644 --- a/fetch/metadata/tools/templates/element-a.sub.html +++ b/fetch/metadata/tools/templates/element-a.sub.html @@ -4,6 +4,9 @@ --> + {%- if subtests|length > 10 %} + + {%- endif %} [%title%] From ad92b5f08bf313e2e4bcfb7397bfd56154f2d5e9 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 13 May 2020 16:13:36 -0400 Subject: [PATCH 094/127] Improve coverage for Sec-Fetch-Mode --- .../generated/element-a.https.sub.html | 21 +++++++++++++++++++ fetch/metadata/tools/fetch-metadata.conf.yml | 3 +++ 2 files changed, 24 insertions(+) diff --git a/fetch/metadata/generated/element-a.https.sub.html b/fetch/metadata/generated/element-a.https.sub.html index cf0b2d8a5bc03a..2be8a046606a1c 100644 --- a/fetch/metadata/generated/element-a.https.sub.html +++ b/fetch/metadata/generated/element-a.https.sub.html @@ -289,6 +289,27 @@ }); }, 'sec-fetch-mode - no attributes'); + promise_test((t) => { + const key = '{{uuid()}}'; + + induceRequest( + makeRequestURL(key, [], {mime: 'text/html'}), + { + test: t, + userActivated: false, + attributes: {"download": ""} + } + ); + + // `induceRequest` does not necessarily trigger a navigation, so the Python + // handler must be polled until it has received the initial request. + return retrieve(key, {poll: true}) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'no-cors'); + }); + }, 'sec-fetch-mode - attributes: download'); + promise_test((t) => { const key = '{{uuid()}}'; diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index b8ea9089713f33..e2268a74b57194 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -205,6 +205,9 @@ cases: - expected: cors element-a.sub.html: - expected: navigate + # https://html.spec.whatwg.org/multipage/links.html#downloading-hyperlinks + - elementAttrs: {download: ''} + expected: no-cors element-audio.sub.html: - expected: no-cors - expected: cors From 4a2e89cedb77b62268f3f4099aadf6a8ed767369 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 13 May 2020 16:21:42 -0400 Subject: [PATCH 095/127] Correct expected value --- fetch/metadata/generated/element-a.https.sub.html | 2 +- fetch/metadata/tools/fetch-metadata.conf.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch/metadata/generated/element-a.https.sub.html b/fetch/metadata/generated/element-a.https.sub.html index 2be8a046606a1c..afff4701670c8b 100644 --- a/fetch/metadata/generated/element-a.https.sub.html +++ b/fetch/metadata/generated/element-a.https.sub.html @@ -389,7 +389,7 @@ return retrieve(key, {poll: true}) .then((headers) => { assert_own_property(headers, 'sec-fetch-user'); - assert_equals(headers['sec-fetch-user'], '?!'); + assert_equals(headers['sec-fetch-user'], '?1'); }); }, 'sec-fetch-user - no attributes with user activation'); diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index e2268a74b57194..ee68f93f3b620b 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -359,7 +359,7 @@ cases: element-a.sub.html: - expected: NULL - userActivated: TRUE - expected: ?! + expected: ?1 element-audio.sub.html: - expected: NULL element-frame.sub.html: From 67fc5997c338507cadaf6a78fc532cd93f377988 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 13 May 2020 16:22:14 -0400 Subject: [PATCH 096/127] Add tests for area element --- .../generated/element-area.https.sub.html | 397 ++++++++++++++++++ .../metadata/generated/element-area.sub.html | 101 +++++ fetch/metadata/tools/fetch-metadata.conf.yml | 17 + .../tools/templates/element-area.sub.html | 71 ++++ 4 files changed, 586 insertions(+) create mode 100644 fetch/metadata/generated/element-area.https.sub.html create mode 100644 fetch/metadata/generated/element-area.sub.html create mode 100644 fetch/metadata/tools/templates/element-area.sub.html diff --git a/fetch/metadata/generated/element-area.https.sub.html b/fetch/metadata/generated/element-area.https.sub.html new file mode 100644 index 00000000000000..e1d791c531591e --- /dev/null +++ b/fetch/metadata/generated/element-area.https.sub.html @@ -0,0 +1,397 @@ + + + + + + + + + + + + + + diff --git a/fetch/metadata/generated/element-area.sub.html b/fetch/metadata/generated/element-area.sub.html new file mode 100644 index 00000000000000..f3774133a2030f --- /dev/null +++ b/fetch/metadata/generated/element-area.sub.html @@ -0,0 +1,101 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index ee68f93f3b620b..4277ac3cfe5d55 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -34,6 +34,7 @@ cases: appcache-manifest.sub.https.html: [{}] element-a.sub.html: [{}] + element-area.sub.html: [{}] element-audio.sub.html: [{}] element-frame.sub.html: [{}] element-iframe.sub.html: [{}] @@ -108,6 +109,7 @@ cases: appcache-manifest.sub.https.html: [{}] audioworklet.https.sub.html: [{}] element-a.sub.html: [{}] + element-area.sub.html: [{}] element-audio.sub.html: [{}] element-frame.sub.html: [{}] element-iframe.sub.html: [{}] @@ -168,6 +170,7 @@ cases: appcache-manifest.sub.https.html: [{}] element-a.sub.html: [{}] + element-area.sub.html: [{}] element-audio.sub.html: [{}] element-image.sub.html: [{}] element-video.sub.html: [{}] @@ -208,6 +211,11 @@ cases: # https://html.spec.whatwg.org/multipage/links.html#downloading-hyperlinks - elementAttrs: {download: ''} expected: no-cors + element-area.sub.html: + - expected: navigate + # https://html.spec.whatwg.org/multipage/links.html#downloading-hyperlinks + - elementAttrs: {download: ''} + expected: no-cors element-audio.sub.html: - expected: no-cors - expected: cors @@ -299,6 +307,11 @@ cases: # https://html.spec.whatwg.org/multipage/links.html#downloading-hyperlinks - elementAttrs: {download: ''} expected: empty + element-area.sub.html: + - expected: document + # https://html.spec.whatwg.org/multipage/links.html#downloading-hyperlinks + - elementAttrs: {download: ''} + expected: empty element-audio.sub.html: - expected: audio element-frame.sub.html: @@ -360,6 +373,10 @@ cases: - expected: NULL - userActivated: TRUE expected: ?1 + element-area.sub.html: + - expected: NULL + - userActivated: TRUE + expected: ?1 element-audio.sub.html: - expected: NULL element-frame.sub.html: diff --git a/fetch/metadata/tools/templates/element-area.sub.html b/fetch/metadata/tools/templates/element-area.sub.html new file mode 100644 index 00000000000000..020d1a0ff0f0a3 --- /dev/null +++ b/fetch/metadata/tools/templates/element-area.sub.html @@ -0,0 +1,71 @@ + + + + + {%- if subtests|length > 10 %} + + {%- endif %} + [%title%] + + + {%- if subtests|selectattr('userActivated')|list %} + + {%- endif %} + + + + + From 02cde36939390fe21b89130ad9f0b54bd9212fe7 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 13 May 2020 17:35:02 -0400 Subject: [PATCH 097/127] Add tests for Refresh --- ...ement-meta-refresh.https.optional.sub.html | 224 ++++++++++++++++++ .../element-meta-refresh.optional.sub.html | 81 +++++++ fetch/metadata/tools/fetch-metadata.conf.yml | 9 + .../element-meta-refresh.optional.sub.html | 60 +++++ 4 files changed, 374 insertions(+) create mode 100644 fetch/metadata/generated/element-meta-refresh.https.optional.sub.html create mode 100644 fetch/metadata/generated/element-meta-refresh.optional.sub.html create mode 100644 fetch/metadata/tools/templates/element-meta-refresh.optional.sub.html diff --git a/fetch/metadata/generated/element-meta-refresh.https.optional.sub.html b/fetch/metadata/generated/element-meta-refresh.https.optional.sub.html new file mode 100644 index 00000000000000..eadceab2ee99dc --- /dev/null +++ b/fetch/metadata/generated/element-meta-refresh.https.optional.sub.html @@ -0,0 +1,224 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/generated/element-meta-refresh.optional.sub.html b/fetch/metadata/generated/element-meta-refresh.optional.sub.html new file mode 100644 index 00000000000000..f13e98629e61c2 --- /dev/null +++ b/fetch/metadata/generated/element-meta-refresh.optional.sub.html @@ -0,0 +1,81 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 4277ac3cfe5d55..0c766c4106b394 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -39,6 +39,7 @@ cases: element-frame.sub.html: [{}] element-iframe.sub.html: [{}] element-image.sub.html: [{}] + element-meta-refresh.optional.sub.html: [{}] element-script.sub.html: - {} - elementAttrs: { type: module } @@ -114,6 +115,7 @@ cases: element-frame.sub.html: [{}] element-iframe.sub.html: [{}] element-image.sub.html: [{}] + element-meta-refresh.optional.sub.html: [{}] element-script.sub.html: - {} - elementAttrs: { type: module } @@ -173,6 +175,7 @@ cases: element-area.sub.html: [{}] element-audio.sub.html: [{}] element-image.sub.html: [{}] + element-meta-refresh.optional.sub.html: [{}] element-video.sub.html: [{}] form-submission.sub.html: - method: GET @@ -236,6 +239,8 @@ cases: elementAttrs: { crossorigin: anonymous } - expected: cors elementAttrs: { crossorigin: use-credentials } + element-meta-refresh.optional.sub.html: + - expected: navigate element-script.sub.html: - expected: no-cors - expected: cors @@ -322,6 +327,8 @@ cases: - expected: iframe element-image.sub.html: - expected: image + element-meta-refresh.optional.sub.html: + - expected: document element-script.sub.html: - expected: script element-video.sub.html: @@ -389,6 +396,8 @@ cases: expected: ?1 element-image.sub.html: - expected: NULL + element-meta-refresh.optional.sub.html: + - expected: NULL element-script.sub.html: - expected: NULL element-video.sub.html: diff --git a/fetch/metadata/tools/templates/element-meta-refresh.optional.sub.html b/fetch/metadata/tools/templates/element-meta-refresh.optional.sub.html new file mode 100644 index 00000000000000..b9262b9db92b48 --- /dev/null +++ b/fetch/metadata/tools/templates/element-meta-refresh.optional.sub.html @@ -0,0 +1,60 @@ + + + + + [%title%] + + + + + + + From 6b2a81c1bbc3de49add2936bfcbde63da5872f90 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 13 May 2020 18:21:12 -0400 Subject: [PATCH 098/127] Add tests for Refresh header --- common/refresh.py | 11 + .../header-refresh.https.optional.sub.html | 220 ++++++++++++++++++ .../header-refresh.optional.sub.html | 77 ++++++ fetch/metadata/tools/fetch-metadata.conf.yml | 9 + .../header-refresh.optional.sub.html | 56 +++++ 5 files changed, 373 insertions(+) create mode 100644 common/refresh.py create mode 100644 fetch/metadata/generated/header-refresh.https.optional.sub.html create mode 100644 fetch/metadata/generated/header-refresh.optional.sub.html create mode 100644 fetch/metadata/tools/templates/header-refresh.optional.sub.html diff --git a/common/refresh.py b/common/refresh.py new file mode 100644 index 00000000000000..28a065d92c2721 --- /dev/null +++ b/common/refresh.py @@ -0,0 +1,11 @@ +def main(request, response): + """ + Respond with a blank HTML document and a `Refresh` header which describes + an immediate redirect to the URL specified by the requests `location` query + string parameter + """ + headers = [ + ('Content-Type', 'text/html'), + ('Refresh', '0; URL={}'.format(request.GET.first('location'))) + ] + return (200, headers, '') diff --git a/fetch/metadata/generated/header-refresh.https.optional.sub.html b/fetch/metadata/generated/header-refresh.https.optional.sub.html new file mode 100644 index 00000000000000..f4a5d41dc2f0d3 --- /dev/null +++ b/fetch/metadata/generated/header-refresh.https.optional.sub.html @@ -0,0 +1,220 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/generated/header-refresh.optional.sub.html b/fetch/metadata/generated/header-refresh.optional.sub.html new file mode 100644 index 00000000000000..e8971de44aed99 --- /dev/null +++ b/fetch/metadata/generated/header-refresh.optional.sub.html @@ -0,0 +1,77 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 0c766c4106b394..88c39ce67b91f6 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -49,6 +49,7 @@ cases: form-submission.sub.html: - method: GET - method: POST + header-refresh.optional.sub.html: [{}] window-location.sub.html: - api: location - api: location.href @@ -125,6 +126,7 @@ cases: form-submission.sub.html: - method: GET - method: POST + header-refresh.optional.sub.html: [{}] window-location.sub.html: - api: location - api: location.href @@ -180,6 +182,7 @@ cases: form-submission.sub.html: - method: GET - method: POST + header-refresh.optional.sub.html: [{}] window-location.sub.html: - api: location - api: location.href @@ -274,6 +277,8 @@ cases: expected: navigate - method: POST expected: navigate + header-refresh.optional.sub.html: + - expected: navigate window-location.sub.html: - api: location expected: navigate @@ -342,6 +347,8 @@ cases: expected: document - method: POST expected: document + header-refresh.optional.sub.html: + - expected: document window-location.sub.html: - api: location expected: document @@ -417,6 +424,8 @@ cases: - method: POST userActivated: TRUE expected: ?1 + header-refresh.optional.sub.html: + - expected: NULL window-location.sub.html: - api: location expected: NULL diff --git a/fetch/metadata/tools/templates/header-refresh.optional.sub.html b/fetch/metadata/tools/templates/header-refresh.optional.sub.html new file mode 100644 index 00000000000000..d64b784f986b1d --- /dev/null +++ b/fetch/metadata/tools/templates/header-refresh.optional.sub.html @@ -0,0 +1,56 @@ + + + + + [%title%] + + + + + + + From b0f196c0c67b8c05a30867a9da96aba175649139 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 13 May 2020 23:38:38 -0400 Subject: [PATCH 099/127] PARTIAL: Begin test for History API --- .../generated/window-history.https.sub.html | 234 ++++++++++++++++++ .../generated/window-history.sub.html | 101 ++++++++ fetch/metadata/resources/message-opener.html | 1 + fetch/metadata/tools/fetch-metadata.conf.yml | 9 + .../tools/templates/window-history.sub.html | 88 +++++++ 5 files changed, 433 insertions(+) create mode 100644 fetch/metadata/generated/window-history.https.sub.html create mode 100644 fetch/metadata/generated/window-history.sub.html create mode 100644 fetch/metadata/resources/message-opener.html create mode 100644 fetch/metadata/tools/templates/window-history.sub.html diff --git a/fetch/metadata/generated/window-history.https.sub.html b/fetch/metadata/generated/window-history.https.sub.html new file mode 100644 index 00000000000000..5e774939306489 --- /dev/null +++ b/fetch/metadata/generated/window-history.https.sub.html @@ -0,0 +1,234 @@ + + + + + + + + + + + + + diff --git a/fetch/metadata/generated/window-history.sub.html b/fetch/metadata/generated/window-history.sub.html new file mode 100644 index 00000000000000..c6275accdc4dda --- /dev/null +++ b/fetch/metadata/generated/window-history.sub.html @@ -0,0 +1,101 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/resources/message-opener.html b/fetch/metadata/resources/message-opener.html new file mode 100644 index 00000000000000..34658cba657e14 --- /dev/null +++ b/fetch/metadata/resources/message-opener.html @@ -0,0 +1 @@ + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 88c39ce67b91f6..930cacf0f1906e 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -50,6 +50,7 @@ cases: - method: GET - method: POST header-refresh.optional.sub.html: [{}] + window-history.sub.html: [{}] window-location.sub.html: - api: location - api: location.href @@ -127,6 +128,7 @@ cases: - method: GET - method: POST header-refresh.optional.sub.html: [{}] + window-history.sub.html: [{}] window-location.sub.html: - api: location - api: location.href @@ -183,6 +185,7 @@ cases: - method: GET - method: POST header-refresh.optional.sub.html: [{}] + window-history.sub.html: [{}] window-location.sub.html: - api: location - api: location.href @@ -279,6 +282,8 @@ cases: expected: navigate header-refresh.optional.sub.html: - expected: navigate + window-history.sub.html: + - expected: navigate window-location.sub.html: - api: location expected: navigate @@ -349,6 +354,8 @@ cases: expected: document header-refresh.optional.sub.html: - expected: document + window-history.sub.html: + - expected: document window-location.sub.html: - api: location expected: document @@ -426,6 +433,8 @@ cases: expected: ?1 header-refresh.optional.sub.html: - expected: NULL + window-history.sub.html: + - expected: NULL window-location.sub.html: - api: location expected: NULL diff --git a/fetch/metadata/tools/templates/window-history.sub.html b/fetch/metadata/tools/templates/window-history.sub.html new file mode 100644 index 00000000000000..0618074eb736e2 --- /dev/null +++ b/fetch/metadata/tools/templates/window-history.sub.html @@ -0,0 +1,88 @@ + + + + + {%- if subtests|length > 10 %} + + {%- endif %} + [%title%] + + + {%- if subtests|selectattr('userActivated')|list %} + + {%- endif %} + + + + + From f02045250f3edf2e75d38047e0e9daef084ecc59 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 14 May 2020 14:10:14 -0400 Subject: [PATCH 100/127] Remove faulty History tests --- .../generated/window-history.https.sub.html | 133 ------------------ .../generated/window-history.sub.html | 101 ------------- fetch/metadata/tools/fetch-metadata.conf.yml | 15 +- 3 files changed, 12 insertions(+), 237 deletions(-) delete mode 100644 fetch/metadata/generated/window-history.sub.html diff --git a/fetch/metadata/generated/window-history.https.sub.html b/fetch/metadata/generated/window-history.https.sub.html index 5e774939306489..c0c6a9a6c7411d 100644 --- a/fetch/metadata/generated/window-history.https.sub.html +++ b/fetch/metadata/generated/window-history.https.sub.html @@ -7,7 +7,6 @@ --> - @@ -63,138 +62,6 @@ <`+`/script>` }; - promise_test((t) => { - const key = '{{uuid()}}'; - const url = makeRequestURL(key, ['sameOrigin', 'crossSite', 'sameOrigin'], responseParams); - - return induceRequest(url, t, () => retrieve(key)) - .then(() => retrieve(key)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect - '); - - promise_test((t) => { - const key = '{{uuid()}}'; - const url = makeRequestURL(key, ['crossSite', 'sameOrigin'], responseParams); - - return induceRequest(url, t, () => retrieve(key)) - .then(() => retrieve(key)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same Origin - '); - - promise_test((t) => { - const key = '{{uuid()}}'; - const url = makeRequestURL(key, ['crossSite', 'sameSite'], responseParams); - - return induceRequest(url, t, () => retrieve(key)) - .then(() => retrieve(key)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Same-Site - '); - - promise_test((t) => { - const key = '{{uuid()}}'; - const url = makeRequestURL(key, ['crossSite', 'crossSite'], responseParams); - - return induceRequest(url, t, () => retrieve(key)) - .then(() => retrieve(key)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Cross-Site -> Cross-Site - '); - - promise_test((t) => { - const key = '{{uuid()}}'; - const url = makeRequestURL(key, ['sameOrigin', 'sameOrigin'], responseParams); - - return induceRequest(url, t, () => retrieve(key)) - .then(() => retrieve(key)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'same-origin'); - }); - }, 'sec-fetch-site - Same-Origin -> Same Origin - '); - - promise_test((t) => { - const key = '{{uuid()}}'; - const url = makeRequestURL(key, ['sameOrigin', 'sameSite'], responseParams); - - return induceRequest(url, t, () => retrieve(key)) - .then(() => retrieve(key)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'same-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Same-Site - '); - - promise_test((t) => { - const key = '{{uuid()}}'; - const url = makeRequestURL(key, ['sameOrigin', 'crossSite'], responseParams); - - return induceRequest(url, t, () => retrieve(key)) - .then(() => retrieve(key)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Origin -> Cross-Site - '); - - promise_test((t) => { - const key = '{{uuid()}}'; - const url = makeRequestURL(key, ['sameSite', 'sameOrigin'], responseParams); - - return induceRequest(url, t, () => retrieve(key)) - .then(() => retrieve(key)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'same-site'); - }); - }, 'sec-fetch-site - Same-Site -> Same Origin - '); - - promise_test((t) => { - const key = '{{uuid()}}'; - const url = makeRequestURL(key, ['sameSite', 'sameSite'], responseParams); - - return induceRequest(url, t, () => retrieve(key)) - .then(() => retrieve(key)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'same-site'); - }); - }, 'sec-fetch-site - Same-Site -> Same-Site - '); - - promise_test((t) => { - const key = '{{uuid()}}'; - const url = makeRequestURL(key, ['sameSite', 'crossSite'], responseParams); - - return induceRequest(url, t, () => retrieve(key)) - .then(() => retrieve(key)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - Same-Site -> Cross-Site - '); - - promise_test((t) => { - const key = '{{uuid()}}'; - const url = makeRequestURL(key, ['sameOrigin', 'httpOrigin', 'sameOrigin'], responseParams); - - return induceRequest(url, t, () => retrieve(key)) - .then(() => retrieve(key)) - .then((headers) => { - assert_own_property(headers, 'sec-fetch-site'); - assert_equals(headers['sec-fetch-site'], 'cross-site'); - }); - }, 'sec-fetch-site - HTTPS downgrade-upgrade - '); - promise_test((t) => { const key = '{{uuid()}}'; const url = makeRequestURL(key, [], responseParams); diff --git a/fetch/metadata/generated/window-history.sub.html b/fetch/metadata/generated/window-history.sub.html deleted file mode 100644 index c6275accdc4dda..00000000000000 --- a/fetch/metadata/generated/window-history.sub.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 930cacf0f1906e..ec84748cfe288e 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -23,6 +23,10 @@ cases: audioworklet.https.sub.html: [] # TODO(jugglinmike) document rationale cors-preflight.sub.html: [] + # Interstitial locations in an HTTP redirect chain are not added to the + # session history, so these requests cannot be initiated using the + # History API. + window-history.sub.html: [] # Unused # - the request mode of all "classic" worker scripts is set to # "same-origin" @@ -50,7 +54,6 @@ cases: - method: GET - method: POST header-refresh.optional.sub.html: [{}] - window-history.sub.html: [{}] window-location.sub.html: - api: location - api: location.href @@ -100,6 +103,10 @@ cases: # Unused # TODO(jugglinmike) document rationale cors-preflight.sub.html: [] + # Interstitial locations in an HTTP redirect chain are not added to the + # session history, so these requests cannot be initiated using the + # History API. + window-history.sub.html: [] # Unused # - the request mode of all "classic" worker scripts is set to # "same-origin" @@ -128,7 +135,6 @@ cases: - method: GET - method: POST header-refresh.optional.sub.html: [{}] - window-history.sub.html: [{}] window-location.sub.html: - api: location - api: location.href @@ -171,6 +177,10 @@ cases: script-module-import-static.sub.html: [] script-module-import-dynamic.sub.html: [] cors-preflight.sub.html: [] + # Interstitial locations in an HTTP redirect chain are not added to the + # session history, so these requests cannot be initiated using the + # History API. + window-history.sub.html: [] worker-dedicated-constructor.sub.html: [] worker-dedicated-importscripts.sub.html: [] @@ -185,7 +195,6 @@ cases: - method: GET - method: POST header-refresh.optional.sub.html: [{}] - window-history.sub.html: [{}] window-location.sub.html: - api: location - api: location.href From f235c9dbacb8ecf72b6b97243fb06181b027435a Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 14 May 2020 14:58:15 -0400 Subject: [PATCH 101/127] Complete tests for History navigation --- .../generated/window-history.https.sub.html | 112 ++++++++++++++---- fetch/metadata/resources/message-opener.html | 18 ++- .../tools/templates/window-history.sub.html | 85 +++++++++---- 3 files changed, 170 insertions(+), 45 deletions(-) diff --git a/fetch/metadata/generated/window-history.https.sub.html b/fetch/metadata/generated/window-history.https.sub.html index c0c6a9a6c7411d..af1c04648ec589 100644 --- a/fetch/metadata/generated/window-history.https.sub.html +++ b/fetch/metadata/generated/window-history.https.sub.html @@ -15,30 +15,59 @@ diff --git a/fetch/metadata/resources/message-opener.html b/fetch/metadata/resources/message-opener.html index 34658cba657e14..eb2af7b250b9e7 100644 --- a/fetch/metadata/resources/message-opener.html +++ b/fetch/metadata/resources/message-opener.html @@ -1 +1,17 @@ - + diff --git a/fetch/metadata/tools/templates/window-history.sub.html b/fetch/metadata/tools/templates/window-history.sub.html index 0618074eb736e2..07dd9f4577e29b 100644 --- a/fetch/metadata/tools/templates/window-history.sub.html +++ b/fetch/metadata/tools/templates/window-history.sub.html @@ -18,30 +18,59 @@ From 6047a408fdc638552f65f84366e6e1d6c11ab1ef Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 14 May 2020 15:11:23 -0400 Subject: [PATCH 102/127] Rename video poster template --- ...tml => element-video-poster.https.sub.html} | 2 +- ....sub.html => element-video-poster.sub.html} | 2 +- fetch/metadata/tools/fetch-metadata.conf.yml | 18 +++++++++--------- ....sub.html => element-video-poster.sub.html} | 0 4 files changed, 11 insertions(+), 11 deletions(-) rename fetch/metadata/generated/{video-poster.https.sub.html => element-video-poster.https.sub.html} (99%) rename fetch/metadata/generated/{video-poster.sub.html => element-video-poster.sub.html} (97%) rename fetch/metadata/tools/templates/{video-poster.sub.html => element-video-poster.sub.html} (100%) diff --git a/fetch/metadata/generated/video-poster.https.sub.html b/fetch/metadata/generated/element-video-poster.https.sub.html similarity index 99% rename from fetch/metadata/generated/video-poster.https.sub.html rename to fetch/metadata/generated/element-video-poster.https.sub.html index 6c20fda2a979d1..d017b8734b79f1 100644 --- a/fetch/metadata/generated/video-poster.https.sub.html +++ b/fetch/metadata/generated/element-video-poster.https.sub.html @@ -3,7 +3,7 @@ This test was procedurally generated. Please do not modify it directly. Sources: - fetch/metadata/tools/fetch-metadata.conf.yml -- fetch/metadata/tools/templates/video-poster.sub.html +- fetch/metadata/tools/templates/element-video-poster.sub.html --> diff --git a/fetch/metadata/generated/video-poster.sub.html b/fetch/metadata/generated/element-video-poster.sub.html similarity index 97% rename from fetch/metadata/generated/video-poster.sub.html rename to fetch/metadata/generated/element-video-poster.sub.html index 1c9de175bd85f7..06ad25e1ed5e3d 100644 --- a/fetch/metadata/generated/video-poster.sub.html +++ b/fetch/metadata/generated/element-video-poster.sub.html @@ -3,7 +3,7 @@ This test was procedurally generated. Please do not modify it directly. Sources: - fetch/metadata/tools/fetch-metadata.conf.yml -- fetch/metadata/tools/templates/video-poster.sub.html +- fetch/metadata/tools/templates/element-video-poster.sub.html --> diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index ec84748cfe288e..28a3a722241004 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -48,6 +48,7 @@ cases: - {} - elementAttrs: { type: module } element-video.sub.html: [{}] + element-video-poster.sub.html: [{}] fetch.sub.html: [{}] font.sub.html: [{}] form-submission.sub.html: @@ -61,7 +62,6 @@ cases: - api: location.replace script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] - video-poster.sub.html: [{}] worker-dedicated-importscripts.sub.html: [{}] # Sec-Fetch-Site - redirection from HTTPS @@ -129,6 +129,7 @@ cases: - {} - elementAttrs: { type: module } element-video.sub.html: [{}] + element-video-poster.sub.html: [{}] fetch.sub.html: [{ init: { mode: no-cors } }] font.sub.html: [{}] form-submission.sub.html: @@ -142,7 +143,6 @@ cases: - api: location.replace script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] - video-poster.sub.html: [{}] worker-dedicated-importscripts.sub.html: [{}] # Sec-Fetch-Site - redirection with mixed content @@ -191,6 +191,7 @@ cases: element-image.sub.html: [{}] element-meta-refresh.optional.sub.html: [{}] element-video.sub.html: [{}] + element-video-poster.sub.html: [{}] form-submission.sub.html: - method: GET - method: POST @@ -200,7 +201,6 @@ cases: - api: location.href - api: location.assign - api: location.replace - video-poster.sub.html: [{}] # Sec-Fetch-Mode # These tests are served over HTTPS so the induced requests will be both @@ -274,6 +274,8 @@ cases: elementAttrs: { crossorigin: anonymous } - expected: cors elementAttrs: { crossorigin: use-credentials } + element-video-poster.sub.html: + - expected: no-cors fetch.sub.html: - expected: cors - expected: cors @@ -306,8 +308,6 @@ cases: - expected: cors script-module-import-static.sub.html: - expected: cors - video-poster.sub.html: - - expected: no-cors worker-dedicated-constructor.sub.html: - expected: same-origin - options: { type: module } @@ -352,6 +352,8 @@ cases: - expected: script element-video.sub.html: - expected: video + element-video-poster.sub.html: + - expected: image fetch.sub.html: - expected: empty font.sub.html: @@ -378,8 +380,6 @@ cases: - expected: script script-module-import-static.sub.html: - expected: script - video-poster.sub.html: - - expected: image worker-dedicated-constructor.sub.html: - expected: worker - options: { type: module } @@ -425,6 +425,8 @@ cases: - expected: NULL element-video.sub.html: - expected: NULL + element-video-poster.sub.html: + - expected: NULL fetch.sub.html: - expected: NULL font.sub.html: @@ -469,8 +471,6 @@ cases: - expected: NULL script-module-import-static.sub.html: - expected: NULL - video-poster.sub.html: - - expected: NULL worker-dedicated-constructor.sub.html: - expected: NULL - options: { type: module } diff --git a/fetch/metadata/tools/templates/video-poster.sub.html b/fetch/metadata/tools/templates/element-video-poster.sub.html similarity index 100% rename from fetch/metadata/tools/templates/video-poster.sub.html rename to fetch/metadata/tools/templates/element-video-poster.sub.html From 92be6247fc0c314a5110a2ea0404f5f086cb1aca Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 14 May 2020 18:14:58 -0400 Subject: [PATCH 103/127] Add tests for embed element --- .../generated/element-embed.https.sub.html | 180 ++++++++++++++++++ .../metadata/generated/element-embed.sub.html | 70 +++++++ fetch/metadata/tools/fetch-metadata.conf.yml | 9 + .../tools/templates/element-embed.sub.html | 54 ++++++ 4 files changed, 313 insertions(+) create mode 100644 fetch/metadata/generated/element-embed.https.sub.html create mode 100644 fetch/metadata/generated/element-embed.sub.html create mode 100644 fetch/metadata/tools/templates/element-embed.sub.html diff --git a/fetch/metadata/generated/element-embed.https.sub.html b/fetch/metadata/generated/element-embed.https.sub.html new file mode 100644 index 00000000000000..b9f0a86997459b --- /dev/null +++ b/fetch/metadata/generated/element-embed.https.sub.html @@ -0,0 +1,180 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/generated/element-embed.sub.html b/fetch/metadata/generated/element-embed.sub.html new file mode 100644 index 00000000000000..1a28f0013c8aaf --- /dev/null +++ b/fetch/metadata/generated/element-embed.sub.html @@ -0,0 +1,70 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 28a3a722241004..faaa72653c82ad 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -40,6 +40,7 @@ cases: element-a.sub.html: [{}] element-area.sub.html: [{}] element-audio.sub.html: [{}] + element-embed.sub.html: [{}] element-frame.sub.html: [{}] element-iframe.sub.html: [{}] element-image.sub.html: [{}] @@ -121,6 +122,7 @@ cases: element-a.sub.html: [{}] element-area.sub.html: [{}] element-audio.sub.html: [{}] + element-embed.sub.html: [{}] element-frame.sub.html: [{}] element-iframe.sub.html: [{}] element-image.sub.html: [{}] @@ -169,6 +171,7 @@ cases: # for the "downgrade-upgrade" scenario, so all other templates must be # explicitly ignored. audioworklet.https.sub.html: [] + element-embed.sub.html: [] element-frame.sub.html: [] element-iframe.sub.html: [] element-script.sub.html: [] @@ -242,6 +245,8 @@ cases: elementAttrs: { crossorigin: anonymous } - expected: cors elementAttrs: { crossorigin: use-credentials } + element-embed.sub.html: + - expected: no-cors element-frame.sub.html: - expected: navigate element-iframe.sub.html: @@ -338,6 +343,8 @@ cases: expected: empty element-audio.sub.html: - expected: audio + element-embed.sub.html: + - expected: embed element-frame.sub.html: # https://github.com/whatwg/html/pull/4976 - expected: frame @@ -409,6 +416,8 @@ cases: expected: ?1 element-audio.sub.html: - expected: NULL + element-embed.sub.html: + - expected: NULL element-frame.sub.html: - expected: NULL - userActivated: TRUE diff --git a/fetch/metadata/tools/templates/element-embed.sub.html b/fetch/metadata/tools/templates/element-embed.sub.html new file mode 100644 index 00000000000000..8937f27fb288b5 --- /dev/null +++ b/fetch/metadata/tools/templates/element-embed.sub.html @@ -0,0 +1,54 @@ + + + + + [%title%] + + + + + + + From 2ac083104c527df7cb2ccbb47d36e5010070c384 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 14 May 2020 18:44:14 -0400 Subject: [PATCH 104/127] Add tests for CSS font-face --- .../css-font-face.https.sub.tentative.html | 189 ++++++++++++++++++ .../css-font-face.sub.tentative.html | 79 ++++++++ fetch/metadata/tools/fetch-metadata.conf.yml | 9 + .../css-font-face.sub.tentative.html | 63 ++++++ 4 files changed, 340 insertions(+) create mode 100644 fetch/metadata/generated/css-font-face.https.sub.tentative.html create mode 100644 fetch/metadata/generated/css-font-face.sub.tentative.html create mode 100644 fetch/metadata/tools/templates/css-font-face.sub.tentative.html diff --git a/fetch/metadata/generated/css-font-face.https.sub.tentative.html b/fetch/metadata/generated/css-font-face.https.sub.tentative.html new file mode 100644 index 00000000000000..2ebbf01a52cdd5 --- /dev/null +++ b/fetch/metadata/generated/css-font-face.https.sub.tentative.html @@ -0,0 +1,189 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/generated/css-font-face.sub.tentative.html b/fetch/metadata/generated/css-font-face.sub.tentative.html new file mode 100644 index 00000000000000..20c86ccfd45b3f --- /dev/null +++ b/fetch/metadata/generated/css-font-face.sub.tentative.html @@ -0,0 +1,79 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index faaa72653c82ad..f486a93b3a8767 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -37,6 +37,7 @@ cases: worker-dedicated-constructor.sub.html: [] appcache-manifest.sub.https.html: [{}] + css-font-face.sub.tentative.html: [{}] element-a.sub.html: [{}] element-area.sub.html: [{}] element-audio.sub.html: [{}] @@ -119,6 +120,7 @@ cases: appcache-manifest.sub.https.html: [{}] audioworklet.https.sub.html: [{}] + css-font-face.sub.tentative.html: [{}] element-a.sub.html: [{}] element-area.sub.html: [{}] element-audio.sub.html: [{}] @@ -171,6 +173,7 @@ cases: # for the "downgrade-upgrade" scenario, so all other templates must be # explicitly ignored. audioworklet.https.sub.html: [] + css-font-face.sub.tentative.html: [] element-embed.sub.html: [] element-frame.sub.html: [] element-iframe.sub.html: [] @@ -225,6 +228,8 @@ cases: audioworklet.https.sub.html: # https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-single-module-script - expected: cors + css-font-face.sub.tentative.html: + - expected: cors cors-preflight.sub.html: - expected: cors element-a.sub.html: @@ -329,6 +334,8 @@ cases: audioworklet.https.sub.html: # https://github.com/WebAudio/web-audio-api/issues/2203 - expected: audioworklet + css-font-face.sub.tentative.html: + - expected: font cors-preflight.sub.html: - expected: empty element-a.sub.html: @@ -404,6 +411,8 @@ cases: - expected: NULL audioworklet.https.sub.html: - expected: NULL + css-font-face.sub.tentative.html: + - expected: NULL cors-preflight.sub.html: - expected: NULL element-a.sub.html: diff --git a/fetch/metadata/tools/templates/css-font-face.sub.tentative.html b/fetch/metadata/tools/templates/css-font-face.sub.tentative.html new file mode 100644 index 00000000000000..bb846689b11b8e --- /dev/null +++ b/fetch/metadata/tools/templates/css-font-face.sub.tentative.html @@ -0,0 +1,63 @@ + + + + + [%title%] + + + + + + + From d33d196dd0730ded336aa0b86e262a46247db53c Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 14 May 2020 21:35:56 -0400 Subject: [PATCH 105/127] Add tests for link[rel=icon] element --- .../element-link-icon.https.sub.html | 307 ++++++++++++++++++ .../generated/element-link-icon.sub.html | 98 ++++++ fetch/metadata/tools/fetch-metadata.conf.yml | 15 + .../templates/element-link-icon.sub.html | 75 +++++ 4 files changed, 495 insertions(+) create mode 100644 fetch/metadata/generated/element-link-icon.https.sub.html create mode 100644 fetch/metadata/generated/element-link-icon.sub.html create mode 100644 fetch/metadata/tools/templates/element-link-icon.sub.html diff --git a/fetch/metadata/generated/element-link-icon.https.sub.html b/fetch/metadata/generated/element-link-icon.https.sub.html new file mode 100644 index 00000000000000..baa94a010a244b --- /dev/null +++ b/fetch/metadata/generated/element-link-icon.https.sub.html @@ -0,0 +1,307 @@ + + + + + + + + + + + + + diff --git a/fetch/metadata/generated/element-link-icon.sub.html b/fetch/metadata/generated/element-link-icon.sub.html new file mode 100644 index 00000000000000..ccaf8e9d030825 --- /dev/null +++ b/fetch/metadata/generated/element-link-icon.sub.html @@ -0,0 +1,98 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index f486a93b3a8767..5b1e926e2a8e9e 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -45,6 +45,7 @@ cases: element-frame.sub.html: [{}] element-iframe.sub.html: [{}] element-image.sub.html: [{}] + element-link-icon.sub.html: [{}] element-meta-refresh.optional.sub.html: [{}] element-script.sub.html: - {} @@ -128,6 +129,7 @@ cases: element-frame.sub.html: [{}] element-iframe.sub.html: [{}] element-image.sub.html: [{}] + element-link-icon.sub.html: [{}] element-meta-refresh.optional.sub.html: [{}] element-script.sub.html: - {} @@ -177,6 +179,7 @@ cases: element-embed.sub.html: [] element-frame.sub.html: [] element-iframe.sub.html: [] + element-link-icon.sub.html: [] element-script.sub.html: [] fetch.sub.html: [] font.sub.html: [] @@ -264,6 +267,14 @@ cases: elementAttrs: { crossorigin: anonymous } - expected: cors elementAttrs: { crossorigin: use-credentials } + element-link-icon.sub.html: + - expected: no-cors + - expected: cors + elementAttrs: { crossorigin: '' } + - expected: cors + elementAttrs: { crossorigin: anonymous } + - expected: cors + elementAttrs: { crossorigin: use-credentials } element-meta-refresh.optional.sub.html: - expected: navigate element-script.sub.html: @@ -360,6 +371,8 @@ cases: - expected: iframe element-image.sub.html: - expected: image + element-link-icon.sub.html: + - expected: empty element-meta-refresh.optional.sub.html: - expected: document element-script.sub.html: @@ -437,6 +450,8 @@ cases: expected: ?1 element-image.sub.html: - expected: NULL + element-link-icon.sub.html: + - expected: NULL element-meta-refresh.optional.sub.html: - expected: NULL element-script.sub.html: diff --git a/fetch/metadata/tools/templates/element-link-icon.sub.html b/fetch/metadata/tools/templates/element-link-icon.sub.html new file mode 100644 index 00000000000000..37cb8db572dde4 --- /dev/null +++ b/fetch/metadata/tools/templates/element-link-icon.sub.html @@ -0,0 +1,75 @@ + + + + + {%- if subtests|length > 10 %} + + {%- endif %} + [%title%] + + + + + + + From 32dc7324c6dd14d9255a51d58ea98e4d2cba235b Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 14 May 2020 22:06:54 -0400 Subject: [PATCH 106/127] Add tests for SVG image element --- .../generated/svg-image.https.sub.html | 307 ++++++++++++++++++ fetch/metadata/generated/svg-image.sub.html | 96 ++++++ fetch/metadata/tools/fetch-metadata.conf.yml | 19 ++ .../tools/templates/svg-image.sub.html | 75 +++++ 4 files changed, 497 insertions(+) create mode 100644 fetch/metadata/generated/svg-image.https.sub.html create mode 100644 fetch/metadata/generated/svg-image.sub.html create mode 100644 fetch/metadata/tools/templates/svg-image.sub.html diff --git a/fetch/metadata/generated/svg-image.https.sub.html b/fetch/metadata/generated/svg-image.https.sub.html new file mode 100644 index 00000000000000..9cba45bc22551a --- /dev/null +++ b/fetch/metadata/generated/svg-image.https.sub.html @@ -0,0 +1,307 @@ + + + + + + + + + + + + + diff --git a/fetch/metadata/generated/svg-image.sub.html b/fetch/metadata/generated/svg-image.sub.html new file mode 100644 index 00000000000000..2627636d307fbc --- /dev/null +++ b/fetch/metadata/generated/svg-image.sub.html @@ -0,0 +1,96 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 5b1e926e2a8e9e..1ee2873b4103fe 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -65,6 +65,7 @@ cases: - api: location.replace script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] + svg-image.sub.html: [{}] worker-dedicated-importscripts.sub.html: [{}] # Sec-Fetch-Site - redirection from HTTPS @@ -149,6 +150,7 @@ cases: - api: location.replace script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] + svg-image.sub.html: [{}] worker-dedicated-importscripts.sub.html: [{}] # Sec-Fetch-Site - redirection with mixed content @@ -205,6 +207,7 @@ cases: - method: GET - method: POST header-refresh.optional.sub.html: [{}] + svg-image.sub.html: [{}] window-location.sub.html: - api: location - api: location.href @@ -329,6 +332,15 @@ cases: - expected: cors script-module-import-static.sub.html: - expected: cors + # https://svgwg.org/svg2-draft/linking.html#processingURL-fetch + svg-image.sub.html: + - expected: no-cors + - expected: cors + elementAttrs: { crossorigin: '' } + - expected: cors + elementAttrs: { crossorigin: anonymous } + - expected: cors + elementAttrs: { crossorigin: use-credentials } worker-dedicated-constructor.sub.html: - expected: same-origin - options: { type: module } @@ -407,6 +419,11 @@ cases: - expected: script script-module-import-static.sub.html: - expected: script + # Implemented as "image" in Chromium and Firefox, but specified as + # "empty" + # https://github.com/w3c/svgwg/issues/782 + svg-image.sub.html: + - expected: empty worker-dedicated-constructor.sub.html: - expected: worker - options: { type: module } @@ -504,6 +521,8 @@ cases: - expected: NULL script-module-import-static.sub.html: - expected: NULL + svg-image.sub.html: + - expected: NULL worker-dedicated-constructor.sub.html: - expected: NULL - options: { type: module } diff --git a/fetch/metadata/tools/templates/svg-image.sub.html b/fetch/metadata/tools/templates/svg-image.sub.html new file mode 100644 index 00000000000000..1408a1c88c55fa --- /dev/null +++ b/fetch/metadata/tools/templates/svg-image.sub.html @@ -0,0 +1,75 @@ + + + + + {%- if subtests|length > 10 %} + + {%- endif %} + [%title%] + + + + + + + From ab82d8ccf7612771970615d22aecf8a774e213cf Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 14 May 2020 22:08:24 -0400 Subject: [PATCH 107/127] Rename template for HTML img element --- ...age.https.sub.html => element-img.https.sub.html} | 2 +- .../{element-image.sub.html => element-img.sub.html} | 2 +- fetch/metadata/tools/fetch-metadata.conf.yml | 12 ++++++------ .../{element-image.sub.html => element-img.sub.html} | 0 4 files changed, 8 insertions(+), 8 deletions(-) rename fetch/metadata/generated/{element-image.https.sub.html => element-img.https.sub.html} (99%) rename fetch/metadata/generated/{element-image.sub.html => element-img.sub.html} (97%) rename fetch/metadata/tools/templates/{element-image.sub.html => element-img.sub.html} (100%) diff --git a/fetch/metadata/generated/element-image.https.sub.html b/fetch/metadata/generated/element-img.https.sub.html similarity index 99% rename from fetch/metadata/generated/element-image.https.sub.html rename to fetch/metadata/generated/element-img.https.sub.html index e419397d7eacdf..bed8186420d43d 100644 --- a/fetch/metadata/generated/element-image.https.sub.html +++ b/fetch/metadata/generated/element-img.https.sub.html @@ -3,7 +3,7 @@ This test was procedurally generated. Please do not modify it directly. Sources: - fetch/metadata/tools/fetch-metadata.conf.yml -- fetch/metadata/tools/templates/element-image.sub.html +- fetch/metadata/tools/templates/element-img.sub.html --> diff --git a/fetch/metadata/generated/element-image.sub.html b/fetch/metadata/generated/element-img.sub.html similarity index 97% rename from fetch/metadata/generated/element-image.sub.html rename to fetch/metadata/generated/element-img.sub.html index 22a9b9ef346cf3..e33e7afb7943b5 100644 --- a/fetch/metadata/generated/element-image.sub.html +++ b/fetch/metadata/generated/element-img.sub.html @@ -3,7 +3,7 @@ This test was procedurally generated. Please do not modify it directly. Sources: - fetch/metadata/tools/fetch-metadata.conf.yml -- fetch/metadata/tools/templates/element-image.sub.html +- fetch/metadata/tools/templates/element-img.sub.html --> diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 1ee2873b4103fe..44622cfc9d939d 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -44,7 +44,7 @@ cases: element-embed.sub.html: [{}] element-frame.sub.html: [{}] element-iframe.sub.html: [{}] - element-image.sub.html: [{}] + element-img.sub.html: [{}] element-link-icon.sub.html: [{}] element-meta-refresh.optional.sub.html: [{}] element-script.sub.html: @@ -129,7 +129,7 @@ cases: element-embed.sub.html: [{}] element-frame.sub.html: [{}] element-iframe.sub.html: [{}] - element-image.sub.html: [{}] + element-img.sub.html: [{}] element-link-icon.sub.html: [{}] element-meta-refresh.optional.sub.html: [{}] element-script.sub.html: @@ -199,7 +199,7 @@ cases: element-a.sub.html: [{}] element-area.sub.html: [{}] element-audio.sub.html: [{}] - element-image.sub.html: [{}] + element-img.sub.html: [{}] element-meta-refresh.optional.sub.html: [{}] element-video.sub.html: [{}] element-video-poster.sub.html: [{}] @@ -262,7 +262,7 @@ cases: - expected: navigate element-iframe.sub.html: - expected: navigate - element-image.sub.html: + element-img.sub.html: - expected: no-cors - expected: cors elementAttrs: { crossorigin: '' } @@ -381,7 +381,7 @@ cases: element-iframe.sub.html: # https://github.com/whatwg/html/pull/4976 - expected: iframe - element-image.sub.html: + element-img.sub.html: - expected: image element-link-icon.sub.html: - expected: empty @@ -465,7 +465,7 @@ cases: - expected: NULL - userActivated: TRUE expected: ?1 - element-image.sub.html: + element-img.sub.html: - expected: NULL element-link-icon.sub.html: - expected: NULL diff --git a/fetch/metadata/tools/templates/element-image.sub.html b/fetch/metadata/tools/templates/element-img.sub.html similarity index 100% rename from fetch/metadata/tools/templates/element-image.sub.html rename to fetch/metadata/tools/templates/element-img.sub.html From e04c57e3f8213e9f895675fc7eac475efb6770cb Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 14 May 2020 22:52:05 -0400 Subject: [PATCH 108/127] Add tests for CSS background-image --- ...-background-image.https.sub.tentative.html | 213 ++++++++++++++++++ .../css-background-image.sub.tentative.html | 70 ++++++ fetch/metadata/tools/fetch-metadata.conf.yml | 9 + .../css-background-image.sub.tentative.html | 50 ++++ 4 files changed, 342 insertions(+) create mode 100644 fetch/metadata/generated/css-background-image.https.sub.tentative.html create mode 100644 fetch/metadata/generated/css-background-image.sub.tentative.html create mode 100644 fetch/metadata/tools/templates/css-background-image.sub.tentative.html diff --git a/fetch/metadata/generated/css-background-image.https.sub.tentative.html b/fetch/metadata/generated/css-background-image.https.sub.tentative.html new file mode 100644 index 00000000000000..90b46720e40e40 --- /dev/null +++ b/fetch/metadata/generated/css-background-image.https.sub.tentative.html @@ -0,0 +1,213 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/generated/css-background-image.sub.tentative.html b/fetch/metadata/generated/css-background-image.sub.tentative.html new file mode 100644 index 00000000000000..ee1fa80b3ad28d --- /dev/null +++ b/fetch/metadata/generated/css-background-image.sub.tentative.html @@ -0,0 +1,70 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 44622cfc9d939d..1fb15962c87420 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -37,6 +37,7 @@ cases: worker-dedicated-constructor.sub.html: [] appcache-manifest.sub.https.html: [{}] + css-background-image.sub.tentative.html: [{}] css-font-face.sub.tentative.html: [{}] element-a.sub.html: [{}] element-area.sub.html: [{}] @@ -122,6 +123,7 @@ cases: appcache-manifest.sub.https.html: [{}] audioworklet.https.sub.html: [{}] + css-background-image.sub.tentative.html: [{}] css-font-face.sub.tentative.html: [{}] element-a.sub.html: [{}] element-area.sub.html: [{}] @@ -196,6 +198,7 @@ cases: worker-dedicated-importscripts.sub.html: [] appcache-manifest.sub.https.html: [{}] + css-background-image.sub.tentative.html: [{}] element-a.sub.html: [{}] element-area.sub.html: [{}] element-audio.sub.html: [{}] @@ -234,6 +237,8 @@ cases: audioworklet.https.sub.html: # https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-single-module-script - expected: cors + css-background-image.sub.tentative.html: + - expected: no-cors css-font-face.sub.tentative.html: - expected: cors cors-preflight.sub.html: @@ -357,6 +362,8 @@ cases: audioworklet.https.sub.html: # https://github.com/WebAudio/web-audio-api/issues/2203 - expected: audioworklet + css-background-image.sub.tentative.html: + - expected: image css-font-face.sub.tentative.html: - expected: font cors-preflight.sub.html: @@ -441,6 +448,8 @@ cases: - expected: NULL audioworklet.https.sub.html: - expected: NULL + css-background-image.sub.tentative.html: + - expected: NULL css-font-face.sub.tentative.html: - expected: NULL cors-preflight.sub.html: diff --git a/fetch/metadata/tools/templates/css-background-image.sub.tentative.html b/fetch/metadata/tools/templates/css-background-image.sub.tentative.html new file mode 100644 index 00000000000000..13c33c0a551040 --- /dev/null +++ b/fetch/metadata/tools/templates/css-background-image.sub.tentative.html @@ -0,0 +1,50 @@ + + + + + [%title%] + + + + + + + From 3bad1d2b07112f84574fbe33be3c797505d837ce Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 14 May 2020 23:18:03 -0400 Subject: [PATCH 109/127] Relocate tentative filename flag The templates are not themselves tentative, but specific expansions may be. --- ...-background-image.https.sub.tentative.html | 2 +- .../css-background-image.sub.tentative.html | 2 +- .../css-font-face.https.sub.tentative.html | 2 +- .../css-font-face.sub.tentative.html | 2 +- fetch/metadata/tools/fetch-metadata.conf.yml | 35 ++++++++++++------- fetch/metadata/tools/generate.py | 28 ++++++++++++--- ...ive.html => css-background-image.sub.html} | 0 ....tentative.html => css-font-face.sub.html} | 0 8 files changed, 50 insertions(+), 21 deletions(-) rename fetch/metadata/tools/templates/{css-background-image.sub.tentative.html => css-background-image.sub.html} (100%) rename fetch/metadata/tools/templates/{css-font-face.sub.tentative.html => css-font-face.sub.html} (100%) diff --git a/fetch/metadata/generated/css-background-image.https.sub.tentative.html b/fetch/metadata/generated/css-background-image.https.sub.tentative.html index 90b46720e40e40..d13477e420dd10 100644 --- a/fetch/metadata/generated/css-background-image.https.sub.tentative.html +++ b/fetch/metadata/generated/css-background-image.https.sub.tentative.html @@ -3,7 +3,7 @@ This test was procedurally generated. Please do not modify it directly. Sources: - fetch/metadata/tools/fetch-metadata.conf.yml -- fetch/metadata/tools/templates/css-background-image.sub.tentative.html +- fetch/metadata/tools/templates/css-background-image.sub.html --> diff --git a/fetch/metadata/generated/css-background-image.sub.tentative.html b/fetch/metadata/generated/css-background-image.sub.tentative.html index ee1fa80b3ad28d..6fd47bb9e39dbe 100644 --- a/fetch/metadata/generated/css-background-image.sub.tentative.html +++ b/fetch/metadata/generated/css-background-image.sub.tentative.html @@ -3,7 +3,7 @@ This test was procedurally generated. Please do not modify it directly. Sources: - fetch/metadata/tools/fetch-metadata.conf.yml -- fetch/metadata/tools/templates/css-background-image.sub.tentative.html +- fetch/metadata/tools/templates/css-background-image.sub.html --> diff --git a/fetch/metadata/generated/css-font-face.https.sub.tentative.html b/fetch/metadata/generated/css-font-face.https.sub.tentative.html index 2ebbf01a52cdd5..186b5a8ef2e6ba 100644 --- a/fetch/metadata/generated/css-font-face.https.sub.tentative.html +++ b/fetch/metadata/generated/css-font-face.https.sub.tentative.html @@ -3,7 +3,7 @@ This test was procedurally generated. Please do not modify it directly. Sources: - fetch/metadata/tools/fetch-metadata.conf.yml -- fetch/metadata/tools/templates/css-font-face.sub.tentative.html +- fetch/metadata/tools/templates/css-font-face.sub.html --> diff --git a/fetch/metadata/generated/css-font-face.sub.tentative.html b/fetch/metadata/generated/css-font-face.sub.tentative.html index 20c86ccfd45b3f..b67412061cbf5b 100644 --- a/fetch/metadata/generated/css-font-face.sub.tentative.html +++ b/fetch/metadata/generated/css-font-face.sub.tentative.html @@ -3,7 +3,7 @@ This test was procedurally generated. Please do not modify it directly. Sources: - fetch/metadata/tools/fetch-metadata.conf.yml -- fetch/metadata/tools/templates/css-font-face.sub.tentative.html +- fetch/metadata/tools/templates/css-font-face.sub.html --> diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 1fb15962c87420..41d2cbb3361ccc 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -37,8 +37,10 @@ cases: worker-dedicated-constructor.sub.html: [] appcache-manifest.sub.https.html: [{}] - css-background-image.sub.tentative.html: [{}] - css-font-face.sub.tentative.html: [{}] + css-background-image.sub.html: + - filename_flags: [tentative] + css-font-face.sub.html: + - filename_flags: [tentative] element-a.sub.html: [{}] element-area.sub.html: [{}] element-audio.sub.html: [{}] @@ -123,8 +125,10 @@ cases: appcache-manifest.sub.https.html: [{}] audioworklet.https.sub.html: [{}] - css-background-image.sub.tentative.html: [{}] - css-font-face.sub.tentative.html: [{}] + css-background-image.sub.html: + - filename_flags: [tentative] + css-font-face.sub.html: + - filename_flags: [tentative] element-a.sub.html: [{}] element-area.sub.html: [{}] element-audio.sub.html: [{}] @@ -179,7 +183,7 @@ cases: # for the "downgrade-upgrade" scenario, so all other templates must be # explicitly ignored. audioworklet.https.sub.html: [] - css-font-face.sub.tentative.html: [] + css-font-face.sub.html: [] element-embed.sub.html: [] element-frame.sub.html: [] element-iframe.sub.html: [] @@ -198,7 +202,8 @@ cases: worker-dedicated-importscripts.sub.html: [] appcache-manifest.sub.https.html: [{}] - css-background-image.sub.tentative.html: [{}] + css-background-image.sub.html: + - filename_flags: [tentative] element-a.sub.html: [{}] element-area.sub.html: [{}] element-audio.sub.html: [{}] @@ -237,10 +242,12 @@ cases: audioworklet.https.sub.html: # https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-single-module-script - expected: cors - css-background-image.sub.tentative.html: + css-background-image.sub.html: - expected: no-cors - css-font-face.sub.tentative.html: + filename_flags: [tentative] + css-font-face.sub.html: - expected: cors + filename_flags: [tentative] cors-preflight.sub.html: - expected: cors element-a.sub.html: @@ -362,10 +369,12 @@ cases: audioworklet.https.sub.html: # https://github.com/WebAudio/web-audio-api/issues/2203 - expected: audioworklet - css-background-image.sub.tentative.html: + css-background-image.sub.html: - expected: image - css-font-face.sub.tentative.html: + filename_flags: [tentative] + css-font-face.sub.html: - expected: font + filename_flags: [tentative] cors-preflight.sub.html: - expected: empty element-a.sub.html: @@ -448,10 +457,12 @@ cases: - expected: NULL audioworklet.https.sub.html: - expected: NULL - css-background-image.sub.tentative.html: + css-background-image.sub.html: - expected: NULL - css-font-face.sub.tentative.html: + filename_flags: [tentative] + css-font-face.sub.html: - expected: NULL + filename_flags: [tentative] cors-preflight.sub.html: - expected: NULL element-a.sub.html: diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index 47aa2a82eaa9c9..16c8172ff551cf 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -48,6 +48,28 @@ def test_name(directory, template_name, subtest_flags): ] return os.path.join(directory, '.'.join(test_name_parts)) +def merge(a, b): + if type(a) != type(b): + raise Exception('Cannot merge disparate types') + if type(a) == list: + return [*a, *b] + if type(a) == dict: + merged = {} + + for key in a: + if key in b: + merged[key] = merge(a[key], b[key]) + else: + merged[key] = a[key] + + for key in b: + if not key in a: + merged[key] = b[key] + + return merged + + raise Exception('Cannot merge {} type'.format(type(a).__name__)) + def product(a, b): ''' Given two lists of objects, compute their Cartesian product by merging the @@ -69,11 +91,7 @@ def product(a, b): for a_object in a: for b_object in b: - merged = {} - merged.update(a_object) - merged.update(b_object) - - result.append(merged) + result.append(merge(a_object, b_object)) return result diff --git a/fetch/metadata/tools/templates/css-background-image.sub.tentative.html b/fetch/metadata/tools/templates/css-background-image.sub.html similarity index 100% rename from fetch/metadata/tools/templates/css-background-image.sub.tentative.html rename to fetch/metadata/tools/templates/css-background-image.sub.html diff --git a/fetch/metadata/tools/templates/css-font-face.sub.tentative.html b/fetch/metadata/tools/templates/css-font-face.sub.html similarity index 100% rename from fetch/metadata/tools/templates/css-font-face.sub.tentative.html rename to fetch/metadata/tools/templates/css-font-face.sub.html From 969fb7a97accbf30c6609707234f4fd81594c51e Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 14 May 2020 23:20:19 -0400 Subject: [PATCH 110/127] Update documentation --- fetch/metadata/tools/generate.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index 16c8172ff551cf..af136d170be8e6 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -80,12 +80,14 @@ def product(a, b): [{'c': 3}, {'d': 4}] ) - returns a generator which yields the following values: - - {'a': 1, 'c': 3} - {'a': 1, 'd': 4} - {'b': 2, 'c': 3} - {'b': 2, 'd': 4} + returns the following list: + + [ + {'a': 1, 'c': 3}, + {'a': 1, 'd': 4}, + {'b': 2, 'c': 3}, + {'b': 2, 'd': 4} + ] ''' result = [] From e4e45815dc4ff450cf0fda343176b4502a223f7e Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 14 May 2020 23:20:48 -0400 Subject: [PATCH 111/127] Improve example --- fetch/metadata/tools/generate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fetch/metadata/tools/generate.py b/fetch/metadata/tools/generate.py index af136d170be8e6..c483eb61ee1c05 100755 --- a/fetch/metadata/tools/generate.py +++ b/fetch/metadata/tools/generate.py @@ -77,7 +77,7 @@ def product(a, b): product( [{'a': 1}, {'b': 2}], - [{'c': 3}, {'d': 4}] + [{'c': 3}, {'d': 4}, {'e': 5}] ) returns the following list: @@ -85,8 +85,10 @@ def product(a, b): [ {'a': 1, 'c': 3}, {'a': 1, 'd': 4}, + {'a': 1, 'e': 5}, {'b': 2, 'c': 3}, - {'b': 2, 'd': 4} + {'b': 2, 'd': 4}, + {'b': 2, 'e': 5} ] ''' result = [] From e6f77cf03c1ab68b2b96a699d7443c0c2ef8aaad Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 15 May 2020 15:47:22 -0400 Subject: [PATCH 112/127] Add tests for all other CSS image sources --- ...-background-image.https.sub.tentative.html | 213 ---- .../css-background-image.sub.tentative.html | 70 -- .../css-images.https.sub.tentative.html | 1084 +++++++++++++++++ .../generated/css-images.sub.tentative.html | 258 ++++ fetch/metadata/tools/fetch-metadata.conf.yml | 12 +- .../templates/css-background-image.sub.html | 50 - .../tools/templates/css-images.sub.html | 137 +++ 7 files changed, 1485 insertions(+), 339 deletions(-) delete mode 100644 fetch/metadata/generated/css-background-image.https.sub.tentative.html delete mode 100644 fetch/metadata/generated/css-background-image.sub.tentative.html create mode 100644 fetch/metadata/generated/css-images.https.sub.tentative.html create mode 100644 fetch/metadata/generated/css-images.sub.tentative.html delete mode 100644 fetch/metadata/tools/templates/css-background-image.sub.html create mode 100644 fetch/metadata/tools/templates/css-images.sub.html diff --git a/fetch/metadata/generated/css-background-image.https.sub.tentative.html b/fetch/metadata/generated/css-background-image.https.sub.tentative.html deleted file mode 100644 index d13477e420dd10..00000000000000 --- a/fetch/metadata/generated/css-background-image.https.sub.tentative.html +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - - - - - diff --git a/fetch/metadata/generated/css-background-image.sub.tentative.html b/fetch/metadata/generated/css-background-image.sub.tentative.html deleted file mode 100644 index 6fd47bb9e39dbe..00000000000000 --- a/fetch/metadata/generated/css-background-image.sub.tentative.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - diff --git a/fetch/metadata/generated/css-images.https.sub.tentative.html b/fetch/metadata/generated/css-images.https.sub.tentative.html new file mode 100644 index 00000000000000..4f9a3c25eb8b86 --- /dev/null +++ b/fetch/metadata/generated/css-images.https.sub.tentative.html @@ -0,0 +1,1084 @@ + + + + + + + + + + + + + diff --git a/fetch/metadata/generated/css-images.sub.tentative.html b/fetch/metadata/generated/css-images.sub.tentative.html new file mode 100644 index 00000000000000..e42734f676576d --- /dev/null +++ b/fetch/metadata/generated/css-images.sub.tentative.html @@ -0,0 +1,258 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 41d2cbb3361ccc..9d62615f4f918b 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -37,7 +37,7 @@ cases: worker-dedicated-constructor.sub.html: [] appcache-manifest.sub.https.html: [{}] - css-background-image.sub.html: + css-images.sub.html: - filename_flags: [tentative] css-font-face.sub.html: - filename_flags: [tentative] @@ -125,7 +125,7 @@ cases: appcache-manifest.sub.https.html: [{}] audioworklet.https.sub.html: [{}] - css-background-image.sub.html: + css-images.sub.html: - filename_flags: [tentative] css-font-face.sub.html: - filename_flags: [tentative] @@ -202,7 +202,7 @@ cases: worker-dedicated-importscripts.sub.html: [] appcache-manifest.sub.https.html: [{}] - css-background-image.sub.html: + css-images.sub.html: - filename_flags: [tentative] element-a.sub.html: [{}] element-area.sub.html: [{}] @@ -242,7 +242,7 @@ cases: audioworklet.https.sub.html: # https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-single-module-script - expected: cors - css-background-image.sub.html: + css-images.sub.html: - expected: no-cors filename_flags: [tentative] css-font-face.sub.html: @@ -369,7 +369,7 @@ cases: audioworklet.https.sub.html: # https://github.com/WebAudio/web-audio-api/issues/2203 - expected: audioworklet - css-background-image.sub.html: + css-images.sub.html: - expected: image filename_flags: [tentative] css-font-face.sub.html: @@ -457,7 +457,7 @@ cases: - expected: NULL audioworklet.https.sub.html: - expected: NULL - css-background-image.sub.html: + css-images.sub.html: - expected: NULL filename_flags: [tentative] css-font-face.sub.html: diff --git a/fetch/metadata/tools/templates/css-background-image.sub.html b/fetch/metadata/tools/templates/css-background-image.sub.html deleted file mode 100644 index 13c33c0a551040..00000000000000 --- a/fetch/metadata/tools/templates/css-background-image.sub.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - [%title%] - - - - - - - diff --git a/fetch/metadata/tools/templates/css-images.sub.html b/fetch/metadata/tools/templates/css-images.sub.html new file mode 100644 index 00000000000000..69878905c1cb60 --- /dev/null +++ b/fetch/metadata/tools/templates/css-images.sub.html @@ -0,0 +1,137 @@ + + + + + {%- if subtests|length > 10 %} + + {%- endif %} + [%title%] + + + + + + + From 1181823deac1d52acfff90f8767e345490111899 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 15 May 2020 18:59:20 -0400 Subject: [PATCH 113/127] Add tests for img element's srcset attribute --- .../generated/element-img.https.sub.html | 294 ++++++++++++++++-- fetch/metadata/generated/element-img.sub.html | 57 +++- fetch/metadata/tools/fetch-metadata.conf.yml | 46 ++- .../tools/templates/element-img.sub.html | 7 +- 4 files changed, 368 insertions(+), 36 deletions(-) diff --git a/fetch/metadata/generated/element-img.https.sub.html b/fetch/metadata/generated/element-img.https.sub.html index bed8186420d43d..06f53536587e3a 100644 --- a/fetch/metadata/generated/element-img.https.sub.html +++ b/fetch/metadata/generated/element-img.https.sub.html @@ -15,7 +15,7 @@ diff --git a/fetch/metadata/generated/element-img.sub.html b/fetch/metadata/generated/element-img.sub.html index e33e7afb7943b5..be38ffec6c721c 100644 --- a/fetch/metadata/generated/element-img.sub.html +++ b/fetch/metadata/generated/element-img.sub.html @@ -15,7 +15,7 @@ diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 9d62615f4f918b..479998cac91ab0 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -47,7 +47,9 @@ cases: element-embed.sub.html: [{}] element-frame.sub.html: [{}] element-iframe.sub.html: [{}] - element-img.sub.html: [{}] + element-img.sub.html: + - sourceAttr: src + - sourceAttr: srcset element-link-icon.sub.html: [{}] element-meta-refresh.optional.sub.html: [{}] element-script.sub.html: @@ -135,7 +137,9 @@ cases: element-embed.sub.html: [{}] element-frame.sub.html: [{}] element-iframe.sub.html: [{}] - element-img.sub.html: [{}] + element-img.sub.html: + - sourceAttr: src + - sourceAttr: srcset element-link-icon.sub.html: [{}] element-meta-refresh.optional.sub.html: [{}] element-script.sub.html: @@ -207,7 +211,10 @@ cases: element-a.sub.html: [{}] element-area.sub.html: [{}] element-audio.sub.html: [{}] - element-img.sub.html: [{}] + element-img.sub.html: + # srcset omitted because it is not "optionally-blockable" + # https://w3c.github.io/webappsec-mixed-content/#category-optionally-blockable + - sourceAttr: src element-meta-refresh.optional.sub.html: [{}] element-video.sub.html: [{}] element-video-poster.sub.html: [{}] @@ -275,12 +282,27 @@ cases: element-iframe.sub.html: - expected: navigate element-img.sub.html: - - expected: no-cors - - expected: cors + - sourceAttr: src + expected: no-cors + - sourceAttr: src + expected: cors elementAttrs: { crossorigin: '' } - - expected: cors + - sourceAttr: src + expected: cors elementAttrs: { crossorigin: anonymous } - - expected: cors + - sourceAttr: src + expected: cors + elementAttrs: { crossorigin: use-credentials } + - sourceAttr: srcset + expected: no-cors + - sourceAttr: srcset + expected: cors + elementAttrs: { crossorigin: '' } + - sourceAttr: srcset + expected: cors + elementAttrs: { crossorigin: anonymous } + - sourceAttr: srcset + expected: cors elementAttrs: { crossorigin: use-credentials } element-link-icon.sub.html: - expected: no-cors @@ -398,7 +420,10 @@ cases: # https://github.com/whatwg/html/pull/4976 - expected: iframe element-img.sub.html: - - expected: image + - sourceAttr: src + expected: image + - sourceAttr: srcset + expected: image element-link-icon.sub.html: - expected: empty element-meta-refresh.optional.sub.html: @@ -486,7 +511,10 @@ cases: - userActivated: TRUE expected: ?1 element-img.sub.html: - - expected: NULL + - sourceAttr: src + expected: NULL + - sourceAttr: srcset + expected: NULL element-link-icon.sub.html: - expected: NULL element-meta-refresh.optional.sub.html: diff --git a/fetch/metadata/tools/templates/element-img.sub.html b/fetch/metadata/tools/templates/element-img.sub.html index 0507d6575be517..01b7b54efb3840 100644 --- a/fetch/metadata/tools/templates/element-img.sub.html +++ b/fetch/metadata/tools/templates/element-img.sub.html @@ -12,7 +12,7 @@ From 93f3ae0d4d79e981937173197c0508ec4ef0961a Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 15 May 2020 19:47:49 -0400 Subject: [PATCH 114/127] Add tests for picture element --- .../generated/element-picture.https.sub.html | 805 ++++++++++++++++++ .../generated/element-picture.sub.html | 181 ++++ fetch/metadata/tools/fetch-metadata.conf.yml | 15 + .../tools/templates/element-picture.sub.html | 101 +++ 4 files changed, 1102 insertions(+) create mode 100644 fetch/metadata/generated/element-picture.https.sub.html create mode 100644 fetch/metadata/generated/element-picture.sub.html create mode 100644 fetch/metadata/tools/templates/element-picture.sub.html diff --git a/fetch/metadata/generated/element-picture.https.sub.html b/fetch/metadata/generated/element-picture.https.sub.html new file mode 100644 index 00000000000000..a9eeb8476dde6a --- /dev/null +++ b/fetch/metadata/generated/element-picture.https.sub.html @@ -0,0 +1,805 @@ + + + + + + + + + + + + + diff --git a/fetch/metadata/generated/element-picture.sub.html b/fetch/metadata/generated/element-picture.sub.html new file mode 100644 index 00000000000000..f4d9b37b1c4ff8 --- /dev/null +++ b/fetch/metadata/generated/element-picture.sub.html @@ -0,0 +1,181 @@ + + + + + + + + + + + + + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 479998cac91ab0..c47e6b9a366fa9 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -52,6 +52,7 @@ cases: - sourceAttr: srcset element-link-icon.sub.html: [{}] element-meta-refresh.optional.sub.html: [{}] + element-picture.sub.html: [{}] element-script.sub.html: - {} - elementAttrs: { type: module } @@ -142,6 +143,7 @@ cases: - sourceAttr: srcset element-link-icon.sub.html: [{}] element-meta-refresh.optional.sub.html: [{}] + element-picture.sub.html: [{}] element-script.sub.html: - {} - elementAttrs: { type: module } @@ -195,6 +197,7 @@ cases: element-script.sub.html: [] fetch.sub.html: [] font.sub.html: [] + element-picture.sub.html: [] script-module-import-static.sub.html: [] script-module-import-dynamic.sub.html: [] cors-preflight.sub.html: [] @@ -314,6 +317,14 @@ cases: elementAttrs: { crossorigin: use-credentials } element-meta-refresh.optional.sub.html: - expected: navigate + element-picture.sub.html: + - expected: no-cors + - expected: cors + elementAttrs: { crossorigin: '' } + - expected: cors + elementAttrs: { crossorigin: anonymous } + - expected: cors + elementAttrs: { crossorigin: use-credentials } element-script.sub.html: - expected: no-cors - expected: cors @@ -428,6 +439,8 @@ cases: - expected: empty element-meta-refresh.optional.sub.html: - expected: document + element-picture.sub.html: + - expected: image element-script.sub.html: - expected: script element-video.sub.html: @@ -519,6 +532,8 @@ cases: - expected: NULL element-meta-refresh.optional.sub.html: - expected: NULL + element-picture.sub.html: + - expected: NULL element-script.sub.html: - expected: NULL element-video.sub.html: diff --git a/fetch/metadata/tools/templates/element-picture.sub.html b/fetch/metadata/tools/templates/element-picture.sub.html new file mode 100644 index 00000000000000..2b39bbfac81853 --- /dev/null +++ b/fetch/metadata/tools/templates/element-picture.sub.html @@ -0,0 +1,101 @@ + + + + + [%title%] + + + + + + + + From 31e23605e9b28da934e62920d0e2fbcb73854fd6 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 15 May 2020 19:58:30 -0400 Subject: [PATCH 115/127] Add tests for input[type=image] --- .../element-input-image.https.sub.html | 185 ++++++++++++++++++ .../generated/element-input-image.sub.html | 64 ++++++ fetch/metadata/tools/fetch-metadata.conf.yml | 9 + .../templates/element-input-image.sub.html | 48 +++++ 4 files changed, 306 insertions(+) create mode 100644 fetch/metadata/generated/element-input-image.https.sub.html create mode 100644 fetch/metadata/generated/element-input-image.sub.html create mode 100644 fetch/metadata/tools/templates/element-input-image.sub.html diff --git a/fetch/metadata/generated/element-input-image.https.sub.html b/fetch/metadata/generated/element-input-image.https.sub.html new file mode 100644 index 00000000000000..5ea5fd7298ece8 --- /dev/null +++ b/fetch/metadata/generated/element-input-image.https.sub.html @@ -0,0 +1,185 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/generated/element-input-image.sub.html b/fetch/metadata/generated/element-input-image.sub.html new file mode 100644 index 00000000000000..58d9a1177eec94 --- /dev/null +++ b/fetch/metadata/generated/element-input-image.sub.html @@ -0,0 +1,64 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index c47e6b9a366fa9..cff1d134d465c5 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -50,6 +50,7 @@ cases: element-img.sub.html: - sourceAttr: src - sourceAttr: srcset + element-input-image.sub.html: [{}] element-link-icon.sub.html: [{}] element-meta-refresh.optional.sub.html: [{}] element-picture.sub.html: [{}] @@ -141,6 +142,7 @@ cases: element-img.sub.html: - sourceAttr: src - sourceAttr: srcset + element-input-image.sub.html: [{}] element-link-icon.sub.html: [{}] element-meta-refresh.optional.sub.html: [{}] element-picture.sub.html: [{}] @@ -218,6 +220,7 @@ cases: # srcset omitted because it is not "optionally-blockable" # https://w3c.github.io/webappsec-mixed-content/#category-optionally-blockable - sourceAttr: src + element-input-image.sub.html: [{}] element-meta-refresh.optional.sub.html: [{}] element-video.sub.html: [{}] element-video-poster.sub.html: [{}] @@ -307,6 +310,8 @@ cases: - sourceAttr: srcset expected: cors elementAttrs: { crossorigin: use-credentials } + element-input-image.sub.html: + - expected: no-cors element-link-icon.sub.html: - expected: no-cors - expected: cors @@ -435,6 +440,8 @@ cases: expected: image - sourceAttr: srcset expected: image + element-input-image.sub.html: + - expected: image element-link-icon.sub.html: - expected: empty element-meta-refresh.optional.sub.html: @@ -528,6 +535,8 @@ cases: expected: NULL - sourceAttr: srcset expected: NULL + element-input-image.sub.html: + - expected: NULL element-link-icon.sub.html: - expected: NULL element-meta-refresh.optional.sub.html: diff --git a/fetch/metadata/tools/templates/element-input-image.sub.html b/fetch/metadata/tools/templates/element-input-image.sub.html new file mode 100644 index 00000000000000..832021e1cd6126 --- /dev/null +++ b/fetch/metadata/tools/templates/element-input-image.sub.html @@ -0,0 +1,48 @@ + + + + + [%title%] + + + + + + + From 884260d2d077ce4b82e1d98ce7b5091dcbf8a5b0 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 15 May 2020 21:00:22 -0400 Subject: [PATCH 116/127] fixup! Add tests for picture element --- fetch/metadata/tools/fetch-metadata.conf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index cff1d134d465c5..34084674cc995e 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -196,10 +196,10 @@ cases: element-frame.sub.html: [] element-iframe.sub.html: [] element-link-icon.sub.html: [] + element-picture.sub.html: [] element-script.sub.html: [] fetch.sub.html: [] font.sub.html: [] - element-picture.sub.html: [] script-module-import-static.sub.html: [] script-module-import-dynamic.sub.html: [] cors-preflight.sub.html: [] From 6073c84886f32d5192e1fbaad744d8d2e320897d Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 15 May 2020 21:03:33 -0400 Subject: [PATCH 117/127] Add tests for Link HTTP header --- .../generated/header-link-icon.https.sub.html | 204 ++++++++++++++++++ .../generated/header-link-icon.sub.html | 74 +++++++ fetch/metadata/resources/header-link.py | 12 ++ fetch/metadata/tools/fetch-metadata.conf.yml | 9 + .../tools/templates/header-link-icon.sub.html | 54 +++++ 5 files changed, 353 insertions(+) create mode 100644 fetch/metadata/generated/header-link-icon.https.sub.html create mode 100644 fetch/metadata/generated/header-link-icon.sub.html create mode 100644 fetch/metadata/resources/header-link.py create mode 100644 fetch/metadata/tools/templates/header-link-icon.sub.html diff --git a/fetch/metadata/generated/header-link-icon.https.sub.html b/fetch/metadata/generated/header-link-icon.https.sub.html new file mode 100644 index 00000000000000..2f0073264c1519 --- /dev/null +++ b/fetch/metadata/generated/header-link-icon.https.sub.html @@ -0,0 +1,204 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/generated/header-link-icon.sub.html b/fetch/metadata/generated/header-link-icon.sub.html new file mode 100644 index 00000000000000..b45e374dca3546 --- /dev/null +++ b/fetch/metadata/generated/header-link-icon.sub.html @@ -0,0 +1,74 @@ + + + + + + + + + + + + diff --git a/fetch/metadata/resources/header-link.py b/fetch/metadata/resources/header-link.py new file mode 100644 index 00000000000000..990dbdaa92c6d0 --- /dev/null +++ b/fetch/metadata/resources/header-link.py @@ -0,0 +1,12 @@ +def main(request, response): + """ + Respond with a blank HTML document and a `Link` header which describes + a link relation specified by the requests `location` and `rel` query string + parameters + """ + headers = [ + ('Content-Type', 'text/html'), + ('Link', '<{}>; rel={}'.format(request.GET.first('location'), request.GET.first('rel'))) + ] + return (200, headers, '') + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 34084674cc995e..98e7176f6adcfc 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -64,6 +64,7 @@ cases: form-submission.sub.html: - method: GET - method: POST + header-link-icon.sub.html: [{}] header-refresh.optional.sub.html: [{}] window-location.sub.html: - api: location @@ -156,6 +157,7 @@ cases: form-submission.sub.html: - method: GET - method: POST + header-link-icon.sub.html: [{}] header-refresh.optional.sub.html: [{}] window-location.sub.html: - api: location @@ -200,6 +202,7 @@ cases: element-script.sub.html: [] fetch.sub.html: [] font.sub.html: [] + header-link-icon.sub.html: [] script-module-import-static.sub.html: [] script-module-import-dynamic.sub.html: [] cors-preflight.sub.html: [] @@ -365,6 +368,8 @@ cases: expected: navigate - method: POST expected: navigate + header-link-icon.sub.html: + - expected: no-cors header-refresh.optional.sub.html: - expected: navigate window-history.sub.html: @@ -463,6 +468,8 @@ cases: expected: document - method: POST expected: document + header-link-icon.sub.html: + - expected: empty header-refresh.optional.sub.html: - expected: document window-history.sub.html: @@ -564,6 +571,8 @@ cases: - method: POST userActivated: TRUE expected: ?1 + header-link-icon.sub.html: + - expected: NULL header-refresh.optional.sub.html: - expected: NULL window-history.sub.html: diff --git a/fetch/metadata/tools/templates/header-link-icon.sub.html b/fetch/metadata/tools/templates/header-link-icon.sub.html new file mode 100644 index 00000000000000..bc851834de60d8 --- /dev/null +++ b/fetch/metadata/tools/templates/header-link-icon.sub.html @@ -0,0 +1,54 @@ + + + + + [%title%] + + + + + + + From d6b270b56f6a3424ddc6b93ab8327bb5af462403 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 15 May 2020 21:24:03 -0400 Subject: [PATCH 118/127] Add document titles --- fetch/metadata/generated/appcache-manifest.https.sub.html | 2 +- fetch/metadata/generated/audioworklet.https.sub.html | 2 +- fetch/metadata/generated/cors-preflight.https.sub.html | 2 +- fetch/metadata/generated/css-font-face.https.sub.tentative.html | 2 +- fetch/metadata/generated/css-font-face.sub.tentative.html | 2 +- fetch/metadata/generated/css-images.https.sub.tentative.html | 2 +- fetch/metadata/generated/css-images.sub.tentative.html | 2 +- fetch/metadata/generated/element-a.https.sub.html | 2 +- fetch/metadata/generated/element-a.sub.html | 2 +- fetch/metadata/generated/element-area.https.sub.html | 2 +- fetch/metadata/generated/element-area.sub.html | 2 +- fetch/metadata/generated/element-audio.https.sub.html | 2 +- fetch/metadata/generated/element-audio.sub.html | 2 +- fetch/metadata/generated/element-embed.https.sub.html | 2 +- fetch/metadata/generated/element-embed.sub.html | 2 +- fetch/metadata/generated/element-frame.https.sub.html | 2 +- fetch/metadata/generated/element-frame.sub.html | 2 +- fetch/metadata/generated/element-iframe.https.sub.html | 2 +- fetch/metadata/generated/element-iframe.sub.html | 2 +- fetch/metadata/generated/element-img.https.sub.html | 2 +- fetch/metadata/generated/element-img.sub.html | 2 +- fetch/metadata/generated/element-input-image.https.sub.html | 2 +- fetch/metadata/generated/element-input-image.sub.html | 2 +- fetch/metadata/generated/element-link-icon.https.sub.html | 2 +- fetch/metadata/generated/element-link-icon.sub.html | 2 +- .../generated/element-meta-refresh.https.optional.sub.html | 2 +- fetch/metadata/generated/element-meta-refresh.optional.sub.html | 2 +- fetch/metadata/generated/element-picture.https.sub.html | 2 +- fetch/metadata/generated/element-picture.sub.html | 2 +- fetch/metadata/generated/element-script.https.sub.html | 2 +- fetch/metadata/generated/element-script.sub.html | 2 +- fetch/metadata/generated/element-video-poster.https.sub.html | 2 +- fetch/metadata/generated/element-video-poster.sub.html | 2 +- fetch/metadata/generated/element-video.https.sub.html | 2 +- fetch/metadata/generated/element-video.sub.html | 2 +- fetch/metadata/generated/fetch.https.sub.html | 2 +- fetch/metadata/generated/fetch.sub.html | 2 +- fetch/metadata/generated/font.https.sub.html | 2 +- fetch/metadata/generated/font.sub.html | 2 +- fetch/metadata/generated/form-submission.https.sub.html | 2 +- fetch/metadata/generated/form-submission.sub.html | 2 +- fetch/metadata/generated/header-link-icon.https.sub.html | 2 +- fetch/metadata/generated/header-link-icon.sub.html | 2 +- fetch/metadata/generated/header-refresh.https.optional.sub.html | 2 +- fetch/metadata/generated/header-refresh.optional.sub.html | 2 +- .../generated/script-module-import-dynamic.https.sub.html | 1 + fetch/metadata/generated/script-module-import-dynamic.sub.html | 1 + .../generated/script-module-import-static.https.sub.html | 2 +- fetch/metadata/generated/script-module-import-static.sub.html | 2 +- fetch/metadata/generated/svg-image.https.sub.html | 2 +- fetch/metadata/generated/svg-image.sub.html | 2 +- fetch/metadata/generated/window-history.https.sub.html | 2 +- fetch/metadata/generated/window-location.https.sub.html | 2 +- fetch/metadata/generated/window-location.sub.html | 2 +- .../generated/worker-dedicated-constructor.https.sub.html | 1 + .../generated/worker-dedicated-importscripts.https.sub.html | 1 + .../metadata/generated/worker-dedicated-importscripts.sub.html | 1 + fetch/metadata/tools/templates/appcache-manifest.sub.https.html | 2 +- fetch/metadata/tools/templates/audioworklet.https.sub.html | 2 +- fetch/metadata/tools/templates/cors-preflight.sub.html | 2 +- fetch/metadata/tools/templates/css-font-face.sub.html | 2 +- fetch/metadata/tools/templates/css-images.sub.html | 2 +- fetch/metadata/tools/templates/element-a.sub.html | 2 +- fetch/metadata/tools/templates/element-area.sub.html | 2 +- fetch/metadata/tools/templates/element-audio.sub.html | 2 +- fetch/metadata/tools/templates/element-embed.sub.html | 2 +- fetch/metadata/tools/templates/element-frame.sub.html | 2 +- fetch/metadata/tools/templates/element-iframe.sub.html | 2 +- fetch/metadata/tools/templates/element-img.sub.html | 2 +- fetch/metadata/tools/templates/element-input-image.sub.html | 2 +- fetch/metadata/tools/templates/element-link-icon.sub.html | 2 +- .../tools/templates/element-meta-refresh.optional.sub.html | 2 +- fetch/metadata/tools/templates/element-picture.sub.html | 2 +- fetch/metadata/tools/templates/element-script.sub.html | 2 +- fetch/metadata/tools/templates/element-video-poster.sub.html | 2 +- fetch/metadata/tools/templates/element-video.sub.html | 2 +- fetch/metadata/tools/templates/fetch.sub.html | 2 +- fetch/metadata/tools/templates/font.sub.html | 2 +- fetch/metadata/tools/templates/form-submission.sub.html | 2 +- fetch/metadata/tools/templates/header-link-icon.sub.html | 2 +- fetch/metadata/tools/templates/header-refresh.optional.sub.html | 2 +- .../tools/templates/script-module-import-dynamic.sub.html | 1 + .../tools/templates/script-module-import-static.sub.html | 2 +- fetch/metadata/tools/templates/svg-image.sub.html | 2 +- fetch/metadata/tools/templates/window-history.sub.html | 2 +- fetch/metadata/tools/templates/window-location.sub.html | 2 +- .../tools/templates/worker-dedicated-constructor.sub.html | 1 + .../tools/templates/worker-dedicated-importscripts.sub.html | 1 + 88 files changed, 88 insertions(+), 80 deletions(-) diff --git a/fetch/metadata/generated/appcache-manifest.https.sub.html b/fetch/metadata/generated/appcache-manifest.https.sub.html index cc547daae0e50e..1250220cdd4515 100644 --- a/fetch/metadata/generated/appcache-manifest.https.sub.html +++ b/fetch/metadata/generated/appcache-manifest.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for Appcache manifest diff --git a/fetch/metadata/generated/audioworklet.https.sub.html b/fetch/metadata/generated/audioworklet.https.sub.html index 7699bbf47137e0..a821fe073ec775 100644 --- a/fetch/metadata/generated/audioworklet.https.sub.html +++ b/fetch/metadata/generated/audioworklet.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for AudioWorklet module diff --git a/fetch/metadata/generated/cors-preflight.https.sub.html b/fetch/metadata/generated/cors-preflight.https.sub.html index e67012f9e64757..545516a05703f4 100644 --- a/fetch/metadata/generated/cors-preflight.https.sub.html +++ b/fetch/metadata/generated/cors-preflight.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on CORS preflight request diff --git a/fetch/metadata/generated/css-font-face.https.sub.tentative.html b/fetch/metadata/generated/css-font-face.https.sub.tentative.html index 186b5a8ef2e6ba..6e8a919904bcad 100644 --- a/fetch/metadata/generated/css-font-face.https.sub.tentative.html +++ b/fetch/metadata/generated/css-font-face.https.sub.tentative.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for CSS font-face diff --git a/fetch/metadata/generated/css-font-face.sub.tentative.html b/fetch/metadata/generated/css-font-face.sub.tentative.html index b67412061cbf5b..f9f5e7a889c904 100644 --- a/fetch/metadata/generated/css-font-face.sub.tentative.html +++ b/fetch/metadata/generated/css-font-face.sub.tentative.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for CSS font-face diff --git a/fetch/metadata/generated/css-images.https.sub.tentative.html b/fetch/metadata/generated/css-images.https.sub.tentative.html index 4f9a3c25eb8b86..a4d5aab19987a2 100644 --- a/fetch/metadata/generated/css-images.https.sub.tentative.html +++ b/fetch/metadata/generated/css-images.https.sub.tentative.html @@ -8,7 +8,7 @@ - + HTTP headers on request for CSS image-accepting properties diff --git a/fetch/metadata/generated/css-images.sub.tentative.html b/fetch/metadata/generated/css-images.sub.tentative.html index e42734f676576d..f9677aae1cb27f 100644 --- a/fetch/metadata/generated/css-images.sub.tentative.html +++ b/fetch/metadata/generated/css-images.sub.tentative.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for CSS image-accepting properties diff --git a/fetch/metadata/generated/element-a.https.sub.html b/fetch/metadata/generated/element-a.https.sub.html index afff4701670c8b..6e2c6d7a7a429f 100644 --- a/fetch/metadata/generated/element-a.https.sub.html +++ b/fetch/metadata/generated/element-a.https.sub.html @@ -8,7 +8,7 @@ - + HTTP headers on request for HTML "a" element navigation diff --git a/fetch/metadata/generated/element-a.sub.html b/fetch/metadata/generated/element-a.sub.html index 87b90d06e1afe6..227e3eff1c9f3a 100644 --- a/fetch/metadata/generated/element-a.sub.html +++ b/fetch/metadata/generated/element-a.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "a" element navigation diff --git a/fetch/metadata/generated/element-area.https.sub.html b/fetch/metadata/generated/element-area.https.sub.html index e1d791c531591e..e1a1574e632ac5 100644 --- a/fetch/metadata/generated/element-area.https.sub.html +++ b/fetch/metadata/generated/element-area.https.sub.html @@ -8,7 +8,7 @@ - + HTTP headers on request for HTML "area" element navigation diff --git a/fetch/metadata/generated/element-area.sub.html b/fetch/metadata/generated/element-area.sub.html index f3774133a2030f..1efb75bf70d733 100644 --- a/fetch/metadata/generated/element-area.sub.html +++ b/fetch/metadata/generated/element-area.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "area" element navigation diff --git a/fetch/metadata/generated/element-audio.https.sub.html b/fetch/metadata/generated/element-audio.https.sub.html index e1e053f1e17410..273430671b937e 100644 --- a/fetch/metadata/generated/element-audio.https.sub.html +++ b/fetch/metadata/generated/element-audio.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "audio" element source diff --git a/fetch/metadata/generated/element-audio.sub.html b/fetch/metadata/generated/element-audio.sub.html index a71fd7be7602fc..9938f033e0637b 100644 --- a/fetch/metadata/generated/element-audio.sub.html +++ b/fetch/metadata/generated/element-audio.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "audio" element source diff --git a/fetch/metadata/generated/element-embed.https.sub.html b/fetch/metadata/generated/element-embed.https.sub.html index b9f0a86997459b..d234bf2e40195e 100644 --- a/fetch/metadata/generated/element-embed.https.sub.html +++ b/fetch/metadata/generated/element-embed.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "embed" element source diff --git a/fetch/metadata/generated/element-embed.sub.html b/fetch/metadata/generated/element-embed.sub.html index 1a28f0013c8aaf..18313a823cdb97 100644 --- a/fetch/metadata/generated/element-embed.sub.html +++ b/fetch/metadata/generated/element-embed.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "embed" element source diff --git a/fetch/metadata/generated/element-frame.https.sub.html b/fetch/metadata/generated/element-frame.https.sub.html index bfb68e35c23bab..2ab90f9f22fdda 100644 --- a/fetch/metadata/generated/element-frame.https.sub.html +++ b/fetch/metadata/generated/element-frame.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "frame" element source diff --git a/fetch/metadata/generated/element-frame.sub.html b/fetch/metadata/generated/element-frame.sub.html index 784c17ede93f7b..49ae054005eec1 100644 --- a/fetch/metadata/generated/element-frame.sub.html +++ b/fetch/metadata/generated/element-frame.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "frame" element source diff --git a/fetch/metadata/generated/element-iframe.https.sub.html b/fetch/metadata/generated/element-iframe.https.sub.html index 656fb17aa02f70..b73efbb3ad81c1 100644 --- a/fetch/metadata/generated/element-iframe.https.sub.html +++ b/fetch/metadata/generated/element-iframe.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "frame" element source diff --git a/fetch/metadata/generated/element-iframe.sub.html b/fetch/metadata/generated/element-iframe.sub.html index 52272fccb951b7..5d114c62a3d09f 100644 --- a/fetch/metadata/generated/element-iframe.sub.html +++ b/fetch/metadata/generated/element-iframe.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "frame" element source diff --git a/fetch/metadata/generated/element-img.https.sub.html b/fetch/metadata/generated/element-img.https.sub.html index 06f53536587e3a..d4f0977a094792 100644 --- a/fetch/metadata/generated/element-img.https.sub.html +++ b/fetch/metadata/generated/element-img.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "img" element source diff --git a/fetch/metadata/generated/element-img.sub.html b/fetch/metadata/generated/element-img.sub.html index be38ffec6c721c..230167fc2e6375 100644 --- a/fetch/metadata/generated/element-img.sub.html +++ b/fetch/metadata/generated/element-img.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "img" element source diff --git a/fetch/metadata/generated/element-input-image.https.sub.html b/fetch/metadata/generated/element-input-image.https.sub.html index 5ea5fd7298ece8..cf55e4aee52218 100644 --- a/fetch/metadata/generated/element-input-image.https.sub.html +++ b/fetch/metadata/generated/element-input-image.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "input" element with type="button" diff --git a/fetch/metadata/generated/element-input-image.sub.html b/fetch/metadata/generated/element-input-image.sub.html index 58d9a1177eec94..d21f9cb9ba2168 100644 --- a/fetch/metadata/generated/element-input-image.sub.html +++ b/fetch/metadata/generated/element-input-image.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "input" element with type="button" diff --git a/fetch/metadata/generated/element-link-icon.https.sub.html b/fetch/metadata/generated/element-link-icon.https.sub.html index baa94a010a244b..7e4c148b53f80f 100644 --- a/fetch/metadata/generated/element-link-icon.https.sub.html +++ b/fetch/metadata/generated/element-link-icon.https.sub.html @@ -8,7 +8,7 @@ - + HTTP headers on request for HTML "link" element with rel="icon" diff --git a/fetch/metadata/generated/element-link-icon.sub.html b/fetch/metadata/generated/element-link-icon.sub.html index ccaf8e9d030825..e7d2a30c3df283 100644 --- a/fetch/metadata/generated/element-link-icon.sub.html +++ b/fetch/metadata/generated/element-link-icon.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "link" element with rel="icon" diff --git a/fetch/metadata/generated/element-meta-refresh.https.optional.sub.html b/fetch/metadata/generated/element-meta-refresh.https.optional.sub.html index eadceab2ee99dc..fe3999adec6375 100644 --- a/fetch/metadata/generated/element-meta-refresh.https.optional.sub.html +++ b/fetch/metadata/generated/element-meta-refresh.https.optional.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "meta" element with http-equiv="refresh" diff --git a/fetch/metadata/generated/element-meta-refresh.optional.sub.html b/fetch/metadata/generated/element-meta-refresh.optional.sub.html index f13e98629e61c2..72a7070d3c2b40 100644 --- a/fetch/metadata/generated/element-meta-refresh.optional.sub.html +++ b/fetch/metadata/generated/element-meta-refresh.optional.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "meta" element with http-equiv="refresh" diff --git a/fetch/metadata/generated/element-picture.https.sub.html b/fetch/metadata/generated/element-picture.https.sub.html index a9eeb8476dde6a..392cab61e75ffa 100644 --- a/fetch/metadata/generated/element-picture.https.sub.html +++ b/fetch/metadata/generated/element-picture.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "picture" element source diff --git a/fetch/metadata/generated/element-picture.sub.html b/fetch/metadata/generated/element-picture.sub.html index f4d9b37b1c4ff8..db9796374e3343 100644 --- a/fetch/metadata/generated/element-picture.sub.html +++ b/fetch/metadata/generated/element-picture.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "picture" element source diff --git a/fetch/metadata/generated/element-script.https.sub.html b/fetch/metadata/generated/element-script.https.sub.html index 52635cf1ee5347..6f89e014d676f6 100644 --- a/fetch/metadata/generated/element-script.https.sub.html +++ b/fetch/metadata/generated/element-script.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "script" element source diff --git a/fetch/metadata/generated/element-script.sub.html b/fetch/metadata/generated/element-script.sub.html index fd3b67493f6fe1..6b4d86ff99c9be 100644 --- a/fetch/metadata/generated/element-script.sub.html +++ b/fetch/metadata/generated/element-script.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "script" element source diff --git a/fetch/metadata/generated/element-video-poster.https.sub.html b/fetch/metadata/generated/element-video-poster.https.sub.html index d017b8734b79f1..d70dfe468cf46b 100644 --- a/fetch/metadata/generated/element-video-poster.https.sub.html +++ b/fetch/metadata/generated/element-video-poster.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "video" element "poster" diff --git a/fetch/metadata/generated/element-video-poster.sub.html b/fetch/metadata/generated/element-video-poster.sub.html index 06ad25e1ed5e3d..e4304b0560a05d 100644 --- a/fetch/metadata/generated/element-video-poster.sub.html +++ b/fetch/metadata/generated/element-video-poster.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "video" element "poster" diff --git a/fetch/metadata/generated/element-video.https.sub.html b/fetch/metadata/generated/element-video.https.sub.html index fffd4ee53ed47f..169d7c5b57c741 100644 --- a/fetch/metadata/generated/element-video.https.sub.html +++ b/fetch/metadata/generated/element-video.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "video" element source diff --git a/fetch/metadata/generated/element-video.sub.html b/fetch/metadata/generated/element-video.sub.html index e53cf74a2b805c..9db9189bb3b896 100644 --- a/fetch/metadata/generated/element-video.sub.html +++ b/fetch/metadata/generated/element-video.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML "video" element source diff --git a/fetch/metadata/generated/fetch.https.sub.html b/fetch/metadata/generated/fetch.https.sub.html index 8d81d1eacdde66..41488a047aefca 100644 --- a/fetch/metadata/generated/fetch.https.sub.html +++ b/fetch/metadata/generated/fetch.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request using the "fetch" API diff --git a/fetch/metadata/generated/fetch.sub.html b/fetch/metadata/generated/fetch.sub.html index 9b850b7f780077..affb8e65b8d63b 100644 --- a/fetch/metadata/generated/fetch.sub.html +++ b/fetch/metadata/generated/fetch.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request using the "fetch" API diff --git a/fetch/metadata/generated/font.https.sub.html b/fetch/metadata/generated/font.https.sub.html index 0774d94e857653..feaa7862136551 100644 --- a/fetch/metadata/generated/font.https.sub.html +++ b/fetch/metadata/generated/font.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for CSS font-face diff --git a/fetch/metadata/generated/font.sub.html b/fetch/metadata/generated/font.sub.html index 0ae0f36aa5c875..ae18a6986e3d20 100644 --- a/fetch/metadata/generated/font.sub.html +++ b/fetch/metadata/generated/font.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for CSS font-face diff --git a/fetch/metadata/generated/form-submission.https.sub.html b/fetch/metadata/generated/form-submission.https.sub.html index 3a5aa6f152db75..8da1407a5641da 100644 --- a/fetch/metadata/generated/form-submission.https.sub.html +++ b/fetch/metadata/generated/form-submission.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML form navigation diff --git a/fetch/metadata/generated/form-submission.sub.html b/fetch/metadata/generated/form-submission.sub.html index 9faaa10356f491..466f04ad3a4580 100644 --- a/fetch/metadata/generated/form-submission.sub.html +++ b/fetch/metadata/generated/form-submission.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTML form navigation diff --git a/fetch/metadata/generated/header-link-icon.https.sub.html b/fetch/metadata/generated/header-link-icon.https.sub.html index 2f0073264c1519..a06d9e73be317a 100644 --- a/fetch/metadata/generated/header-link-icon.https.sub.html +++ b/fetch/metadata/generated/header-link-icon.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTTP "Link" header (rel="icon") diff --git a/fetch/metadata/generated/header-link-icon.sub.html b/fetch/metadata/generated/header-link-icon.sub.html index b45e374dca3546..0d50e9e4131b02 100644 --- a/fetch/metadata/generated/header-link-icon.sub.html +++ b/fetch/metadata/generated/header-link-icon.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTTP "Link" header (rel="icon") diff --git a/fetch/metadata/generated/header-refresh.https.optional.sub.html b/fetch/metadata/generated/header-refresh.https.optional.sub.html index f4a5d41dc2f0d3..2ab80e75e99c3c 100644 --- a/fetch/metadata/generated/header-refresh.https.optional.sub.html +++ b/fetch/metadata/generated/header-refresh.https.optional.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTTP "Refresh" header diff --git a/fetch/metadata/generated/header-refresh.optional.sub.html b/fetch/metadata/generated/header-refresh.optional.sub.html index e8971de44aed99..5cfd613865454e 100644 --- a/fetch/metadata/generated/header-refresh.optional.sub.html +++ b/fetch/metadata/generated/header-refresh.optional.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for HTTP "Refresh" header diff --git a/fetch/metadata/generated/script-module-import-dynamic.https.sub.html b/fetch/metadata/generated/script-module-import-dynamic.https.sub.html index 1bd58f72970bbb..85ee071c644ad5 100644 --- a/fetch/metadata/generated/script-module-import-dynamic.https.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic.https.sub.html @@ -7,6 +7,7 @@ --> + HTTP headers on request for dynamic ECMAScript module import diff --git a/fetch/metadata/generated/script-module-import-dynamic.sub.html b/fetch/metadata/generated/script-module-import-dynamic.sub.html index b83168153638e2..b1fd9fd6805482 100644 --- a/fetch/metadata/generated/script-module-import-dynamic.sub.html +++ b/fetch/metadata/generated/script-module-import-dynamic.sub.html @@ -7,6 +7,7 @@ --> + HTTP headers on request for dynamic ECMAScript module import diff --git a/fetch/metadata/generated/script-module-import-static.https.sub.html b/fetch/metadata/generated/script-module-import-static.https.sub.html index 612da01248e8b7..1880badf38596c 100644 --- a/fetch/metadata/generated/script-module-import-static.https.sub.html +++ b/fetch/metadata/generated/script-module-import-static.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for static ECMAScript module import diff --git a/fetch/metadata/generated/script-module-import-static.sub.html b/fetch/metadata/generated/script-module-import-static.sub.html index 6c1e6cde9ec002..b1b7910c16ec31 100644 --- a/fetch/metadata/generated/script-module-import-static.sub.html +++ b/fetch/metadata/generated/script-module-import-static.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for static ECMAScript module import diff --git a/fetch/metadata/generated/svg-image.https.sub.html b/fetch/metadata/generated/svg-image.https.sub.html index 9cba45bc22551a..af8cd6e149b686 100644 --- a/fetch/metadata/generated/svg-image.https.sub.html +++ b/fetch/metadata/generated/svg-image.https.sub.html @@ -8,7 +8,7 @@ - + HTTP headers on request for SVG "image" element source diff --git a/fetch/metadata/generated/svg-image.sub.html b/fetch/metadata/generated/svg-image.sub.html index 2627636d307fbc..9446cdea5ad7a9 100644 --- a/fetch/metadata/generated/svg-image.sub.html +++ b/fetch/metadata/generated/svg-image.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for SVG "image" element source diff --git a/fetch/metadata/generated/window-history.https.sub.html b/fetch/metadata/generated/window-history.https.sub.html index af1c04648ec589..85327d73b9db23 100644 --- a/fetch/metadata/generated/window-history.https.sub.html +++ b/fetch/metadata/generated/window-history.https.sub.html @@ -7,7 +7,7 @@ --> - + HTTP headers on request for navigation via the HTML History API diff --git a/fetch/metadata/generated/window-location.https.sub.html b/fetch/metadata/generated/window-location.https.sub.html index 70a1b5423148ad..16699d7465744f 100644 --- a/fetch/metadata/generated/window-location.https.sub.html +++ b/fetch/metadata/generated/window-location.https.sub.html @@ -8,7 +8,7 @@ - + HTTP headers on request for navigation via the HTML Location API diff --git a/fetch/metadata/generated/window-location.sub.html b/fetch/metadata/generated/window-location.sub.html index 8b46c8a1909a4c..334805cd9a8b7b 100644 --- a/fetch/metadata/generated/window-location.sub.html +++ b/fetch/metadata/generated/window-location.sub.html @@ -8,7 +8,7 @@ - + HTTP headers on request for navigation via the HTML Location API diff --git a/fetch/metadata/generated/worker-dedicated-constructor.https.sub.html b/fetch/metadata/generated/worker-dedicated-constructor.https.sub.html index 641f4f275948ef..8d53b916f82983 100644 --- a/fetch/metadata/generated/worker-dedicated-constructor.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-constructor.https.sub.html @@ -7,6 +7,7 @@ --> + HTTP headers on request for dedicated worker via the "Worker" constructor diff --git a/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html index 37cf18b0202164..5f53fa2ba27d32 100644 --- a/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html @@ -7,6 +7,7 @@ --> + HTTP headers on request for dedicated worker via the "importScripts" API diff --git a/fetch/metadata/generated/worker-dedicated-importscripts.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts.sub.html index c564b5877829f5..58503a5475ddc2 100644 --- a/fetch/metadata/generated/worker-dedicated-importscripts.sub.html +++ b/fetch/metadata/generated/worker-dedicated-importscripts.sub.html @@ -7,6 +7,7 @@ --> + HTTP headers on request for dedicated worker via the "importScripts" API diff --git a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html index 5d264c28599a77..0aed6e8729774d 100644 --- a/fetch/metadata/tools/templates/appcache-manifest.sub.https.html +++ b/fetch/metadata/tools/templates/appcache-manifest.sub.https.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for Appcache manifest diff --git a/fetch/metadata/tools/templates/audioworklet.https.sub.html b/fetch/metadata/tools/templates/audioworklet.https.sub.html index 9ab592857aaffd..1fdc7b4859059e 100644 --- a/fetch/metadata/tools/templates/audioworklet.https.sub.html +++ b/fetch/metadata/tools/templates/audioworklet.https.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for AudioWorklet module diff --git a/fetch/metadata/tools/templates/cors-preflight.sub.html b/fetch/metadata/tools/templates/cors-preflight.sub.html index ee8478924fc513..b5b4edfa13758b 100644 --- a/fetch/metadata/tools/templates/cors-preflight.sub.html +++ b/fetch/metadata/tools/templates/cors-preflight.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on CORS preflight request diff --git a/fetch/metadata/tools/templates/css-font-face.sub.html b/fetch/metadata/tools/templates/css-font-face.sub.html index bb846689b11b8e..7338884fb03915 100644 --- a/fetch/metadata/tools/templates/css-font-face.sub.html +++ b/fetch/metadata/tools/templates/css-font-face.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for CSS font-face diff --git a/fetch/metadata/tools/templates/css-images.sub.html b/fetch/metadata/tools/templates/css-images.sub.html index 69878905c1cb60..c0e6e0e42dbf01 100644 --- a/fetch/metadata/tools/templates/css-images.sub.html +++ b/fetch/metadata/tools/templates/css-images.sub.html @@ -7,7 +7,7 @@ {%- if subtests|length > 10 %} {%- endif %} - [%title%] + HTTP headers on request for CSS image-accepting properties diff --git a/fetch/metadata/tools/templates/element-a.sub.html b/fetch/metadata/tools/templates/element-a.sub.html index 7e3b38e06d8dae..2075988e6b11f1 100644 --- a/fetch/metadata/tools/templates/element-a.sub.html +++ b/fetch/metadata/tools/templates/element-a.sub.html @@ -7,7 +7,7 @@ {%- if subtests|length > 10 %} {%- endif %} - [%title%] + HTTP headers on request for HTML "a" element navigation {%- if subtests|selectattr('userActivated')|list %} diff --git a/fetch/metadata/tools/templates/element-area.sub.html b/fetch/metadata/tools/templates/element-area.sub.html index 020d1a0ff0f0a3..fb3ccdd0178dd1 100644 --- a/fetch/metadata/tools/templates/element-area.sub.html +++ b/fetch/metadata/tools/templates/element-area.sub.html @@ -7,7 +7,7 @@ {%- if subtests|length > 10 %} {%- endif %} - [%title%] + HTTP headers on request for HTML "area" element navigation {%- if subtests|selectattr('userActivated')|list %} diff --git a/fetch/metadata/tools/templates/element-audio.sub.html b/fetch/metadata/tools/templates/element-audio.sub.html index 2392301273983b..2ce840fde52e5b 100644 --- a/fetch/metadata/tools/templates/element-audio.sub.html +++ b/fetch/metadata/tools/templates/element-audio.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for HTML "audio" element source diff --git a/fetch/metadata/tools/templates/element-embed.sub.html b/fetch/metadata/tools/templates/element-embed.sub.html index 8937f27fb288b5..37bc8ba50fa871 100644 --- a/fetch/metadata/tools/templates/element-embed.sub.html +++ b/fetch/metadata/tools/templates/element-embed.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for HTML "embed" element source diff --git a/fetch/metadata/tools/templates/element-frame.sub.html b/fetch/metadata/tools/templates/element-frame.sub.html index 97b19f8296d7a6..1fcfa9b69deabc 100644 --- a/fetch/metadata/tools/templates/element-frame.sub.html +++ b/fetch/metadata/tools/templates/element-frame.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for HTML "frame" element source {%- if subtests|selectattr('userActivated')|list %} diff --git a/fetch/metadata/tools/templates/element-iframe.sub.html b/fetch/metadata/tools/templates/element-iframe.sub.html index 9fef7d5e6dc6b3..a6175878f7dd2b 100644 --- a/fetch/metadata/tools/templates/element-iframe.sub.html +++ b/fetch/metadata/tools/templates/element-iframe.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for HTML "frame" element source {%- if subtests|selectattr('userActivated')|list %} diff --git a/fetch/metadata/tools/templates/element-img.sub.html b/fetch/metadata/tools/templates/element-img.sub.html index 01b7b54efb3840..cb3d070ed7a26c 100644 --- a/fetch/metadata/tools/templates/element-img.sub.html +++ b/fetch/metadata/tools/templates/element-img.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for HTML "img" element source diff --git a/fetch/metadata/tools/templates/element-input-image.sub.html b/fetch/metadata/tools/templates/element-input-image.sub.html index 832021e1cd6126..d0155be772942a 100644 --- a/fetch/metadata/tools/templates/element-input-image.sub.html +++ b/fetch/metadata/tools/templates/element-input-image.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for HTML "input" element with type="button" diff --git a/fetch/metadata/tools/templates/element-link-icon.sub.html b/fetch/metadata/tools/templates/element-link-icon.sub.html index 37cb8db572dde4..f6c2dec754aa84 100644 --- a/fetch/metadata/tools/templates/element-link-icon.sub.html +++ b/fetch/metadata/tools/templates/element-link-icon.sub.html @@ -7,7 +7,7 @@ {%- if subtests|length > 10 %} {%- endif %} - [%title%] + HTTP headers on request for HTML "link" element with rel="icon" diff --git a/fetch/metadata/tools/templates/element-meta-refresh.optional.sub.html b/fetch/metadata/tools/templates/element-meta-refresh.optional.sub.html index b9262b9db92b48..aaf91b54446bb7 100644 --- a/fetch/metadata/tools/templates/element-meta-refresh.optional.sub.html +++ b/fetch/metadata/tools/templates/element-meta-refresh.optional.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for HTML "meta" element with http-equiv="refresh" diff --git a/fetch/metadata/tools/templates/element-picture.sub.html b/fetch/metadata/tools/templates/element-picture.sub.html index 2b39bbfac81853..4fc3f29862d958 100644 --- a/fetch/metadata/tools/templates/element-picture.sub.html +++ b/fetch/metadata/tools/templates/element-picture.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for HTML "picture" element source diff --git a/fetch/metadata/tools/templates/element-script.sub.html b/fetch/metadata/tools/templates/element-script.sub.html index aecea0b1b62dd5..97b5a0dd69d062 100644 --- a/fetch/metadata/tools/templates/element-script.sub.html +++ b/fetch/metadata/tools/templates/element-script.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for HTML "script" element source diff --git a/fetch/metadata/tools/templates/element-video-poster.sub.html b/fetch/metadata/tools/templates/element-video-poster.sub.html index d98304a4a97e6a..e3bd9ff0b68ced 100644 --- a/fetch/metadata/tools/templates/element-video-poster.sub.html +++ b/fetch/metadata/tools/templates/element-video-poster.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for HTML "video" element "poster" diff --git a/fetch/metadata/tools/templates/element-video.sub.html b/fetch/metadata/tools/templates/element-video.sub.html index 823176601affa2..8d254bca2ef0a8 100644 --- a/fetch/metadata/tools/templates/element-video.sub.html +++ b/fetch/metadata/tools/templates/element-video.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for HTML "video" element source diff --git a/fetch/metadata/tools/templates/fetch.sub.html b/fetch/metadata/tools/templates/fetch.sub.html index e0858dd131e260..26defa29387d20 100644 --- a/fetch/metadata/tools/templates/fetch.sub.html +++ b/fetch/metadata/tools/templates/fetch.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request using the "fetch" API diff --git a/fetch/metadata/tools/templates/font.sub.html b/fetch/metadata/tools/templates/font.sub.html index 828578a5267a02..0314ff9732e3e0 100644 --- a/fetch/metadata/tools/templates/font.sub.html +++ b/fetch/metadata/tools/templates/font.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for CSS font-face diff --git a/fetch/metadata/tools/templates/form-submission.sub.html b/fetch/metadata/tools/templates/form-submission.sub.html index 130fc26100af37..dab9d06f834bb7 100644 --- a/fetch/metadata/tools/templates/form-submission.sub.html +++ b/fetch/metadata/tools/templates/form-submission.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for HTML form navigation {%- if subtests|selectattr('userActivated')|list %} diff --git a/fetch/metadata/tools/templates/header-link-icon.sub.html b/fetch/metadata/tools/templates/header-link-icon.sub.html index bc851834de60d8..6581712ecfbb1f 100644 --- a/fetch/metadata/tools/templates/header-link-icon.sub.html +++ b/fetch/metadata/tools/templates/header-link-icon.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for HTTP "Link" header (rel="icon") diff --git a/fetch/metadata/tools/templates/header-refresh.optional.sub.html b/fetch/metadata/tools/templates/header-refresh.optional.sub.html index d64b784f986b1d..610302fc84bf05 100644 --- a/fetch/metadata/tools/templates/header-refresh.optional.sub.html +++ b/fetch/metadata/tools/templates/header-refresh.optional.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for HTTP "Refresh" header diff --git a/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html b/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html index 9c714c94af16fe..2600c3e22c294f 100644 --- a/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html +++ b/fetch/metadata/tools/templates/script-module-import-dynamic.sub.html @@ -4,6 +4,7 @@ --> + HTTP headers on request for dynamic ECMAScript module import diff --git a/fetch/metadata/tools/templates/script-module-import-static.sub.html b/fetch/metadata/tools/templates/script-module-import-static.sub.html index 181318ab18ac93..1a89485b31fc83 100644 --- a/fetch/metadata/tools/templates/script-module-import-static.sub.html +++ b/fetch/metadata/tools/templates/script-module-import-static.sub.html @@ -4,7 +4,7 @@ --> - [%title%] + HTTP headers on request for static ECMAScript module import diff --git a/fetch/metadata/tools/templates/svg-image.sub.html b/fetch/metadata/tools/templates/svg-image.sub.html index 1408a1c88c55fa..0e26db5f6e5b9c 100644 --- a/fetch/metadata/tools/templates/svg-image.sub.html +++ b/fetch/metadata/tools/templates/svg-image.sub.html @@ -7,7 +7,7 @@ {%- if subtests|length > 10 %} {%- endif %} - [%title%] + HTTP headers on request for SVG "image" element source diff --git a/fetch/metadata/tools/templates/window-history.sub.html b/fetch/metadata/tools/templates/window-history.sub.html index 07dd9f4577e29b..b20efcab6cc6bc 100644 --- a/fetch/metadata/tools/templates/window-history.sub.html +++ b/fetch/metadata/tools/templates/window-history.sub.html @@ -7,7 +7,7 @@ {%- if subtests|length > 10 %} {%- endif %} - [%title%] + HTTP headers on request for navigation via the HTML History API {%- if subtests|selectattr('userActivated')|list %} diff --git a/fetch/metadata/tools/templates/window-location.sub.html b/fetch/metadata/tools/templates/window-location.sub.html index fb2cc7d7e498ea..a709dcbc2d35d0 100644 --- a/fetch/metadata/tools/templates/window-location.sub.html +++ b/fetch/metadata/tools/templates/window-location.sub.html @@ -7,7 +7,7 @@ {%- if subtests|length > 10 %} {%- endif %} - [%title%] + HTTP headers on request for navigation via the HTML Location API {%- if subtests|selectattr('userActivated')|list %} diff --git a/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html b/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html index 0f7e501323fac8..7df5519a80176e 100644 --- a/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html +++ b/fetch/metadata/tools/templates/worker-dedicated-constructor.sub.html @@ -4,6 +4,7 @@ --> + HTTP headers on request for dedicated worker via the "Worker" constructor diff --git a/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html b/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html index 3893652657d5be..ee843ef0aa0379 100644 --- a/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html +++ b/fetch/metadata/tools/templates/worker-dedicated-importscripts.sub.html @@ -4,6 +4,7 @@ --> + HTTP headers on request for dedicated worker via the "importScripts" API From 688b382ad81014fbe49db0d8ecbc77601782cf72 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 15 May 2020 21:26:00 -0400 Subject: [PATCH 119/127] Remove duplicated template --- fetch/metadata/generated/font.https.sub.html | 207 ------------------- fetch/metadata/generated/font.sub.html | 77 ------- fetch/metadata/tools/fetch-metadata.conf.yml | 9 - fetch/metadata/tools/templates/font.sub.html | 57 ----- 4 files changed, 350 deletions(-) delete mode 100644 fetch/metadata/generated/font.https.sub.html delete mode 100644 fetch/metadata/generated/font.sub.html delete mode 100644 fetch/metadata/tools/templates/font.sub.html diff --git a/fetch/metadata/generated/font.https.sub.html b/fetch/metadata/generated/font.https.sub.html deleted file mode 100644 index feaa7862136551..00000000000000 --- a/fetch/metadata/generated/font.https.sub.html +++ /dev/null @@ -1,207 +0,0 @@ - - - - - HTTP headers on request for CSS font-face - - - - -
test
- - - diff --git a/fetch/metadata/generated/font.sub.html b/fetch/metadata/generated/font.sub.html deleted file mode 100644 index ae18a6986e3d20..00000000000000 --- a/fetch/metadata/generated/font.sub.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - HTTP headers on request for CSS font-face - - - - -
test
- - - diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 98e7176f6adcfc..57f6bb3286d91c 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -60,7 +60,6 @@ cases: element-video.sub.html: [{}] element-video-poster.sub.html: [{}] fetch.sub.html: [{}] - font.sub.html: [{}] form-submission.sub.html: - method: GET - method: POST @@ -153,7 +152,6 @@ cases: element-video.sub.html: [{}] element-video-poster.sub.html: [{}] fetch.sub.html: [{ init: { mode: no-cors } }] - font.sub.html: [{}] form-submission.sub.html: - method: GET - method: POST @@ -201,7 +199,6 @@ cases: element-picture.sub.html: [] element-script.sub.html: [] fetch.sub.html: [] - font.sub.html: [] header-link-icon.sub.html: [] script-module-import-static.sub.html: [] script-module-import-dynamic.sub.html: [] @@ -361,8 +358,6 @@ cases: init: { mode: no-cors } - expected: same-origin init: { mode: same-origin } - font.sub.html: - - expected: cors form-submission.sub.html: - method: GET expected: navigate @@ -461,8 +456,6 @@ cases: - expected: image fetch.sub.html: - expected: empty - font.sub.html: - - expected: font form-submission.sub.html: - method: GET expected: document @@ -558,8 +551,6 @@ cases: - expected: NULL fetch.sub.html: - expected: NULL - font.sub.html: - - expected: NULL form-submission.sub.html: - method: GET expected: NULL diff --git a/fetch/metadata/tools/templates/font.sub.html b/fetch/metadata/tools/templates/font.sub.html deleted file mode 100644 index 0314ff9732e3e0..00000000000000 --- a/fetch/metadata/tools/templates/font.sub.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - HTTP headers on request for CSS font-face - - - - -
test
- - - From b7dea63f662ac0ae86cc2e8a8968d3055c4231a8 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 15 May 2020 21:43:08 -0400 Subject: [PATCH 120/127] Add more tests for Link HTTP header --- .../generated/header-link-icon.https.sub.html | 204 --------- .../generated/header-link-icon.sub.html | 74 ---- .../generated/header-link.https.sub.html | 409 ++++++++++++++++++ .../header-link.https.sub.tentative.html | 51 +++ fetch/metadata/generated/header-link.sub.html | 124 ++++++ fetch/metadata/tools/fetch-metadata.conf.yml | 32 +- ...ink-icon.sub.html => header-link.sub.html} | 12 +- 7 files changed, 614 insertions(+), 292 deletions(-) delete mode 100644 fetch/metadata/generated/header-link-icon.https.sub.html delete mode 100644 fetch/metadata/generated/header-link-icon.sub.html create mode 100644 fetch/metadata/generated/header-link.https.sub.html create mode 100644 fetch/metadata/generated/header-link.https.sub.tentative.html create mode 100644 fetch/metadata/generated/header-link.sub.html rename fetch/metadata/tools/templates/{header-link-icon.sub.html => header-link.sub.html} (80%) diff --git a/fetch/metadata/generated/header-link-icon.https.sub.html b/fetch/metadata/generated/header-link-icon.https.sub.html deleted file mode 100644 index a06d9e73be317a..00000000000000 --- a/fetch/metadata/generated/header-link-icon.https.sub.html +++ /dev/null @@ -1,204 +0,0 @@ - - - - - HTTP headers on request for HTTP "Link" header (rel="icon") - - - - - - - diff --git a/fetch/metadata/generated/header-link-icon.sub.html b/fetch/metadata/generated/header-link-icon.sub.html deleted file mode 100644 index 0d50e9e4131b02..00000000000000 --- a/fetch/metadata/generated/header-link-icon.sub.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - HTTP headers on request for HTTP "Link" header (rel="icon") - - - - - - - diff --git a/fetch/metadata/generated/header-link.https.sub.html b/fetch/metadata/generated/header-link.https.sub.html new file mode 100644 index 00000000000000..ab15ba999036e7 --- /dev/null +++ b/fetch/metadata/generated/header-link.https.sub.html @@ -0,0 +1,409 @@ + + + + + HTTP headers on request for HTTP "Link" header + + + + + + + diff --git a/fetch/metadata/generated/header-link.https.sub.tentative.html b/fetch/metadata/generated/header-link.https.sub.tentative.html new file mode 100644 index 00000000000000..b389c0aaee430f --- /dev/null +++ b/fetch/metadata/generated/header-link.https.sub.tentative.html @@ -0,0 +1,51 @@ + + + + + HTTP headers on request for HTTP "Link" header + + + + + + + diff --git a/fetch/metadata/generated/header-link.sub.html b/fetch/metadata/generated/header-link.sub.html new file mode 100644 index 00000000000000..a3a8086c4a0c81 --- /dev/null +++ b/fetch/metadata/generated/header-link.sub.html @@ -0,0 +1,124 @@ + + + + + HTTP headers on request for HTTP "Link" header + + + + + + + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 57f6bb3286d91c..d368f6222f937b 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -63,7 +63,9 @@ cases: form-submission.sub.html: - method: GET - method: POST - header-link-icon.sub.html: [{}] + header-link.sub.html: + - rel: icon + - rel: stylesheet header-refresh.optional.sub.html: [{}] window-location.sub.html: - api: location @@ -155,7 +157,9 @@ cases: form-submission.sub.html: - method: GET - method: POST - header-link-icon.sub.html: [{}] + header-link.sub.html: + - rel: icon + - rel: stylesheet header-refresh.optional.sub.html: [{}] window-location.sub.html: - api: location @@ -199,7 +203,7 @@ cases: element-picture.sub.html: [] element-script.sub.html: [] fetch.sub.html: [] - header-link-icon.sub.html: [] + header-link.sub.html: [] script-module-import-static.sub.html: [] script-module-import-dynamic.sub.html: [] cors-preflight.sub.html: [] @@ -363,8 +367,11 @@ cases: expected: navigate - method: POST expected: navigate - header-link-icon.sub.html: - - expected: no-cors + header-link.sub.html: + - rel: icon + expected: no-cors + - rel: stylesheet + expected: no-cors header-refresh.optional.sub.html: - expected: navigate window-history.sub.html: @@ -461,8 +468,12 @@ cases: expected: document - method: POST expected: document - header-link-icon.sub.html: - - expected: empty + header-link.sub.html: + - rel: icon + expected: empty + - rel: stylesheet + filename_flags: [tentative] + expected: style header-refresh.optional.sub.html: - expected: document window-history.sub.html: @@ -562,8 +573,11 @@ cases: - method: POST userActivated: TRUE expected: ?1 - header-link-icon.sub.html: - - expected: NULL + header-link.sub.html: + - rel: icon + expected: NULL + - rel: stylesheet + expected: NULL header-refresh.optional.sub.html: - expected: NULL window-history.sub.html: diff --git a/fetch/metadata/tools/templates/header-link-icon.sub.html b/fetch/metadata/tools/templates/header-link.sub.html similarity index 80% rename from fetch/metadata/tools/templates/header-link-icon.sub.html rename to fetch/metadata/tools/templates/header-link.sub.html index 6581712ecfbb1f..b5cf1f9696ed19 100644 --- a/fetch/metadata/tools/templates/header-link-icon.sub.html +++ b/fetch/metadata/tools/templates/header-link.sub.html @@ -4,7 +4,7 @@ --> - HTTP headers on request for HTTP "Link" header (rel="icon") + HTTP headers on request for HTTP "Link" header @@ -12,13 +12,13 @@ From e681c3f8321cab6185f886048735ee669a353d72 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 15 May 2020 21:45:40 -0400 Subject: [PATCH 121/127] Remove unnecessary code --- .../css-font-face.https.sub.tentative.html | 29 +++++++++---------- .../css-font-face.sub.tentative.html | 9 ++---- .../tools/templates/css-font-face.sub.html | 5 +--- 3 files changed, 17 insertions(+), 26 deletions(-) diff --git a/fetch/metadata/generated/css-font-face.https.sub.tentative.html b/fetch/metadata/generated/css-font-face.https.sub.tentative.html index 6e8a919904bcad..7bfafad095021c 100644 --- a/fetch/metadata/generated/css-font-face.https.sub.tentative.html +++ b/fetch/metadata/generated/css-font-face.https.sub.tentative.html @@ -15,9 +15,6 @@ diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index d368f6222f937b..db7708630fdbec 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -67,11 +67,7 @@ cases: - rel: icon - rel: stylesheet header-refresh.optional.sub.html: [{}] - window-location.sub.html: - - api: location - - api: location.href - - api: location.assign - - api: location.replace + window-location.sub.html: [{}] script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] svg-image.sub.html: [{}] @@ -161,11 +157,7 @@ cases: - rel: icon - rel: stylesheet header-refresh.optional.sub.html: [{}] - window-location.sub.html: - - api: location - - api: location.href - - api: location.assign - - api: location.replace + window-location.sub.html: [{}] script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] svg-image.sub.html: [{}] @@ -233,11 +225,7 @@ cases: - method: POST header-refresh.optional.sub.html: [{}] svg-image.sub.html: [{}] - window-location.sub.html: - - api: location - - api: location.href - - api: location.assign - - api: location.replace + window-location.sub.html: [{}] # Sec-Fetch-Mode # These tests are served over HTTPS so the induced requests will be both @@ -377,14 +365,7 @@ cases: window-history.sub.html: - expected: navigate window-location.sub.html: - - api: location - expected: navigate - - api: location.href - expected: navigate - - api: location.assign - expected: navigate - - api: location.replace - expected: navigate + - expected: navigate script-module-import-dynamic.sub.html: - expected: cors script-module-import-static.sub.html: @@ -479,14 +460,7 @@ cases: window-history.sub.html: - expected: document window-location.sub.html: - - api: location - expected: document - - api: location.href - expected: document - - api: location.assign - expected: document - - api: location.replace - expected: document + - expected: document script-module-import-dynamic.sub.html: - expected: script script-module-import-static.sub.html: @@ -583,25 +557,8 @@ cases: window-history.sub.html: - expected: NULL window-location.sub.html: - - api: location - expected: NULL - - api: location - userActivated: TRUE - expected: ?1 - - api: location.href - expected: NULL - - api: location.href - userActivated: TRUE - expected: ?1 - - api: location.assign - expected: NULL - - api: location.assign - userActivated: TRUE - expected: ?1 - - api: location.replace - expected: NULL - - api: location.replace - userActivated: TRUE + - expected: NULL + - userActivated: TRUE expected: ?1 script-module-import-dynamic.sub.html: - expected: NULL diff --git a/fetch/metadata/tools/templates/window-location.sub.html b/fetch/metadata/tools/templates/window-location.sub.html index a709dcbc2d35d0..6fd84498d5d7d3 100644 --- a/fetch/metadata/tools/templates/window-location.sub.html +++ b/fetch/metadata/tools/templates/window-location.sub.html @@ -50,11 +50,7 @@ const url = makeRequestURL(key, [% subtest.origins %], responseParams); const navigate = (win, path) => { - {%- if subtest.api in ['location', 'location.href'] %} - win.[%subtest.api%] = path; - {%- else %} - win.[%subtest.api%](path); - {%- endif %} + win.location = path; }; return induceRequest(url, navigate, [% 'true' if subtest.userActivated else 'false' %]) .then(() => retrieve(key)) @@ -66,7 +62,64 @@ assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); {%- endif %} }); - }, '[%subtest.headerName%] - [%subtest.description | pad("right", " - ")%][%subtest.api%][% " with user activation" if subtest.userActivated%]'); + }, '[%subtest.headerName%] - [%subtest.description | pad("end", " - ")%]location[% " with user activation" if subtest.userActivated%]'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, [% subtest.origins %], responseParams); + + const navigate = (win, path) => { + win.location.href = path; + }; + return induceRequest(url, navigate, [% 'true' if subtest.userActivated else 'false' %]) + .then(() => retrieve(key)) + .then((headers) => { + {%- if subtest.expected == none %} + assert_not_own_property(headers, '[%subtest.headerName%]'); + {%- else %} + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); + {%- endif %} + }); + }, '[%subtest.headerName%] - [%subtest.description | pad("end", " - ")%]location.href[% " with user activation" if subtest.userActivated%]'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, [% subtest.origins %], responseParams); + + const navigate = (win, path) => { + win.location.assign(path); + }; + return induceRequest(url, navigate, [% 'true' if subtest.userActivated else 'false' %]) + .then(() => retrieve(key)) + .then((headers) => { + {%- if subtest.expected == none %} + assert_not_own_property(headers, '[%subtest.headerName%]'); + {%- else %} + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); + {%- endif %} + }); + }, '[%subtest.headerName%] - [%subtest.description | pad("end", " - ")%]location.assign[% " with user activation" if subtest.userActivated%]'); + + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL(key, [% subtest.origins %], responseParams); + + const navigate = (win, path) => { + win.location.replace(path); + }; + return induceRequest(url, navigate, [% 'true' if subtest.userActivated else 'false' %]) + .then(() => retrieve(key)) + .then((headers) => { + {%- if subtest.expected == none %} + assert_not_own_property(headers, '[%subtest.headerName%]'); + {%- else %} + assert_own_property(headers, '[%subtest.headerName%]'); + assert_equals(headers['[%subtest.headerName%]'], '[%subtest.expected%]'); + {%- endif %} + }); + }, '[%subtest.headerName%] - [%subtest.description | pad("end", " - ")%]location.replace[% " with user activation" if subtest.userActivated%]'); {%- endfor %} From b1e565e04d63d08d6030559b818d4596fecdbd67 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 15 May 2020 23:24:05 -0400 Subject: [PATCH 123/127] Add documentation --- fetch/metadata/tools/README.md | 121 +++++++++++++++++++++++++++++++-- 1 file changed, 116 insertions(+), 5 deletions(-) diff --git a/fetch/metadata/tools/README.md b/fetch/metadata/tools/README.md index 86198130469236..cc6806d983330e 100644 --- a/fetch/metadata/tools/README.md +++ b/fetch/metadata/tools/README.md @@ -1,9 +1,39 @@ # Fetch Metadata test generation framework -This directory defines a tool for procedurally generating WPT tests. It is -currently under development, so documentation is minimal. +This directory defines a command-line tool for procedurally generating WPT +tests. It is currently under development, so documentation is minimal. -To run: +## Motivation + +Many features of the web platform involve the browser making one or more HTTP +requests to remote servers. + +Only some aspects of these requests are specified within the standard that +defines the relevant feature. Other aspects are specified by external standards +which span the entire platform (e.g. [Fetch Metadata Request +Headers](https://w3c.github.io/webappsec-fetch-metadata/)). + +This state of affairs makes it difficult to maintain test coverage for two +reasons: + +- When a new feature introduces a new request, it must be verified to integrate + with every cross-cutting standard. +- When a new cross-cutting standard is introduced, it must be verified to + integrate with every request. + +This tool attempts to reduce this tension. It allows maintainers to share +instructions for making requests in an abstract sense. These generic +instructions can be reused by to produce a different suite of tests for each +cross-cutting feature. + +When a new type of request is proposed, a single generic template can be +defined here. This will provide the maintainers of all cross-cutting features +with clear instruction on how to extend their test suite with the new feature. + +Similarly, when a new cross-cutting feature is proposed, the authors can use +this tool to build a test suite which spans the entire platform. + +## Setup instructions - [Install Python 3](https://www.python.org/download/releases/3.0/) - Install Python dependencies with the following command (issued from the @@ -11,6 +41,87 @@ To run: $ pip install -r ./requirements.txt -- Invoke the executable: +## Execution + +Execute the following command to generate tests, making sure to replace +`./path/to/configuration-file.yml` with a filesystem path to a valid +configuration file (described in greater detail below): + + $ python3 ./generate.py ./path/to/configuration-file.yml + +## Configuration + +The test generation tool requires a YAML-formatted configuration file as its +input. The file should define a dictionary with the following keys: + +- `templates` - a string describing the filesystem path from which template + files should be loaded +- `output_directory` - a string describing the filesystem path where the + generated test files should be written +- `cases` - a list of dictionaries describing how the test templates should be + expanded with individual subtests; each disctionary should have the following + keys: + - `all_subtests` - properties which should be defined for every expansion + - `common_axis` - a list of dictionaries + - `template_axes` + +Internally, the tool creates a set of "subtests" for each template. This set is +the Cartesian product of the `common_axis` and the given template's entry in +the `template_axes` dictionary. It uses this set of subtests to expand the +template, creating an output file. + +In general, the tool will output a single file for each template. However, the +`filename_flags` attribute has special semantics. It is used to separate +subtests for the same template file. This is intended to accommodate [the +web-platform-test's filename-based +conventions](https://web-platform-tests.org/writing-tests/file-names.html). + +For instance, when `.https` is present in a test file's name, the test harness +will load that test using the HTTPS protocol. Subtests which include the value +`https` in the `filename_flags` property will be expanded using the appropriate +template but written to a distinct file whose name includes `.https`. + +## Expansion example + +In the following example configuration file, `a`, `b`, `s`, `w`, `x`, `y`, and +`z` all represent associative arrays. + +```yaml +templates: path/to/templates +output_directory: path/to/output +cases: + - every_subtest: s + common_axis: [a, b] + template_axes: + template1.html: [w] + template2.html: [x, y, z] + template3.html: [] +``` + +When run with such a configuration file, the tool would generate two files, +expanded with data as described below (where `(a, b)` represents the union of +`a` and `b`): + + template1.html: [(a, w), (b, w)] + template2.html: [(a, x), (b, x), (a, y), (b, y), (a, z), (b, z)] + template3.html: (zero tests; not expanded) + +## Design Considerations + +**Efficiency of generated output** The tool is capable of generating a large +number of tests given a small amount of input. Naively structured, this could +result in test suites which take large amount of time and computational +resources to complete. The tool has been designed to help authors structure the +generated output to reduce these resource requirements. + +**Literalness of generated output** Because the generated output is how most +people will interact with the tests, it is important that it be logical and +approachable. This tool avoids outputting abstractions which would frustrate +attempts to read the source code or step through its execution environment. + +**Simplicity** The test generation logic itself was written to be approachable. +This makes it easier to anticipate how the tool will behave with new input, and +it also lowers the bar for others to contribute improvements. - $ python3 ./generate.py ./path/to/configuration-file.yml +Non-goals include conciseness of template files, conciseness of generated +output From dae0379eb5e2dae2cf97b10bd7a384adf39dc3dd Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 24 Aug 2020 13:55:38 -0400 Subject: [PATCH 124/127] Improve documentation --- fetch/metadata/tools/README.md | 66 +++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/fetch/metadata/tools/README.md b/fetch/metadata/tools/README.md index cc6806d983330e..3486eff7426bc7 100644 --- a/fetch/metadata/tools/README.md +++ b/fetch/metadata/tools/README.md @@ -1,32 +1,30 @@ # Fetch Metadata test generation framework This directory defines a command-line tool for procedurally generating WPT -tests. It is currently under development, so documentation is minimal. +tests. ## Motivation Many features of the web platform involve the browser making one or more HTTP -requests to remote servers. - -Only some aspects of these requests are specified within the standard that -defines the relevant feature. Other aspects are specified by external standards -which span the entire platform (e.g. [Fetch Metadata Request -Headers](https://w3c.github.io/webappsec-fetch-metadata/)). +requests to remote servers. Only some aspects of these requests are specified +within the standard that defines the relevant feature. Other aspects are +specified by external standards which span the entire platform (e.g. [Fetch +Metadata Request Headers](https://w3c.github.io/webappsec-fetch-metadata/)). This state of affairs makes it difficult to maintain test coverage for two reasons: -- When a new feature introduces a new request, it must be verified to integrate - with every cross-cutting standard. +- When a new feature introduces a new kind of web request, it must be verified + to integrate with every cross-cutting standard. - When a new cross-cutting standard is introduced, it must be verified to - integrate with every request. + integrate with every kind of web request. -This tool attempts to reduce this tension. It allows maintainers to share -instructions for making requests in an abstract sense. These generic -instructions can be reused by to produce a different suite of tests for each -cross-cutting feature. +The tool in this directory attempts to reduce this tension. It allows +maintainers to express instructions for making web requests in an abstract +sense. These generic instructions can be reused by to produce a different suite +of tests for each cross-cutting feature. -When a new type of request is proposed, a single generic template can be +When a new kind of request is proposed, a single generic template can be defined here. This will provide the maintainers of all cross-cutting features with clear instruction on how to extend their test suite with the new feature. @@ -59,16 +57,18 @@ input. The file should define a dictionary with the following keys: - `output_directory` - a string describing the filesystem path where the generated test files should be written - `cases` - a list of dictionaries describing how the test templates should be - expanded with individual subtests; each disctionary should have the following + expanded with individual subtests; each dictionary should have the following keys: - `all_subtests` - properties which should be defined for every expansion - `common_axis` - a list of dictionaries - - `template_axes` + - `template_axes` - a dictionary relating template names to properties that + should be used when expanding that particular template Internally, the tool creates a set of "subtests" for each template. This set is the Cartesian product of the `common_axis` and the given template's entry in the `template_axes` dictionary. It uses this set of subtests to expand the -template, creating an output file. +template, creating an output file. Refer to the next section for a concrete +example of how the expansion is performed. In general, the tool will output a single file for each template. However, the `filename_flags` attribute has special semantics. It is used to separate @@ -76,10 +76,19 @@ subtests for the same template file. This is intended to accommodate [the web-platform-test's filename-based conventions](https://web-platform-tests.org/writing-tests/file-names.html). -For instance, when `.https` is present in a test file's name, the test harness -will load that test using the HTTPS protocol. Subtests which include the value -`https` in the `filename_flags` property will be expanded using the appropriate -template but written to a distinct file whose name includes `.https`. +For instance, when `.https` is present in a test file's name, the WPT test +harness will load that test using the HTTPS protocol. Subtests which include +the value `https` in the `filename_flags` property will be expanded using the +appropriate template but written to a distinct file whose name includes +`.https`. + +The generation tool requires that the configuration file references every +template in the `templates` directory. Because templates and configuration +files may be contributed by different people, this requirement ensures that +configuration authors are aware of all available templates. Some templates may +not be relevant for some features; in those cases, the configuration file can +include an empty array for the template's entry in the `template_axes` +dictionary (as in `template3.html` in the example which follows). ## Expansion example @@ -115,13 +124,14 @@ resources to complete. The tool has been designed to help authors structure the generated output to reduce these resource requirements. **Literalness of generated output** Because the generated output is how most -people will interact with the tests, it is important that it be logical and -approachable. This tool avoids outputting abstractions which would frustrate -attempts to read the source code or step through its execution environment. +people will interact with the tests, it is important that it be approachable. +This tool avoids outputting abstractions which would frustrate attempts to read +the source code or step through its execution environment. **Simplicity** The test generation logic itself was written to be approachable. This makes it easier to anticipate how the tool will behave with new input, and -it also lowers the bar for others to contribute improvements. +it lowers the bar for others to contribute improvements. -Non-goals include conciseness of template files, conciseness of generated -output +Non-goals include conciseness of template files (verbosity makes the potential +expansions more predictable) and conciseness of generated output (verbosity +aids in the interpretation of results). From f625beb45f20dde15c72705b7a6e6b903d0ba312 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 24 Aug 2020 15:23:38 -0400 Subject: [PATCH 125/127] Document rationale for skipped templates --- fetch/metadata/tools/fetch-metadata.conf.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index db7708630fdbec..4405101909e38a 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -21,7 +21,9 @@ cases: # The `audioWorklet` interface is only available in secure contexts # https://webaudio.github.io/web-audio-api/#BaseAudioContext audioworklet.https.sub.html: [] - # TODO(jugglinmike) document rationale + # These requests do not necessarily induce preflight requests because + # preflight requests are only issued on the basis of the origin of the + # initial request. cors-preflight.sub.html: [] # Interstitial locations in an HTTP redirect chain are not added to the # session history, so these requests cannot be initiated using the @@ -110,7 +112,9 @@ cases: expected: cross-site template_axes: # Unused - # TODO(jugglinmike) document rationale + # These requests do not necessarily induce preflight requests because + # preflight requests are only issued on the basis of the origin of the + # initial request. cors-preflight.sub.html: [] # Interstitial locations in an HTTP redirect chain are not added to the # session history, so these requests cannot be initiated using the From 992bbeb6aa9e0795e09c796388d3414727b23873 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 24 Aug 2020 15:23:53 -0400 Subject: [PATCH 126/127] Expand template --- .../worker-dedicated-importscripts.https.sub.html | 14 ++++++++++++++ fetch/metadata/tools/fetch-metadata.conf.yml | 6 ++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html b/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html index 5f53fa2ba27d32..991943daa1f76e 100644 --- a/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html +++ b/fetch/metadata/generated/worker-dedicated-importscripts.https.sub.html @@ -168,6 +168,20 @@ }); }, 'sec-fetch-site - Same-Site -> Cross-Site'); + promise_test(() => { + const key = '{{uuid()}}'; + const url = makeRequestURL( + key, [], { mime: 'application/javascript' } + ); + + return induceRequest(url) + .then(() => retrieve(key)) + .then((headers) => { + assert_own_property(headers, 'sec-fetch-mode'); + assert_equals(headers['sec-fetch-mode'], 'no-cors'); + }); + }, 'sec-fetch-mode'); + promise_test(() => { const key = '{{uuid()}}'; const url = makeRequestURL( diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index 4405101909e38a..e7682a5100ad81 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -242,10 +242,6 @@ cases: filename_flags: [https] origins: [] template_axes: - # Unused - # TODO(jugglinmike) document rationale - worker-dedicated-importscripts.sub.html: [] - appcache-manifest.sub.https.html: - expected: no-cors audioworklet.https.sub.html: @@ -387,6 +383,8 @@ cases: - expected: same-origin - options: { type: module } expected: same-origin + worker-dedicated-importscripts.sub.html: + - expected: no-cors # Sec-Fetch-Dest - common_axis: From ac68f6836329606b0063bfd5418a1bff211443f6 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 24 Aug 2020 18:09:37 -0400 Subject: [PATCH 127/127] Add tests for `img` following change to env --- ...ment-img-environment-change.https.sub.html | 297 ++++++++++++++++++ .../element-img-environment-change.sub.html | 102 ++++++ fetch/metadata/tools/fetch-metadata.conf.yml | 15 + .../element-img-environment-change.sub.html | 78 +++++ 4 files changed, 492 insertions(+) create mode 100644 fetch/metadata/generated/element-img-environment-change.https.sub.html create mode 100644 fetch/metadata/generated/element-img-environment-change.sub.html create mode 100644 fetch/metadata/tools/templates/element-img-environment-change.sub.html diff --git a/fetch/metadata/generated/element-img-environment-change.https.sub.html b/fetch/metadata/generated/element-img-environment-change.https.sub.html new file mode 100644 index 00000000000000..cf4a41e4a5c8b2 --- /dev/null +++ b/fetch/metadata/generated/element-img-environment-change.https.sub.html @@ -0,0 +1,297 @@ + + + + + HTTP headers on image request triggered by change to environment + + + + + + + diff --git a/fetch/metadata/generated/element-img-environment-change.sub.html b/fetch/metadata/generated/element-img-environment-change.sub.html new file mode 100644 index 00000000000000..51fb818e0784b3 --- /dev/null +++ b/fetch/metadata/generated/element-img-environment-change.sub.html @@ -0,0 +1,102 @@ + + + + + HTTP headers on image request triggered by change to environment + + + + + + + diff --git a/fetch/metadata/tools/fetch-metadata.conf.yml b/fetch/metadata/tools/fetch-metadata.conf.yml index e7682a5100ad81..87cf83ed3582c4 100644 --- a/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/fetch/metadata/tools/fetch-metadata.conf.yml @@ -52,6 +52,7 @@ cases: element-img.sub.html: - sourceAttr: src - sourceAttr: srcset + element-img-environment-change.sub.html: [{}] element-input-image.sub.html: [{}] element-link-icon.sub.html: [{}] element-meta-refresh.optional.sub.html: [{}] @@ -144,6 +145,7 @@ cases: element-img.sub.html: - sourceAttr: src - sourceAttr: srcset + element-img-environment-change.sub.html: [{}] element-input-image.sub.html: [{}] element-link-icon.sub.html: [{}] element-meta-refresh.optional.sub.html: [{}] @@ -195,6 +197,7 @@ cases: element-embed.sub.html: [] element-frame.sub.html: [] element-iframe.sub.html: [] + element-img-environment-change.sub.html: [] element-link-icon.sub.html: [] element-picture.sub.html: [] element-script.sub.html: [] @@ -302,6 +305,14 @@ cases: - sourceAttr: srcset expected: cors elementAttrs: { crossorigin: use-credentials } + element-img-environment-change.sub.html: + - expected: no-cors + - expected: cors + elementAttrs: { crossorigin: '' } + - expected: cors + elementAttrs: { crossorigin: anonymous } + - expected: cors + elementAttrs: { crossorigin: use-credentials } element-input-image.sub.html: - expected: no-cors element-link-icon.sub.html: @@ -430,6 +441,8 @@ cases: expected: image - sourceAttr: srcset expected: image + element-img-environment-change.sub.html: + - expected: image element-input-image.sub.html: - expected: image element-link-icon.sub.html: @@ -522,6 +535,8 @@ cases: expected: NULL - sourceAttr: srcset expected: NULL + element-img-environment-change.sub.html: + - expected: NULL element-input-image.sub.html: - expected: NULL element-link-icon.sub.html: diff --git a/fetch/metadata/tools/templates/element-img-environment-change.sub.html b/fetch/metadata/tools/templates/element-img-environment-change.sub.html new file mode 100644 index 00000000000000..5c840f54a45928 --- /dev/null +++ b/fetch/metadata/tools/templates/element-img-environment-change.sub.html @@ -0,0 +1,78 @@ + + + + + HTTP headers on image request triggered by change to environment + + + + + + +