summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/referrer-policy/gen
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /testing/web-platform/tests/referrer-policy/gen
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/referrer-policy/gen')
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/a-tag.http.html86
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/fetch.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/iframe-tag.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/img-tag.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/script-tag.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/xhr.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/a-tag.http.html83
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/fetch.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/iframe-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/img-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/script-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/sharedworker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/sharedworker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/xhr.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/a-tag.http.html86
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/fetch.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/iframe-tag.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/img-tag.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/script-tag.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/xhr.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/a-tag.http.html83
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/fetch.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/iframe-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/img-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/script-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/sharedworker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/sharedworker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/xhr.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/a-tag.http.html87
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/iframe-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/img-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/script-tag-dynamic-import.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/script-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/a-tag.http.html87
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/iframe-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/img-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/script-tag-dynamic-import.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/script-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/a-tag.http.html87
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/iframe-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/img-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/script-tag-dynamic-import.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/script-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/origin/a-tag.http.html87
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/origin/iframe-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/origin/img-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/origin/script-tag-dynamic-import.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/origin/script-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/a-tag.http.html71
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/iframe-tag.http.html183
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/img-tag.http.html183
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/script-tag-dynamic-import.http.html183
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/script-tag.http.html183
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/a-tag.http.html87
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/iframe-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/img-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/script-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/a-tag.http.html87
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/iframe-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/img-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/script-tag-dynamic-import.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/script-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/a-tag.http.html87
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/iframe-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/img-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/script-tag-dynamic-import.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/script-tag.http.html215
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/req.rel-noref/no-referrer/a-tag.http.html87
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/a-tag.http.html82
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/fetch.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/iframe-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/img-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/script-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/xhr.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/a-tag.http.html82
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/fetch.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/iframe-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/img-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/script-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/xhr.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/a-tag.http.html82
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/fetch.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/iframe-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/img-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/script-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/xhr.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/a-tag.http.html82
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/fetch.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/iframe-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/img-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/script-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/xhr.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/a-tag.http.html67
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/fetch.http.html172
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/iframe-tag.http.html172
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/img-tag.http.html172
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/script-tag.http.html172
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/xhr.http.html172
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/a-tag.http.html82
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/fetch.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/img-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/script-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/xhr.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/a-tag.http.html82
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/fetch.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/iframe-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/img-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/script-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/xhr.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/a-tag.http.html82
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/fetch.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/iframe-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/img-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/script-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/xhr.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/a-tag.http.html82
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/fetch.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/iframe-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/img-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/script-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/sharedworker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/sharedworker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/worker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/worker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/xhr.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/a-tag.http.html83
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/fetch.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/iframe-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/img-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/script-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/sharedworker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/sharedworker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/xhr.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/a-tag.http.html83
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/fetch.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/iframe-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/img-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/script-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/sharedworker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/sharedworker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/xhr.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/a-tag.http.html83
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/fetch.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/iframe-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/img-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/script-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/sharedworker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/sharedworker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/xhr.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/a-tag.http.html83
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/fetch.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/iframe-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/img-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/script-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/sharedworker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/sharedworker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/xhr.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/a-tag.http.html83
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/fetch.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/iframe-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/img-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/script-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/sharedworker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/sharedworker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/xhr.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/a-tag.http.html83
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/fetch.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/iframe-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/img-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/script-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/sharedworker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/sharedworker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/xhr.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/a-tag.http.html83
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/fetch.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/iframe-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/img-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/script-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/sharedworker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/sharedworker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/xhr.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/a-tag.http.html83
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/fetch.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/iframe-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/img-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/script-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/sharedworker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/sharedworker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/xhr.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/a-tag.http.html68
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/fetch.http.html173
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/iframe-tag.http.html173
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/img-tag.http.html173
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/script-tag.http.html173
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/sharedworker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/sharedworker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/xhr.http.html173
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/a-tag.http.html83
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/fetch.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/iframe-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/img-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/script-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/sharedworker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/xhr.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/a-tag.http.html83
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/fetch.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/iframe-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/img-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/script-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/sharedworker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/sharedworker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/xhr.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/a-tag.http.html83
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/fetch.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/iframe-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/img-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/script-tag.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/sharedworker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/sharedworker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/xhr.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/a-tag.http.html82
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/fetch.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/iframe-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/img-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/script-tag.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/sharedworker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/sharedworker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/worker-classic.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/worker-module.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/xhr.http.html202
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/a-tag.http.html86
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/fetch.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/iframe-tag.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/img-tag.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/script-tag.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/xhr.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/a-tag.http.html107
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/iframe-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/img-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/script-tag.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/sharedworker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/sharedworker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/a-tag.http.html62
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/fetch.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/iframe-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/img-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag-dynamic-import.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag-dynamic-import.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/xhr.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/a-tag.http.html62
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/fetch.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/iframe-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/img-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag-dynamic-import.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag-dynamic-import.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/xhr.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/a-tag.http.html62
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/fetch.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/iframe-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/img-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag-dynamic-import.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag-dynamic-import.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/xhr.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/a-tag.http.html62
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/fetch.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/iframe-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/img-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag-dynamic-import.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag-dynamic-import.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/xhr.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/a-tag.http.html52
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/fetch.http.html122
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/iframe-tag.http.html122
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/img-tag.http.html122
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag-dynamic-import.http.html122
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag-dynamic-import.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag.http.html122
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/xhr.http.html122
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/a-tag.http.html62
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/fetch.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/img-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/xhr.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/a-tag.http.html62
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/fetch.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/iframe-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/img-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag-dynamic-import.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag-dynamic-import.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/xhr.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/a-tag.http.html62
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/a-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/fetch.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/fetch.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/iframe-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/iframe-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/img-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/img-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag-dynamic-import.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag-dynamic-import.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-classic.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-module.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/xhr.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/xhr.http.html.headers2
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/a-tag.http.html62
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/fetch.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/iframe-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/img-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/script-tag-dynamic-import.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/script-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/sharedworker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/sharedworker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/worker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/worker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/xhr.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/always/a-tag.http.html63
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/always/fetch.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/always/iframe-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/always/img-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/always/script-tag-dynamic-import.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/always/script-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/always/sharedworker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/always/sharedworker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/always/worker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/always/worker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/always/xhr.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/default/a-tag.http.html63
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/default/fetch.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/default/iframe-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/default/img-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/default/script-tag-dynamic-import.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/default/script-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/default/sharedworker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/default/sharedworker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/default/worker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/default/worker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/default/xhr.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/never/a-tag.http.html63
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/never/fetch.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/never/iframe-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/never/img-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/never/script-tag-dynamic-import.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/never/script-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/never/sharedworker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/never/sharedworker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/never/worker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/never/worker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/never/xhr.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/a-tag.http.html63
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/fetch.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/iframe-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/img-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/script-tag-dynamic-import.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/script-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/sharedworker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/sharedworker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/worker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/worker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/xhr.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/a-tag.http.html63
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/fetch.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/iframe-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/img-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/script-tag-dynamic-import.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/script-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/sharedworker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/sharedworker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/worker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/worker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/xhr.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/a-tag.http.html63
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/fetch.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/iframe-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/img-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/script-tag-dynamic-import.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/script-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/sharedworker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/sharedworker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/worker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/worker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/xhr.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/a-tag.http.html63
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/fetch.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/iframe-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/img-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/script-tag-dynamic-import.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/script-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/sharedworker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/sharedworker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/worker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/worker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/xhr.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin/a-tag.http.html63
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin/fetch.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin/iframe-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin/img-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin/script-tag-dynamic-import.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin/script-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin/sharedworker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin/sharedworker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin/worker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin/worker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/origin/xhr.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/a-tag.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/fetch.http.html123
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/iframe-tag.http.html123
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/img-tag.http.html123
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/script-tag-dynamic-import.http.html123
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/script-tag.http.html123
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/sharedworker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/sharedworker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/worker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/worker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/xhr.http.html123
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/a-tag.http.html63
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/fetch.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/iframe-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/img-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/script-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/sharedworker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/worker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/worker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/xhr.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/a-tag.http.html63
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/fetch.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/iframe-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/img-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/script-tag-dynamic-import.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/script-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/sharedworker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/sharedworker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/worker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/worker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/xhr.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/a-tag.http.html63
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/fetch.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/iframe-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/img-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/script-tag-dynamic-import.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/script-tag.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/sharedworker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/sharedworker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/worker-classic.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/worker-module.http.html43
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/xhr.http.html143
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unset/a-tag.http.html62
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unset/fetch.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unset/iframe-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unset/img-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unset/script-tag-dynamic-import.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unset/script-tag.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unset/sharedworker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unset/sharedworker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unset/worker-classic.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unset/worker-module.http.html42
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/top.meta/unset/xhr.http.html142
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/fetch.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/xhr.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/fetch.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/xhr.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/fetch.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/xhr.http.html233
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/fetch.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/worker-classic.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/worker-module.http.html65
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/xhr.http.html275
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/fetch.http.html203
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/worker-classic.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/worker-module.http.html53
-rw-r--r--testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/xhr.http.html203
1083 files changed, 129328 insertions, 0 deletions
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/a-tag.http.html
new file mode 100644
index 0000000000..f1f2922073
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/fetch.http.html
new file mode 100644
index 0000000000..b7e0f595f2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/iframe-tag.http.html
new file mode 100644
index 0000000000..d5bfd2b50a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/img-tag.http.html
new file mode 100644
index 0000000000..c324e8cd7e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/script-tag.http.html
new file mode 100644
index 0000000000..4d57f8c26a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html
new file mode 100644
index 0000000000..22eb1e2954
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html
new file mode 100644
index 0000000000..4508b27090
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/worker-classic.http.html
new file mode 100644
index 0000000000..436592e04f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/worker-module.http.html
new file mode 100644
index 0000000000..467bedf744
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/xhr.http.html
new file mode 100644
index 0000000000..4d19f48f8a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer-when-downgrade/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/a-tag.http.html
new file mode 100644
index 0000000000..decbbda04c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/fetch.http.html
new file mode 100644
index 0000000000..d523a3109f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/iframe-tag.http.html
new file mode 100644
index 0000000000..7761fb304d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/img-tag.http.html
new file mode 100644
index 0000000000..f71ded5fb6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/script-tag.http.html
new file mode 100644
index 0000000000..5430b987e1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/sharedworker-classic.http.html
new file mode 100644
index 0000000000..0995bcdb0a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/sharedworker-module.http.html
new file mode 100644
index 0000000000..2991201b1d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/worker-classic.http.html
new file mode 100644
index 0000000000..538136079f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/worker-module.http.html
new file mode 100644
index 0000000000..44427600d9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/xhr.http.html
new file mode 100644
index 0000000000..ab624c0248
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/no-referrer/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..e4c0a46454
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..c7726795b0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..3b9e56daf6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..9390e76dc3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..e47e3756f9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..382da887af
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..103c19e599
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..66e2049df2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..0ad84cd003
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..f2d5d14f43
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/a-tag.http.html
new file mode 100644
index 0000000000..8f72f1e49e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/fetch.http.html
new file mode 100644
index 0000000000..6783464cb0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/iframe-tag.http.html
new file mode 100644
index 0000000000..33fdbb165a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/img-tag.http.html
new file mode 100644
index 0000000000..643d67642c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/script-tag.http.html
new file mode 100644
index 0000000000..369c51249c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..55bee06493
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..86b6fa4378
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/worker-classic.http.html
new file mode 100644
index 0000000000..257f3d7979
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/worker-module.http.html
new file mode 100644
index 0000000000..fb5d2dbd4e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/xhr.http.html
new file mode 100644
index 0000000000..6f8e94468f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/a-tag.http.html
new file mode 100644
index 0000000000..eeaa4336fa
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/a-tag.http.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/fetch.http.html
new file mode 100644
index 0000000000..7e27bcf458
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/fetch.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..556c02fced
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/iframe-tag.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/img-tag.http.html
new file mode 100644
index 0000000000..a1c21c7879
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/img-tag.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/script-tag.http.html
new file mode 100644
index 0000000000..1482e6ab23
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/script-tag.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..950a1d4d25
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..f016f91d5e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/worker-classic.http.html
new file mode 100644
index 0000000000..cf70c87048
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/worker-module.http.html
new file mode 100644
index 0000000000..5e4d368767
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/xhr.http.html
new file mode 100644
index 0000000000..95d8d350bb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/same-origin/xhr.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..525bfa27f2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..ebef571be7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..63e090472c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..abad45992b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..733005e56c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..e0bba29ee7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..82a82e00df
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..9491e8be2f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..a15bda3e1d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..c8cd8582d4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/a-tag.http.html
new file mode 100644
index 0000000000..13c7c76c22
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/fetch.http.html
new file mode 100644
index 0000000000..dec9d7a970
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..5a491f1ba4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/img-tag.http.html
new file mode 100644
index 0000000000..f6f1ff0a60
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/script-tag.http.html
new file mode 100644
index 0000000000..589dc4c12c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..3d10da188f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..52212670b9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/worker-classic.http.html
new file mode 100644
index 0000000000..d23ebf7dad
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/worker-module.http.html
new file mode 100644
index 0000000000..93daddf304
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/xhr.http.html
new file mode 100644
index 0000000000..be9b71f695
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/strict-origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/a-tag.http.html
new file mode 100644
index 0000000000..34a7a49e7c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/fetch.http.html
new file mode 100644
index 0000000000..21cd62f1e8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/iframe-tag.http.html
new file mode 100644
index 0000000000..8ba4ffabf0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/img-tag.http.html
new file mode 100644
index 0000000000..092fd4fc4d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/script-tag.http.html
new file mode 100644
index 0000000000..4d50b3b90c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/sharedworker-classic.http.html
new file mode 100644
index 0000000000..952dc99dd2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/sharedworker-module.http.html
new file mode 100644
index 0000000000..6712399a63
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/worker-classic.http.html
new file mode 100644
index 0000000000..4bc6031699
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/worker-module.http.html
new file mode 100644
index 0000000000..05f15a98e9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/xhr.http.html
new file mode 100644
index 0000000000..1d28925229
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unsafe-url/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/a-tag.http.html
new file mode 100644
index 0000000000..97ecbd9b1c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/a-tag.http.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/fetch.http.html
new file mode 100644
index 0000000000..c9e6568b4e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/fetch.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/iframe-tag.http.html
new file mode 100644
index 0000000000..8899ecd0c6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/iframe-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/img-tag.http.html
new file mode 100644
index 0000000000..26c803da6b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/img-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/script-tag.http.html
new file mode 100644
index 0000000000..96c068d050
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/script-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/sharedworker-classic.http.html
new file mode 100644
index 0000000000..8ed80c689c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/sharedworker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/sharedworker-module.http.html
new file mode 100644
index 0000000000..c5b8979ba0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/sharedworker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/worker-classic.http.html
new file mode 100644
index 0000000000..de239fa7de
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/worker-module.http.html
new file mode 100644
index 0000000000..05d0a51b7c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/xhr.http.html
new file mode 100644
index 0000000000..eee8742db8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.http-rp/unset/xhr.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/a-tag.http.html
new file mode 100644
index 0000000000..a65ec53be5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/fetch.http.html
new file mode 100644
index 0000000000..e6de7f582d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/iframe-tag.http.html
new file mode 100644
index 0000000000..42033e0058
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/img-tag.http.html
new file mode 100644
index 0000000000..8a8ee984bd
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/script-tag.http.html
new file mode 100644
index 0000000000..741a2c7b35
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/sharedworker-classic.http.html
new file mode 100644
index 0000000000..f9af6ab048
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/sharedworker-module.http.html
new file mode 100644
index 0000000000..d20abe31a9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/worker-classic.http.html
new file mode 100644
index 0000000000..9d2cbf8adf
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/worker-module.http.html
new file mode 100644
index 0000000000..d8701d4ea3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/xhr.http.html
new file mode 100644
index 0000000000..e033f39fdc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/always/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/a-tag.http.html
new file mode 100644
index 0000000000..ae680fcec0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/fetch.http.html
new file mode 100644
index 0000000000..22fa9ead9a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/iframe-tag.http.html
new file mode 100644
index 0000000000..7fb374c8d1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/img-tag.http.html
new file mode 100644
index 0000000000..f6c6c530c5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/script-tag.http.html
new file mode 100644
index 0000000000..da1b5d8cae
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/sharedworker-classic.http.html
new file mode 100644
index 0000000000..4b82a771dc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/sharedworker-module.http.html
new file mode 100644
index 0000000000..19f1cf60d6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/worker-classic.http.html
new file mode 100644
index 0000000000..2c19e4c054
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/worker-module.http.html
new file mode 100644
index 0000000000..35c2a6fa7c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/xhr.http.html
new file mode 100644
index 0000000000..9e5f49f12d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/default/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/a-tag.http.html
new file mode 100644
index 0000000000..e7b5d1b64f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/fetch.http.html
new file mode 100644
index 0000000000..faeee3f6c2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/iframe-tag.http.html
new file mode 100644
index 0000000000..bb7e1d606b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/img-tag.http.html
new file mode 100644
index 0000000000..b2da662702
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/script-tag.http.html
new file mode 100644
index 0000000000..a249520b24
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/sharedworker-classic.http.html
new file mode 100644
index 0000000000..374308e681
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/sharedworker-module.http.html
new file mode 100644
index 0000000000..b02d886a34
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/worker-classic.http.html
new file mode 100644
index 0000000000..b3cad71141
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/worker-module.http.html
new file mode 100644
index 0000000000..d87a97bd06
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/xhr.http.html
new file mode 100644
index 0000000000..b11b3acf3d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/never/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/a-tag.http.html
new file mode 100644
index 0000000000..deb63be21a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/fetch.http.html
new file mode 100644
index 0000000000..1bbe96a03f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/iframe-tag.http.html
new file mode 100644
index 0000000000..bd12e55ae2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/img-tag.http.html
new file mode 100644
index 0000000000..0c677d87ea
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/script-tag.http.html
new file mode 100644
index 0000000000..89c885b592
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/sharedworker-classic.http.html
new file mode 100644
index 0000000000..95adb13832
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/sharedworker-module.http.html
new file mode 100644
index 0000000000..cf3974a868
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/worker-classic.http.html
new file mode 100644
index 0000000000..4b66b592c0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/worker-module.http.html
new file mode 100644
index 0000000000..7cbd326507
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/xhr.http.html
new file mode 100644
index 0000000000..994f33f707
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer-when-downgrade/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/a-tag.http.html
new file mode 100644
index 0000000000..83efe8b9b0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/fetch.http.html
new file mode 100644
index 0000000000..b01056da7d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/iframe-tag.http.html
new file mode 100644
index 0000000000..15a8b4b7de
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/img-tag.http.html
new file mode 100644
index 0000000000..16682a9983
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/script-tag.http.html
new file mode 100644
index 0000000000..41d4e9053d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/sharedworker-classic.http.html
new file mode 100644
index 0000000000..00f15c8eed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/sharedworker-module.http.html
new file mode 100644
index 0000000000..fb40728d89
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/worker-classic.http.html
new file mode 100644
index 0000000000..6cb42b49b0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/worker-module.http.html
new file mode 100644
index 0000000000..660e8a16e7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/xhr.http.html
new file mode 100644
index 0000000000..208e7ad99d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/no-referrer/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..891ca32754
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..e6d25e441e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..29fef75d8d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..9cf05a057f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..a540a3bafe
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..43c13d83eb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..ddfd6426f3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..241dc980f4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..e147f59bf5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..bd9f0b2b14
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/a-tag.http.html
new file mode 100644
index 0000000000..f1459d1766
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/fetch.http.html
new file mode 100644
index 0000000000..9f041993b8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/iframe-tag.http.html
new file mode 100644
index 0000000000..d667fa4676
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/img-tag.http.html
new file mode 100644
index 0000000000..3e19c51539
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/script-tag.http.html
new file mode 100644
index 0000000000..27793d0dcd
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..156afd1808
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/sharedworker-module.http.html
new file mode 100644
index 0000000000..0cf897ac1e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/worker-classic.http.html
new file mode 100644
index 0000000000..9ec0e33e85
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/worker-module.http.html
new file mode 100644
index 0000000000..c59dc431bd
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/xhr.http.html
new file mode 100644
index 0000000000..bdd1396c27
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin-when-crossorigin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/a-tag.http.html
new file mode 100644
index 0000000000..62d0f44803
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/fetch.http.html
new file mode 100644
index 0000000000..7f9be9aede
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/iframe-tag.http.html
new file mode 100644
index 0000000000..2c4e96aa9b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/img-tag.http.html
new file mode 100644
index 0000000000..77839c9a51
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/script-tag.http.html
new file mode 100644
index 0000000000..dae76da803
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..0133ac9786
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..64ee46076f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/worker-classic.http.html
new file mode 100644
index 0000000000..63805dab89
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/worker-module.http.html
new file mode 100644
index 0000000000..0ebd247241
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/xhr.http.html
new file mode 100644
index 0000000000..6a4323f310
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/a-tag.http.html
new file mode 100644
index 0000000000..5e50fe89cc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/a-tag.http.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/fetch.http.html
new file mode 100644
index 0000000000..f5a1f7d1b4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/fetch.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..66e0f443bb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/iframe-tag.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/img-tag.http.html
new file mode 100644
index 0000000000..45bacb839c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/img-tag.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/script-tag.http.html
new file mode 100644
index 0000000000..93217fd44f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/script-tag.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..f6331974b7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..98f95f3e3a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/worker-classic.http.html
new file mode 100644
index 0000000000..507da7d135
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/worker-module.http.html
new file mode 100644
index 0000000000..e7ad360c75
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/xhr.http.html
new file mode 100644
index 0000000000..d055d5219d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/same-origin/xhr.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..39e014a2a3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..4d755203cb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..24f7501a52
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..bfca98186a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..9439b38c6b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..e9fce3f6ae
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..5eedb0e5ec
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..94056e21e9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..ba84318dce
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..4a6528a837
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/a-tag.http.html
new file mode 100644
index 0000000000..0bb27ab203
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/fetch.http.html
new file mode 100644
index 0000000000..8c87e439b7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..2d01d0d361
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/img-tag.http.html
new file mode 100644
index 0000000000..9d1d14001d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/script-tag.http.html
new file mode 100644
index 0000000000..3f7449f610
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..53ac6fa0b5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..e177c83ca3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/worker-classic.http.html
new file mode 100644
index 0000000000..a444e9c7eb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/worker-module.http.html
new file mode 100644
index 0000000000..fd10693da1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/xhr.http.html
new file mode 100644
index 0000000000..0cf1f23011
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/strict-origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/a-tag.http.html
new file mode 100644
index 0000000000..64cec3d0cf
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/fetch.http.html
new file mode 100644
index 0000000000..084ed268e1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/iframe-tag.http.html
new file mode 100644
index 0000000000..a4d49315e5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/img-tag.http.html
new file mode 100644
index 0000000000..b318a37f90
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/script-tag.http.html
new file mode 100644
index 0000000000..90ace4d25e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/sharedworker-classic.http.html
new file mode 100644
index 0000000000..03d5c1fb71
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/sharedworker-module.http.html
new file mode 100644
index 0000000000..d66916330c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/worker-classic.http.html
new file mode 100644
index 0000000000..25c993511e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/worker-module.http.html
new file mode 100644
index 0000000000..811b0f2c3f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/xhr.http.html
new file mode 100644
index 0000000000..4e367197fd
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unsafe-url/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/a-tag.http.html
new file mode 100644
index 0000000000..97ecbd9b1c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/a-tag.http.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/fetch.http.html
new file mode 100644
index 0000000000..c9e6568b4e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/fetch.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/iframe-tag.http.html
new file mode 100644
index 0000000000..8899ecd0c6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/iframe-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/img-tag.http.html
new file mode 100644
index 0000000000..26c803da6b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/img-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/script-tag.http.html
new file mode 100644
index 0000000000..96c068d050
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/script-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/sharedworker-classic.http.html
new file mode 100644
index 0000000000..8ed80c689c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/sharedworker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/sharedworker-module.http.html
new file mode 100644
index 0000000000..c5b8979ba0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/sharedworker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/worker-classic.http.html
new file mode 100644
index 0000000000..de239fa7de
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/worker-module.http.html
new file mode 100644
index 0000000000..05d0a51b7c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/xhr.http.html
new file mode 100644
index 0000000000..eee8742db8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/iframe.meta/unset/xhr.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "iframe"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/a-tag.http.html
new file mode 100644
index 0000000000..ae516266c8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/a-tag.http.html
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/iframe-tag.http.html
new file mode 100644
index 0000000000..90cc69bdb5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/iframe-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/img-tag.http.html
new file mode 100644
index 0000000000..67d0496aee
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/img-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..809bb23ef6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/script-tag-dynamic-import.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/script-tag.http.html
new file mode 100644
index 0000000000..847cc79171
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer-when-downgrade/script-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/a-tag.http.html
new file mode 100644
index 0000000000..ab7cd57f3d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/a-tag.http.html
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/iframe-tag.http.html
new file mode 100644
index 0000000000..e9dfa7da6d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/iframe-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/img-tag.http.html
new file mode 100644
index 0000000000..61fecbcb0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/img-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..a362bbbcb6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/script-tag-dynamic-import.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/script-tag.http.html
new file mode 100644
index 0000000000..1e23802ced
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/no-referrer/script-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..15d69f5f5c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..e6a685a320
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..1dacc8b082
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..f4a932e07e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/script-tag-dynamic-import.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..6130676892
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin/a-tag.http.html
new file mode 100644
index 0000000000..5fcb8420dc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin/a-tag.http.html
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin/iframe-tag.http.html
new file mode 100644
index 0000000000..7f8a5779ff
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin/iframe-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin/img-tag.http.html
new file mode 100644
index 0000000000..b0257fce6b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin/img-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/origin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..5d28404865
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin/script-tag-dynamic-import.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin/script-tag.http.html
new file mode 100644
index 0000000000..208f3af38e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/origin/script-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/a-tag.http.html
new file mode 100644
index 0000000000..049c25897a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/a-tag.http.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..9d117a12f7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/iframe-tag.http.html
@@ -0,0 +1,183 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/img-tag.http.html
new file mode 100644
index 0000000000..2008858276
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/img-tag.http.html
@@ -0,0 +1,183 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..1b35dd4b35
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/script-tag-dynamic-import.http.html
@@ -0,0 +1,183 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/script-tag.http.html
new file mode 100644
index 0000000000..dfc67c6a1f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/same-origin/script-tag.http.html
@@ -0,0 +1,183 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..7522380a0f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..bf5e1eaf14
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..b16783a5fa
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..f880f0c3b9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..db85e3a8e8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/a-tag.http.html
new file mode 100644
index 0000000000..aad8328e33
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/a-tag.http.html
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..bbf242b590
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/iframe-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/img-tag.http.html
new file mode 100644
index 0000000000..a5a957d78d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/img-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..f7899fd6e4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/script-tag-dynamic-import.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/script-tag.http.html
new file mode 100644
index 0000000000..75d6afdffb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/strict-origin/script-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/a-tag.http.html
new file mode 100644
index 0000000000..04e590c37e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/a-tag.http.html
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/iframe-tag.http.html
new file mode 100644
index 0000000000..4c2a09f18a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/iframe-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/img-tag.http.html
new file mode 100644
index 0000000000..b1053ab0e2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/img-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..a944f1e74c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/script-tag-dynamic-import.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/script-tag.http.html
new file mode 100644
index 0000000000..51b0db7d1a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.attr/unsafe-url/script-tag.http.html
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "attr",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/req.rel-noref/no-referrer/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/req.rel-noref/no-referrer/a-tag.http.html
new file mode 100644
index 0000000000..0205df0cde
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/req.rel-noref/no-referrer/a-tag.http.html
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "rel-noref",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "rel-noref",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "rel-noref",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [
+ {
+ "deliveryType": "rel-noref",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/a-tag.http.html
new file mode 100644
index 0000000000..c00ba92de5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/a-tag.http.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/a-tag.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/fetch.http.html
new file mode 100644
index 0000000000..ed3bc61f01
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/fetch.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/fetch.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/iframe-tag.http.html
new file mode 100644
index 0000000000..a4fb7d8629
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/iframe-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/img-tag.http.html
new file mode 100644
index 0000000000..948089af7e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/img-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/img-tag.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/script-tag.http.html
new file mode 100644
index 0000000000..5d152c996a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/script-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/script-tag.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html
new file mode 100644
index 0000000000..de1c533bfc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html
new file mode 100644
index 0000000000..c088ac04d7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-classic.http.html
new file mode 100644
index 0000000000..8433c4d9df
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-classic.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-module.http.html
new file mode 100644
index 0000000000..bc0657d31c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-module.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/xhr.http.html
new file mode 100644
index 0000000000..20d3eb1ff8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/xhr.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/xhr.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer-when-downgrade/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/a-tag.http.html
new file mode 100644
index 0000000000..f9fada238b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/a-tag.http.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/a-tag.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/fetch.http.html
new file mode 100644
index 0000000000..8bc2cf3b06
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/fetch.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/fetch.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/iframe-tag.http.html
new file mode 100644
index 0000000000..555121b533
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/iframe-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/img-tag.http.html
new file mode 100644
index 0000000000..8fe04405ce
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/img-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/img-tag.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/script-tag.http.html
new file mode 100644
index 0000000000..08bc808964
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/script-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/script-tag.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-classic.http.html
new file mode 100644
index 0000000000..4812eb7a2e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-module.http.html
new file mode 100644
index 0000000000..5e773eaa9f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-classic.http.html
new file mode 100644
index 0000000000..cadb0206d8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-classic.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-module.http.html
new file mode 100644
index 0000000000..05f2660923
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-module.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/xhr.http.html
new file mode 100644
index 0000000000..529b7646c8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/xhr.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/xhr.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/no-referrer/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..6ed5f3bb75
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/a-tag.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..6ce6800ed1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/fetch.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..6a0c528686
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..aed278716d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/img-tag.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..74212a61fb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/script-tag.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..de1c533bfc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..c088ac04d7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..8433c4d9df
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-classic.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..bc0657d31c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-module.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..a54c8dec65
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/xhr.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin-when-cross-origin/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/a-tag.http.html
new file mode 100644
index 0000000000..5f24860f17
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/a-tag.http.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/a-tag.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/fetch.http.html
new file mode 100644
index 0000000000..75e1bac179
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/fetch.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/fetch.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/iframe-tag.http.html
new file mode 100644
index 0000000000..8e40188f6c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/iframe-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/img-tag.http.html
new file mode 100644
index 0000000000..21013c61e4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/img-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/img-tag.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/script-tag.http.html
new file mode 100644
index 0000000000..3e542dbb59
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/script-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/script-tag.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..d10a631c99
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..5bd7631966
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-classic.http.html
new file mode 100644
index 0000000000..3a901d4df9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-classic.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-module.http.html
new file mode 100644
index 0000000000..35cbe42e1c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-module.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/xhr.http.html
new file mode 100644
index 0000000000..0e691f8079
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/xhr.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/xhr.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/origin/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/a-tag.http.html
new file mode 100644
index 0000000000..4722bc8f92
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/a-tag.http.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/a-tag.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/fetch.http.html
new file mode 100644
index 0000000000..ca88a138c0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/fetch.http.html
@@ -0,0 +1,172 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/fetch.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..a95cfde13a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/iframe-tag.http.html
@@ -0,0 +1,172 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/img-tag.http.html
new file mode 100644
index 0000000000..81c06823b6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/img-tag.http.html
@@ -0,0 +1,172 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/img-tag.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/script-tag.http.html
new file mode 100644
index 0000000000..450ebffcc0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/script-tag.http.html
@@ -0,0 +1,172 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/script-tag.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..de1c533bfc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..c088ac04d7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-classic.http.html
new file mode 100644
index 0000000000..8433c4d9df
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-classic.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-module.http.html
new file mode 100644
index 0000000000..bc0657d31c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-module.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/xhr.http.html
new file mode 100644
index 0000000000..9069ca9924
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/xhr.http.html
@@ -0,0 +1,172 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/xhr.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/same-origin/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..6ed5f3bb75
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/a-tag.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..6ce6800ed1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/fetch.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..6a0c528686
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..aed278716d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/img-tag.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..74212a61fb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/script-tag.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..de1c533bfc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..c088ac04d7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..8433c4d9df
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-classic.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..bc0657d31c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-module.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..a54c8dec65
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/xhr.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin-when-cross-origin/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/a-tag.http.html
new file mode 100644
index 0000000000..5f24860f17
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/a-tag.http.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/a-tag.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/fetch.http.html
new file mode 100644
index 0000000000..75e1bac179
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/fetch.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/fetch.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..8e40188f6c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/iframe-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/img-tag.http.html
new file mode 100644
index 0000000000..21013c61e4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/img-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/img-tag.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/script-tag.http.html
new file mode 100644
index 0000000000..3e542dbb59
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/script-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/script-tag.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..d10a631c99
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..5bd7631966
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-classic.http.html
new file mode 100644
index 0000000000..3a901d4df9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-classic.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-module.http.html
new file mode 100644
index 0000000000..35cbe42e1c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-module.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/xhr.http.html
new file mode 100644
index 0000000000..0e691f8079
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/xhr.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/xhr.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/strict-origin/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/a-tag.http.html
new file mode 100644
index 0000000000..c00ba92de5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/a-tag.http.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/a-tag.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/fetch.http.html
new file mode 100644
index 0000000000..ed3bc61f01
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/fetch.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/fetch.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/iframe-tag.http.html
new file mode 100644
index 0000000000..a4fb7d8629
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/iframe-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/img-tag.http.html
new file mode 100644
index 0000000000..948089af7e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/img-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/img-tag.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/script-tag.http.html
new file mode 100644
index 0000000000..5d152c996a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/script-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/script-tag.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-classic.http.html
new file mode 100644
index 0000000000..de1c533bfc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-module.http.html
new file mode 100644
index 0000000000..c088ac04d7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-classic.http.html
new file mode 100644
index 0000000000..8433c4d9df
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-classic.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-module.http.html
new file mode 100644
index 0000000000..bc0657d31c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-module.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/xhr.http.html
new file mode 100644
index 0000000000..20d3eb1ff8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/xhr.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/xhr.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unsafe-url/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/a-tag.http.html
new file mode 100644
index 0000000000..6ed5f3bb75
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/a-tag.http.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/fetch.http.html
new file mode 100644
index 0000000000..6ce6800ed1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/fetch.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/iframe-tag.http.html
new file mode 100644
index 0000000000..6a0c528686
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/iframe-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/img-tag.http.html
new file mode 100644
index 0000000000..aed278716d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/img-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/script-tag.http.html
new file mode 100644
index 0000000000..74212a61fb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/script-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/sharedworker-classic.http.html
new file mode 100644
index 0000000000..de1c533bfc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/sharedworker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/sharedworker-module.http.html
new file mode 100644
index 0000000000..c088ac04d7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/sharedworker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/worker-classic.http.html
new file mode 100644
index 0000000000..8433c4d9df
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/worker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/worker-module.http.html
new file mode 100644
index 0000000000..bc0657d31c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/worker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/xhr.http.html
new file mode 100644
index 0000000000..a54c8dec65
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.http-rp/unset/xhr.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/a-tag.http.html
new file mode 100644
index 0000000000..820d4cf0ec
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/a-tag.http.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/fetch.http.html
new file mode 100644
index 0000000000..1fcc0e5006
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/fetch.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/iframe-tag.http.html
new file mode 100644
index 0000000000..7f28cc13da
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/iframe-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/img-tag.http.html
new file mode 100644
index 0000000000..eb2d519ce5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/img-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/script-tag.http.html
new file mode 100644
index 0000000000..1167cfd125
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/script-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/sharedworker-classic.http.html
new file mode 100644
index 0000000000..67972ef771
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/sharedworker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/sharedworker-module.http.html
new file mode 100644
index 0000000000..ee76c6c122
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/sharedworker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/worker-classic.http.html
new file mode 100644
index 0000000000..fe9c6561ba
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/worker-module.http.html
new file mode 100644
index 0000000000..f834ecc6ae
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/xhr.http.html
new file mode 100644
index 0000000000..e6bf9e04f9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/always/xhr.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/a-tag.http.html
new file mode 100644
index 0000000000..e74fad3b63
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/a-tag.http.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/fetch.http.html
new file mode 100644
index 0000000000..e71aabe8d6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/fetch.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/iframe-tag.http.html
new file mode 100644
index 0000000000..99cf044f15
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/iframe-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/img-tag.http.html
new file mode 100644
index 0000000000..0075dd051c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/img-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/script-tag.http.html
new file mode 100644
index 0000000000..e0cdcf4ff9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/script-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/sharedworker-classic.http.html
new file mode 100644
index 0000000000..3351a49e1c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/sharedworker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/sharedworker-module.http.html
new file mode 100644
index 0000000000..b8d5044bc7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/sharedworker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/worker-classic.http.html
new file mode 100644
index 0000000000..5e3ffcaf23
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/worker-module.http.html
new file mode 100644
index 0000000000..1b5a55cdb2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/xhr.http.html
new file mode 100644
index 0000000000..0cdbf28b42
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/default/xhr.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/a-tag.http.html
new file mode 100644
index 0000000000..7555f25db8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/a-tag.http.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/fetch.http.html
new file mode 100644
index 0000000000..29a849cbbd
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/fetch.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/iframe-tag.http.html
new file mode 100644
index 0000000000..d6a0c4f31c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/iframe-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/img-tag.http.html
new file mode 100644
index 0000000000..b6eef75566
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/img-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/script-tag.http.html
new file mode 100644
index 0000000000..b9be802312
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/script-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/sharedworker-classic.http.html
new file mode 100644
index 0000000000..1ccc8b7a15
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/sharedworker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/sharedworker-module.http.html
new file mode 100644
index 0000000000..fd201609c8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/sharedworker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/worker-classic.http.html
new file mode 100644
index 0000000000..55357061f7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/worker-module.http.html
new file mode 100644
index 0000000000..bf397f451f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/xhr.http.html
new file mode 100644
index 0000000000..2ef0d4738c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/never/xhr.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/a-tag.http.html
new file mode 100644
index 0000000000..f99b8ab039
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/a-tag.http.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/fetch.http.html
new file mode 100644
index 0000000000..b0843010b7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/fetch.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/iframe-tag.http.html
new file mode 100644
index 0000000000..70b6f86033
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/iframe-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/img-tag.http.html
new file mode 100644
index 0000000000..5d74b8662e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/img-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/script-tag.http.html
new file mode 100644
index 0000000000..9ad1c79169
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/script-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/sharedworker-classic.http.html
new file mode 100644
index 0000000000..3942d10b63
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/sharedworker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/sharedworker-module.http.html
new file mode 100644
index 0000000000..b97f3311f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/sharedworker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/worker-classic.http.html
new file mode 100644
index 0000000000..0cd0c64765
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/worker-module.http.html
new file mode 100644
index 0000000000..e163e858d0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/xhr.http.html
new file mode 100644
index 0000000000..70aee4ec28
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer-when-downgrade/xhr.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/a-tag.http.html
new file mode 100644
index 0000000000..36beb5760f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/a-tag.http.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/fetch.http.html
new file mode 100644
index 0000000000..ed6e1c7e0c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/fetch.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/iframe-tag.http.html
new file mode 100644
index 0000000000..edd06e5c02
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/iframe-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/img-tag.http.html
new file mode 100644
index 0000000000..9395c93073
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/img-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/script-tag.http.html
new file mode 100644
index 0000000000..0d253b26ea
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/script-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/sharedworker-classic.http.html
new file mode 100644
index 0000000000..106c33c0af
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/sharedworker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/sharedworker-module.http.html
new file mode 100644
index 0000000000..b14eecdd68
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/sharedworker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/worker-classic.http.html
new file mode 100644
index 0000000000..e939ffff98
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/worker-module.http.html
new file mode 100644
index 0000000000..fb3fba8ef6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/xhr.http.html
new file mode 100644
index 0000000000..b8a8134149
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/no-referrer/xhr.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..44879f5d1f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..0142222032
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..cc80c5b686
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..5aae8d8106
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..0cbe39c632
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..6e5f40d542
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/sharedworker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..bc8914ff1b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/sharedworker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..ebbde3683b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..55eb25bc24
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..d5ecdddf67
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/a-tag.http.html
new file mode 100644
index 0000000000..71b8965db0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/a-tag.http.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/fetch.http.html
new file mode 100644
index 0000000000..c1baef7000
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/fetch.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/iframe-tag.http.html
new file mode 100644
index 0000000000..7a76a2723d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/iframe-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/img-tag.http.html
new file mode 100644
index 0000000000..689b775fa8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/img-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/script-tag.http.html
new file mode 100644
index 0000000000..a8a9b08e9a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/script-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..def1c27922
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/sharedworker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/sharedworker-module.http.html
new file mode 100644
index 0000000000..d647061a27
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/sharedworker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/worker-classic.http.html
new file mode 100644
index 0000000000..413a7923d5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/worker-module.http.html
new file mode 100644
index 0000000000..710457c5f0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/xhr.http.html
new file mode 100644
index 0000000000..b8b6e257be
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin-when-crossorigin/xhr.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/a-tag.http.html
new file mode 100644
index 0000000000..53d4decc35
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/a-tag.http.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/fetch.http.html
new file mode 100644
index 0000000000..2bb4704f45
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/fetch.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/iframe-tag.http.html
new file mode 100644
index 0000000000..97d69ffe1c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/iframe-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/img-tag.http.html
new file mode 100644
index 0000000000..ba49c9c8dd
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/img-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/script-tag.http.html
new file mode 100644
index 0000000000..d1eb996cc6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/script-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..972f0c0507
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/sharedworker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..1cbe83cc0a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/sharedworker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/worker-classic.http.html
new file mode 100644
index 0000000000..d90cdc4fbe
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/worker-module.http.html
new file mode 100644
index 0000000000..eb55830303
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/xhr.http.html
new file mode 100644
index 0000000000..3e743c30e3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/origin/xhr.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/a-tag.http.html
new file mode 100644
index 0000000000..121fb003b4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/a-tag.http.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/fetch.http.html
new file mode 100644
index 0000000000..9ae62490b4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/fetch.http.html
@@ -0,0 +1,173 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..d197af252e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/iframe-tag.http.html
@@ -0,0 +1,173 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/img-tag.http.html
new file mode 100644
index 0000000000..5745f609da
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/img-tag.http.html
@@ -0,0 +1,173 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/script-tag.http.html
new file mode 100644
index 0000000000..b60fb20b58
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/script-tag.http.html
@@ -0,0 +1,173 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..ef7ecf3652
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/sharedworker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..001be4af97
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/sharedworker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/worker-classic.http.html
new file mode 100644
index 0000000000..58c04ab190
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/worker-module.http.html
new file mode 100644
index 0000000000..32ed0a93dc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/xhr.http.html
new file mode 100644
index 0000000000..924d350cb5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/same-origin/xhr.http.html
@@ -0,0 +1,173 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..c0daad593b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..35d7ea426b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..a7ee5d9e24
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..c769737361
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..76174d3c21
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..8288d86454
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..57477ebed0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/sharedworker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..62330f80d0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..6d3f199365
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..a6829c2b3d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/a-tag.http.html
new file mode 100644
index 0000000000..2c14a70c27
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/a-tag.http.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/fetch.http.html
new file mode 100644
index 0000000000..342365da7f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/fetch.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..be4d7494f5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/iframe-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/img-tag.http.html
new file mode 100644
index 0000000000..94e9835552
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/img-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/script-tag.http.html
new file mode 100644
index 0000000000..4b67d45c7b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/script-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..f77d2607ff
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/sharedworker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..e73467fa7a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/sharedworker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/worker-classic.http.html
new file mode 100644
index 0000000000..9bcc3ab645
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/worker-module.http.html
new file mode 100644
index 0000000000..72e2b97e3b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/xhr.http.html
new file mode 100644
index 0000000000..793fe211db
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/strict-origin/xhr.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/a-tag.http.html
new file mode 100644
index 0000000000..3815612c67
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/a-tag.http.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/fetch.http.html
new file mode 100644
index 0000000000..aee1cef03d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/fetch.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/iframe-tag.http.html
new file mode 100644
index 0000000000..f978f53485
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/iframe-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/img-tag.http.html
new file mode 100644
index 0000000000..df369004ac
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/img-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/script-tag.http.html
new file mode 100644
index 0000000000..62b04cd422
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/script-tag.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/sharedworker-classic.http.html
new file mode 100644
index 0000000000..4403317863
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/sharedworker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/sharedworker-module.http.html
new file mode 100644
index 0000000000..c6b1d19175
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/sharedworker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/worker-classic.http.html
new file mode 100644
index 0000000000..9a10d868f1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/worker-module.http.html
new file mode 100644
index 0000000000..8625bc2be3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/xhr.http.html
new file mode 100644
index 0000000000..b5e6906ca4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unsafe-url/xhr.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/a-tag.http.html
new file mode 100644
index 0000000000..6ed5f3bb75
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/a-tag.http.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/fetch.http.html
new file mode 100644
index 0000000000..6ce6800ed1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/fetch.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/iframe-tag.http.html
new file mode 100644
index 0000000000..6a0c528686
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/iframe-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/img-tag.http.html
new file mode 100644
index 0000000000..aed278716d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/img-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/script-tag.http.html
new file mode 100644
index 0000000000..74212a61fb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/script-tag.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/sharedworker-classic.http.html
new file mode 100644
index 0000000000..de1c533bfc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/sharedworker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/sharedworker-module.http.html
new file mode 100644
index 0000000000..c088ac04d7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/sharedworker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/worker-classic.http.html
new file mode 100644
index 0000000000..8433c4d9df
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/worker-classic.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/worker-module.http.html
new file mode 100644
index 0000000000..bc0657d31c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/worker-module.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/xhr.http.html
new file mode 100644
index 0000000000..a54c8dec65
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc-inherit.meta/unset/xhr.http.html
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/a-tag.http.html
new file mode 100644
index 0000000000..389e3ecba1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/fetch.http.html
new file mode 100644
index 0000000000..2352a04328
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/iframe-tag.http.html
new file mode 100644
index 0000000000..c7db0ab2d7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/img-tag.http.html
new file mode 100644
index 0000000000..504f372655
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/script-tag.http.html
new file mode 100644
index 0000000000..5380552ea2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/sharedworker-classic.http.html
new file mode 100644
index 0000000000..78e8e125f7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/sharedworker-module.http.html
new file mode 100644
index 0000000000..c817b75c55
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/worker-classic.http.html
new file mode 100644
index 0000000000..32ef8f4d4c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/worker-module.http.html
new file mode 100644
index 0000000000..79edc13536
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/xhr.http.html
new file mode 100644
index 0000000000..441a1112a0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/always/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "always"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/a-tag.http.html
new file mode 100644
index 0000000000..19afee2242
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/fetch.http.html
new file mode 100644
index 0000000000..0c2181a856
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/iframe-tag.http.html
new file mode 100644
index 0000000000..26b0e4a658
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/img-tag.http.html
new file mode 100644
index 0000000000..2abc493c05
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/script-tag.http.html
new file mode 100644
index 0000000000..145f663261
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/sharedworker-classic.http.html
new file mode 100644
index 0000000000..5604a6fce3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/sharedworker-module.http.html
new file mode 100644
index 0000000000..a9a5621054
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/worker-classic.http.html
new file mode 100644
index 0000000000..08ed5a397b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/worker-module.http.html
new file mode 100644
index 0000000000..ab2aeae082
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/xhr.http.html
new file mode 100644
index 0000000000..5ec19a8698
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/default/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "default"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/a-tag.http.html
new file mode 100644
index 0000000000..b8cdba4dbe
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/fetch.http.html
new file mode 100644
index 0000000000..96e65d42a2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/iframe-tag.http.html
new file mode 100644
index 0000000000..ce657629a8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/img-tag.http.html
new file mode 100644
index 0000000000..2fc2cfd0e7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/script-tag.http.html
new file mode 100644
index 0000000000..f4c437a29b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/sharedworker-classic.http.html
new file mode 100644
index 0000000000..8e7eeec0d0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/sharedworker-module.http.html
new file mode 100644
index 0000000000..89305f679b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/worker-classic.http.html
new file mode 100644
index 0000000000..7ac7de7d8a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/worker-module.http.html
new file mode 100644
index 0000000000..9b3c0cd669
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/xhr.http.html
new file mode 100644
index 0000000000..35aafae708
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/never/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "never"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/a-tag.http.html
new file mode 100644
index 0000000000..221717fd51
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/fetch.http.html
new file mode 100644
index 0000000000..bacd1b7876
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/iframe-tag.http.html
new file mode 100644
index 0000000000..c9932cc82f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/img-tag.http.html
new file mode 100644
index 0000000000..e67ff90d54
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/script-tag.http.html
new file mode 100644
index 0000000000..d54ad3eadf
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/sharedworker-classic.http.html
new file mode 100644
index 0000000000..28926c71a5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/sharedworker-module.http.html
new file mode 100644
index 0000000000..ab6f539a51
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/worker-classic.http.html
new file mode 100644
index 0000000000..8585ad3ea9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/worker-module.http.html
new file mode 100644
index 0000000000..2e7c9f55db
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/xhr.http.html
new file mode 100644
index 0000000000..839ddcd54f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer-when-downgrade/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/a-tag.http.html
new file mode 100644
index 0000000000..36341adda3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/fetch.http.html
new file mode 100644
index 0000000000..25451f4dde
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/iframe-tag.http.html
new file mode 100644
index 0000000000..c61d37eaf4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/img-tag.http.html
new file mode 100644
index 0000000000..11da083b28
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/script-tag.http.html
new file mode 100644
index 0000000000..2212cb9a0c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/sharedworker-classic.http.html
new file mode 100644
index 0000000000..8a740cf7b0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/sharedworker-module.http.html
new file mode 100644
index 0000000000..b09570e831
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/worker-classic.http.html
new file mode 100644
index 0000000000..4c2dafd3b1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/worker-module.http.html
new file mode 100644
index 0000000000..140ea2da6f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/xhr.http.html
new file mode 100644
index 0000000000..1bbb9c5c75
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/no-referrer/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..55edcd9de8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..d84f175f91
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..4ca1c6a989
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..844c4ae4b2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..51bf97a69f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..13c6acdcf1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..fdd5278b6b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..a76af7cc30
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..068d2cbc93
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..f30c204949
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/a-tag.http.html
new file mode 100644
index 0000000000..c264ee5ff4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/fetch.http.html
new file mode 100644
index 0000000000..4c243cf538
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/iframe-tag.http.html
new file mode 100644
index 0000000000..36133bbfa8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/img-tag.http.html
new file mode 100644
index 0000000000..5fd23123a7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/script-tag.http.html
new file mode 100644
index 0000000000..3be6fef861
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..c4644eefc4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/sharedworker-module.http.html
new file mode 100644
index 0000000000..4b56d2ed14
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/worker-classic.http.html
new file mode 100644
index 0000000000..b6db4e2ab7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/worker-module.http.html
new file mode 100644
index 0000000000..ab6e4e7cb5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/xhr.http.html
new file mode 100644
index 0000000000..1331914271
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin-when-crossorigin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin-when-crossorigin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/a-tag.http.html
new file mode 100644
index 0000000000..fa1c52d316
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/fetch.http.html
new file mode 100644
index 0000000000..76f74a45ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/iframe-tag.http.html
new file mode 100644
index 0000000000..ac0d2d4b5a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/img-tag.http.html
new file mode 100644
index 0000000000..ffb9942b43
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/script-tag.http.html
new file mode 100644
index 0000000000..6ecc61936e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..aef03a0758
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..d75fc7ba6b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/worker-classic.http.html
new file mode 100644
index 0000000000..9536f2d307
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/worker-module.http.html
new file mode 100644
index 0000000000..51bf5ca950
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/xhr.http.html
new file mode 100644
index 0000000000..956e6529aa
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/a-tag.http.html
new file mode 100644
index 0000000000..f0fc5349fe
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/a-tag.http.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/fetch.http.html
new file mode 100644
index 0000000000..332e19f9ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/fetch.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..656f25018c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/iframe-tag.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/img-tag.http.html
new file mode 100644
index 0000000000..acc8899eea
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/img-tag.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/script-tag.http.html
new file mode 100644
index 0000000000..de1ca87708
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/script-tag.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..23deb789aa
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..9f43c4f05b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/worker-classic.http.html
new file mode 100644
index 0000000000..f67a5bc4c4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/worker-module.http.html
new file mode 100644
index 0000000000..0c37eaf6c6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/xhr.http.html
new file mode 100644
index 0000000000..ff82bc85eb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/same-origin/xhr.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..d3a807c97a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..0e866479cc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..0f9000679d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..7bbb7f38b3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..efeef07ca5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..64f9fcb3a6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..23751de3e8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..6489b91daf
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..1a8b22a953
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..f960bd5455
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/a-tag.http.html
new file mode 100644
index 0000000000..66a0fa8080
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/fetch.http.html
new file mode 100644
index 0000000000..502f76d365
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..bff0a0d8f0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/img-tag.http.html
new file mode 100644
index 0000000000..3fee582025
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/script-tag.http.html
new file mode 100644
index 0000000000..2ef902cf34
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..3131640859
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..8bf2c63bcc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/worker-classic.http.html
new file mode 100644
index 0000000000..9b32ab6983
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/worker-module.http.html
new file mode 100644
index 0000000000..0645126e62
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/xhr.http.html
new file mode 100644
index 0000000000..0734df429b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/strict-origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/a-tag.http.html
new file mode 100644
index 0000000000..ca36059a24
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/a-tag.http.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/fetch.http.html
new file mode 100644
index 0000000000..401163abef
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/iframe-tag.http.html
new file mode 100644
index 0000000000..403a67545a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/iframe-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/img-tag.http.html
new file mode 100644
index 0000000000..f06a89ddea
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/img-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/script-tag.http.html
new file mode 100644
index 0000000000..fba1aa8bcc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/script-tag.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/sharedworker-classic.http.html
new file mode 100644
index 0000000000..3ba6d7450d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/sharedworker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/sharedworker-module.http.html
new file mode 100644
index 0000000000..c535aa1e16
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/sharedworker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/worker-classic.http.html
new file mode 100644
index 0000000000..ee2e2a7c6b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/worker-module.http.html
new file mode 100644
index 0000000000..782cadd666
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/xhr.http.html
new file mode 100644
index 0000000000..199ced3e5e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/srcdoc.meta/unsafe-url/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "meta",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "srcdoc"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/a-tag.http.html
new file mode 100644
index 0000000000..67702eb925
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/a-tag.http.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/a-tag.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/fetch.http.html
new file mode 100644
index 0000000000..5c2ed3836d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/fetch.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/fetch.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/iframe-tag.http.html
new file mode 100644
index 0000000000..26d595fcc6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/iframe-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/img-tag.http.html
new file mode 100644
index 0000000000..0827ebde9c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/img-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/img-tag.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..4009fe6a61
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag-dynamic-import.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag-dynamic-import.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag-dynamic-import.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag-dynamic-import.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag.http.html
new file mode 100644
index 0000000000..c5cad6a043
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html
new file mode 100644
index 0000000000..1bc6f04b8c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html
new file mode 100644
index 0000000000..a24ee872ad
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-classic.http.html
new file mode 100644
index 0000000000..7e6e8f3c5f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-classic.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-module.http.html
new file mode 100644
index 0000000000..ae453ee0f0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-module.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/xhr.http.html
new file mode 100644
index 0000000000..b3380b89ba
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/xhr.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/xhr.http.html.headers
new file mode 100644
index 0000000000..180358e691
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer-when-downgrade/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer-when-downgrade
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/a-tag.http.html
new file mode 100644
index 0000000000..29adaac66b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/a-tag.http.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/a-tag.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/fetch.http.html
new file mode 100644
index 0000000000..d6ac45a728
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/fetch.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/fetch.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/iframe-tag.http.html
new file mode 100644
index 0000000000..d39830b579
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/iframe-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/img-tag.http.html
new file mode 100644
index 0000000000..566c3252ec
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/img-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/img-tag.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..25db2c0115
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag-dynamic-import.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag-dynamic-import.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag-dynamic-import.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag-dynamic-import.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag.http.html
new file mode 100644
index 0000000000..63e54ba482
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-classic.http.html
new file mode 100644
index 0000000000..25bbdd1a08
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-module.http.html
new file mode 100644
index 0000000000..5845fa807d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-classic.http.html
new file mode 100644
index 0000000000..7297e57a64
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-classic.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-module.http.html
new file mode 100644
index 0000000000..03fb43a1a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-module.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/xhr.http.html
new file mode 100644
index 0000000000..f80b28b5cb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/xhr.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/xhr.http.html.headers
new file mode 100644
index 0000000000..b3b55087ed
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/no-referrer/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: no-referrer
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..72e159c72e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/a-tag.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..1dfb592eeb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/fetch.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..557d6a5323
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..3987df1518
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/img-tag.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..6444480eb9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag-dynamic-import.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag-dynamic-import.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag-dynamic-import.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag-dynamic-import.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..788c8d04f2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..1bc6f04b8c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..a24ee872ad
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..7e6e8f3c5f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-classic.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..ae453ee0f0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-module.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..866577c336
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/xhr.http.html.headers
new file mode 100644
index 0000000000..a15ea7c65c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin-when-cross-origin/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/a-tag.http.html
new file mode 100644
index 0000000000..496521351a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/a-tag.http.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/a-tag.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/fetch.http.html
new file mode 100644
index 0000000000..b4d0161739
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/fetch.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/fetch.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/iframe-tag.http.html
new file mode 100644
index 0000000000..e2eb629831
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/iframe-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/img-tag.http.html
new file mode 100644
index 0000000000..f0c99d563a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/img-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/img-tag.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..4e754dcebc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag-dynamic-import.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag-dynamic-import.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag-dynamic-import.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag-dynamic-import.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag.http.html
new file mode 100644
index 0000000000..f41884b684
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..24eeee8188
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..ff1170a108
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-classic.http.html
new file mode 100644
index 0000000000..4e9a4c4911
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-classic.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-module.http.html
new file mode 100644
index 0000000000..57ce11f6f9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-module.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/xhr.http.html
new file mode 100644
index 0000000000..e1d6b7a798
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/xhr.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/xhr.http.html.headers
new file mode 100644
index 0000000000..ecff74b90d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/origin/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/a-tag.http.html
new file mode 100644
index 0000000000..563e63e4a0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/a-tag.http.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/a-tag.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/fetch.http.html
new file mode 100644
index 0000000000..bc673974f3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/fetch.http.html
@@ -0,0 +1,122 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/fetch.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..50e3b2e755
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/iframe-tag.http.html
@@ -0,0 +1,122 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/img-tag.http.html
new file mode 100644
index 0000000000..2f106e6e89
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/img-tag.http.html
@@ -0,0 +1,122 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/img-tag.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..4db1827eb3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag-dynamic-import.http.html
@@ -0,0 +1,122 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag-dynamic-import.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag-dynamic-import.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag-dynamic-import.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag.http.html
new file mode 100644
index 0000000000..edb8136c04
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag.http.html
@@ -0,0 +1,122 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..1bc6f04b8c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..a24ee872ad
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-classic.http.html
new file mode 100644
index 0000000000..7e6e8f3c5f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-classic.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-module.http.html
new file mode 100644
index 0000000000..ae453ee0f0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-module.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/xhr.http.html
new file mode 100644
index 0000000000..b28d7e378b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/xhr.http.html
@@ -0,0 +1,122 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/xhr.http.html.headers
new file mode 100644
index 0000000000..be66cf9321
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/same-origin/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: same-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..72e159c72e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/a-tag.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..1dfb592eeb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/fetch.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..557d6a5323
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..3987df1518
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/img-tag.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..6444480eb9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..788c8d04f2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..1bc6f04b8c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..a24ee872ad
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..7e6e8f3c5f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-classic.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..ae453ee0f0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-module.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..866577c336
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/xhr.http.html.headers
new file mode 100644
index 0000000000..4cff1d12f8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin-when-cross-origin/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin-when-cross-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/a-tag.http.html
new file mode 100644
index 0000000000..496521351a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/a-tag.http.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/a-tag.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/fetch.http.html
new file mode 100644
index 0000000000..b4d0161739
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/fetch.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/fetch.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..e2eb629831
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/iframe-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/img-tag.http.html
new file mode 100644
index 0000000000..f0c99d563a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/img-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/img-tag.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..4e754dcebc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag-dynamic-import.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag-dynamic-import.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag-dynamic-import.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag-dynamic-import.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag.http.html
new file mode 100644
index 0000000000..f41884b684
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..24eeee8188
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..ff1170a108
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-classic.http.html
new file mode 100644
index 0000000000..4e9a4c4911
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-classic.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-module.http.html
new file mode 100644
index 0000000000..57ce11f6f9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-module.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/xhr.http.html
new file mode 100644
index 0000000000..e1d6b7a798
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/xhr.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/xhr.http.html.headers
new file mode 100644
index 0000000000..1c32fba5a1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/strict-origin/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: strict-origin
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/a-tag.http.html
new file mode 100644
index 0000000000..67702eb925
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/a-tag.http.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/a-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/a-tag.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/a-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/fetch.http.html
new file mode 100644
index 0000000000..5c2ed3836d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/fetch.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/fetch.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/fetch.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/fetch.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/iframe-tag.http.html
new file mode 100644
index 0000000000..26d595fcc6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/iframe-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/iframe-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/iframe-tag.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/iframe-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/img-tag.http.html
new file mode 100644
index 0000000000..0827ebde9c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/img-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/img-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/img-tag.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/img-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..4009fe6a61
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag-dynamic-import.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag-dynamic-import.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag-dynamic-import.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag-dynamic-import.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag.http.html
new file mode 100644
index 0000000000..c5cad6a043
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/script-tag.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-classic.http.html
new file mode 100644
index 0000000000..1bc6f04b8c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-classic.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-module.http.html
new file mode 100644
index 0000000000..a24ee872ad
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-module.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/sharedworker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-classic.http.html
new file mode 100644
index 0000000000..7e6e8f3c5f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-classic.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-classic.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-classic.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-module.http.html
new file mode 100644
index 0000000000..ae453ee0f0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-module.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-module.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/worker-module.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/xhr.http.html
new file mode 100644
index 0000000000..b3380b89ba
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/xhr.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/xhr.http.html.headers b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/xhr.http.html.headers
new file mode 100644
index 0000000000..c1d3fd1a0b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unsafe-url/xhr.http.html.headers
@@ -0,0 +1,2 @@
+Access-Control-Allow-Origin: *
+Referrer-Policy: unsafe-url
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/a-tag.http.html
new file mode 100644
index 0000000000..72e159c72e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/a-tag.http.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/fetch.http.html
new file mode 100644
index 0000000000..1dfb592eeb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/fetch.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/iframe-tag.http.html
new file mode 100644
index 0000000000..557d6a5323
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/iframe-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/img-tag.http.html
new file mode 100644
index 0000000000..3987df1518
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/img-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..6444480eb9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/script-tag-dynamic-import.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/script-tag.http.html
new file mode 100644
index 0000000000..788c8d04f2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/script-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/sharedworker-classic.http.html
new file mode 100644
index 0000000000..1bc6f04b8c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/sharedworker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/sharedworker-module.http.html
new file mode 100644
index 0000000000..a24ee872ad
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/sharedworker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/worker-classic.http.html
new file mode 100644
index 0000000000..7e6e8f3c5f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/worker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/worker-module.http.html
new file mode 100644
index 0000000000..ae453ee0f0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/worker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/xhr.http.html
new file mode 100644
index 0000000000..866577c336
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.http-rp/unset/xhr.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/always/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/a-tag.http.html
new file mode 100644
index 0000000000..574b17a7cd
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/a-tag.http.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/always/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/fetch.http.html
new file mode 100644
index 0000000000..7554f25fc1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/fetch.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/always/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/iframe-tag.http.html
new file mode 100644
index 0000000000..0461b56427
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/iframe-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/always/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/img-tag.http.html
new file mode 100644
index 0000000000..e211a9cc87
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/img-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/always/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..fb77c5b779
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/script-tag-dynamic-import.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/always/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/script-tag.http.html
new file mode 100644
index 0000000000..d9de64e1d7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/script-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/always/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/sharedworker-classic.http.html
new file mode 100644
index 0000000000..45c5bc5456
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/sharedworker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/always/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/sharedworker-module.http.html
new file mode 100644
index 0000000000..22950273af
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/sharedworker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/always/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/worker-classic.http.html
new file mode 100644
index 0000000000..ac59c72ddb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/worker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/always/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/worker-module.http.html
new file mode 100644
index 0000000000..1a7d3aa9f9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/worker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/always/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/xhr.http.html
new file mode 100644
index 0000000000..db12bea102
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/always/xhr.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="always">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/default/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/a-tag.http.html
new file mode 100644
index 0000000000..21b191652b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/a-tag.http.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/default/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/fetch.http.html
new file mode 100644
index 0000000000..d772f9fb8b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/fetch.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/default/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/iframe-tag.http.html
new file mode 100644
index 0000000000..b71966f54c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/iframe-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/default/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/img-tag.http.html
new file mode 100644
index 0000000000..937aaf515c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/img-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/default/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..b2372322d1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/script-tag-dynamic-import.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/default/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/script-tag.http.html
new file mode 100644
index 0000000000..2795b8a9ab
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/script-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/default/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/sharedworker-classic.http.html
new file mode 100644
index 0000000000..a5dec50421
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/sharedworker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/default/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/sharedworker-module.http.html
new file mode 100644
index 0000000000..8dcac3557f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/sharedworker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/default/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/worker-classic.http.html
new file mode 100644
index 0000000000..10752b889f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/worker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/default/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/worker-module.http.html
new file mode 100644
index 0000000000..b908f84497
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/worker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/default/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/xhr.http.html
new file mode 100644
index 0000000000..0dd95ca584
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/default/xhr.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="default">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/never/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/a-tag.http.html
new file mode 100644
index 0000000000..f15738fa3e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/a-tag.http.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/never/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/fetch.http.html
new file mode 100644
index 0000000000..fc15d5f7f3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/fetch.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/never/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/iframe-tag.http.html
new file mode 100644
index 0000000000..2932078a7b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/iframe-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/never/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/img-tag.http.html
new file mode 100644
index 0000000000..6a69539224
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/img-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/never/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..1b33d88ee7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/script-tag-dynamic-import.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/never/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/script-tag.http.html
new file mode 100644
index 0000000000..b30b9c8e28
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/script-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/never/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/sharedworker-classic.http.html
new file mode 100644
index 0000000000..38f9a5f051
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/sharedworker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/never/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/sharedworker-module.http.html
new file mode 100644
index 0000000000..55e8cec205
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/sharedworker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/never/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/worker-classic.http.html
new file mode 100644
index 0000000000..bfcc6f6ab2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/worker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/never/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/worker-module.http.html
new file mode 100644
index 0000000000..57330eaa02
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/worker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/never/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/xhr.http.html
new file mode 100644
index 0000000000..98ea3ff25a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/never/xhr.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="never">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/a-tag.http.html
new file mode 100644
index 0000000000..053832d237
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/a-tag.http.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/fetch.http.html
new file mode 100644
index 0000000000..fbff2ccc7d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/fetch.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/iframe-tag.http.html
new file mode 100644
index 0000000000..94de097619
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/iframe-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/img-tag.http.html
new file mode 100644
index 0000000000..87ed2485e4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/img-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..5b00e927c4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/script-tag-dynamic-import.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/script-tag.http.html
new file mode 100644
index 0000000000..b32b60eee9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/script-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/sharedworker-classic.http.html
new file mode 100644
index 0000000000..c72386a4e6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/sharedworker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/sharedworker-module.http.html
new file mode 100644
index 0000000000..1fb406cc87
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/sharedworker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/worker-classic.http.html
new file mode 100644
index 0000000000..56acecdca8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/worker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/worker-module.http.html
new file mode 100644
index 0000000000..5ee0a331cc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/worker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/xhr.http.html
new file mode 100644
index 0000000000..ba439701ab
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer-when-downgrade/xhr.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer-when-downgrade">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/a-tag.http.html
new file mode 100644
index 0000000000..3760f51c6d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/a-tag.http.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/fetch.http.html
new file mode 100644
index 0000000000..046e853074
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/fetch.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/iframe-tag.http.html
new file mode 100644
index 0000000000..3954e67fff
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/iframe-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/img-tag.http.html
new file mode 100644
index 0000000000..e3720a2df7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/img-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..5eaba98c26
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/script-tag-dynamic-import.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/script-tag.http.html
new file mode 100644
index 0000000000..0bb90ddc53
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/script-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/sharedworker-classic.http.html
new file mode 100644
index 0000000000..b0a58ec071
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/sharedworker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/sharedworker-module.http.html
new file mode 100644
index 0000000000..0de18a801e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/sharedworker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/worker-classic.http.html
new file mode 100644
index 0000000000..61ef7547b3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/worker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/worker-module.http.html
new file mode 100644
index 0000000000..b90c47fb4a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/worker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/xhr.http.html
new file mode 100644
index 0000000000..365ae53ee9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/no-referrer/xhr.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..c90fbac847
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..026d1127cf
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..ac41652006
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..c359cedf9d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..8bb6d6eba2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/script-tag-dynamic-import.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..e85254c9c2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..164e5a5d6f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/sharedworker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..213e4a5763
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/sharedworker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..f63136bb9f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..0a14c4ba7b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..38f8569c46
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/a-tag.http.html
new file mode 100644
index 0000000000..270bc100e6
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/a-tag.http.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/fetch.http.html
new file mode 100644
index 0000000000..074d6ff454
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/fetch.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/iframe-tag.http.html
new file mode 100644
index 0000000000..9b2be1b36d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/iframe-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/img-tag.http.html
new file mode 100644
index 0000000000..23f029e018
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/img-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..d752465085
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/script-tag-dynamic-import.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/script-tag.http.html
new file mode 100644
index 0000000000..de679acf67
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/script-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..ccc463ff5c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/sharedworker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/sharedworker-module.http.html
new file mode 100644
index 0000000000..29fd0f2ef3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/sharedworker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/worker-classic.http.html
new file mode 100644
index 0000000000..dd99c2a608
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/worker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/worker-module.http.html
new file mode 100644
index 0000000000..dd3800f59e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/worker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/xhr.http.html
new file mode 100644
index 0000000000..d639073154
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin-when-crossorigin/xhr.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin-when-crossorigin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/a-tag.http.html
new file mode 100644
index 0000000000..9eed6b4cc5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/a-tag.http.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/fetch.http.html
new file mode 100644
index 0000000000..9e0eb9df86
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/fetch.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/iframe-tag.http.html
new file mode 100644
index 0000000000..b2de0586e5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/iframe-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/img-tag.http.html
new file mode 100644
index 0000000000..0be153073e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/img-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..9f7dd3db60
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/script-tag-dynamic-import.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/script-tag.http.html
new file mode 100644
index 0000000000..1dd703daa8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/script-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..f05f62a46b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/sharedworker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..1d2334f2b7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/sharedworker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/worker-classic.http.html
new file mode 100644
index 0000000000..f7de83ce58
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/worker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/worker-module.http.html
new file mode 100644
index 0000000000..f5d00f8139
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/worker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/xhr.http.html
new file mode 100644
index 0000000000..ce3c63264f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/origin/xhr.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/a-tag.http.html
new file mode 100644
index 0000000000..e527be69a2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/a-tag.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/fetch.http.html
new file mode 100644
index 0000000000..c9edccb7b0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/fetch.http.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..cffe9aaf42
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/iframe-tag.http.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/img-tag.http.html
new file mode 100644
index 0000000000..169b379a30
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/img-tag.http.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..e12b8cb5a9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/script-tag-dynamic-import.http.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/script-tag.http.html
new file mode 100644
index 0000000000..f85b8d09ee
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/script-tag.http.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..dc152cf203
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/sharedworker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..4af9a84e38
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/sharedworker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/worker-classic.http.html
new file mode 100644
index 0000000000..238e044777
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/worker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/worker-module.http.html
new file mode 100644
index 0000000000..e12a18771c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/worker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/xhr.http.html
new file mode 100644
index 0000000000..f806606e39
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/same-origin/xhr.http.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="same-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/a-tag.http.html
new file mode 100644
index 0000000000..c90830faec
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/a-tag.http.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..76475a2a48
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..261b31cea3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/iframe-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/img-tag.http.html
new file mode 100644
index 0000000000..f84e23faa9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/img-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..2a3f6d0b05
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/script-tag-dynamic-import.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/script-tag.http.html
new file mode 100644
index 0000000000..692ccd8156
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/script-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..dbaa8dad70
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/sharedworker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..dca75da7bc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/sharedworker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..fe4cb622a0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..03b3224282
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..38136d1dfa
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin-when-cross-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/a-tag.http.html
new file mode 100644
index 0000000000..a0d7b82ff0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/a-tag.http.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/fetch.http.html
new file mode 100644
index 0000000000..e4a723a028
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/fetch.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/iframe-tag.http.html
new file mode 100644
index 0000000000..a9a3f08183
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/iframe-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/img-tag.http.html
new file mode 100644
index 0000000000..61caa7b5de
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/img-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..107b99e6be
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/script-tag-dynamic-import.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/script-tag.http.html
new file mode 100644
index 0000000000..f8502d76ec
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/script-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/sharedworker-classic.http.html
new file mode 100644
index 0000000000..65734aa6dd
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/sharedworker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/sharedworker-module.http.html
new file mode 100644
index 0000000000..6950b05007
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/sharedworker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/worker-classic.http.html
new file mode 100644
index 0000000000..5a80852cc1
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/worker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/worker-module.http.html
new file mode 100644
index 0000000000..64cdd50833
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/worker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/xhr.http.html
new file mode 100644
index 0000000000..08fe4b8add
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/strict-origin/xhr.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="strict-origin">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/a-tag.http.html
new file mode 100644
index 0000000000..f25dfbc5fd
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/a-tag.http.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-https origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/fetch.http.html
new file mode 100644
index 0000000000..46eb2b9d87
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/fetch.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/iframe-tag.http.html
new file mode 100644
index 0000000000..f84dba4815
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/iframe-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/img-tag.http.html
new file mode 100644
index 0000000000..8f8b278cff
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/img-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..3e50fdaffc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/script-tag-dynamic-import.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/script-tag.http.html
new file mode 100644
index 0000000000..b99cb1a636
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/script-tag.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/sharedworker-classic.http.html
new file mode 100644
index 0000000000..24db9fcc6a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/sharedworker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/sharedworker-module.http.html
new file mode 100644
index 0000000000..21fa949171
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/sharedworker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/worker-classic.http.html
new file mode 100644
index 0000000000..0d76a82ae5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/worker-classic.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/worker-module.http.html
new file mode 100644
index 0000000000..2725051576
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/worker-module.http.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/xhr.http.html
new file mode 100644
index 0000000000..b77d9ed3df
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unsafe-url/xhr.http.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/a-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/a-tag.http.html
new file mode 100644
index 0000000000..72e159c72e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/a-tag.http.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for a-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "a-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for a-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/fetch.http.html
new file mode 100644
index 0000000000..1dfb592eeb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/fetch.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/iframe-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/iframe-tag.http.html
new file mode 100644
index 0000000000..557d6a5323
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/iframe-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "iframe-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for iframe-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/img-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/img-tag.http.html
new file mode 100644
index 0000000000..3987df1518
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/img-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "img-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for img-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/script-tag-dynamic-import.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/script-tag-dynamic-import.http.html
new file mode 100644
index 0000000000..6444480eb9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/script-tag-dynamic-import.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag-dynamic-import to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag-dynamic-import",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag-dynamic-import to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/script-tag.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/script-tag.http.html
new file mode 100644
index 0000000000..788c8d04f2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/script-tag.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "script-tag",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for script-tag to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/sharedworker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/sharedworker-classic.http.html
new file mode 100644
index 0000000000..1bc6f04b8c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/sharedworker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/sharedworker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/sharedworker-module.http.html
new file mode 100644
index 0000000000..a24ee872ad
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/sharedworker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "sharedworker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for sharedworker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/worker-classic.http.html
new file mode 100644
index 0000000000..7e6e8f3c5f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/worker-classic.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/worker-module.http.html
new file mode 100644
index 0000000000..ae453ee0f0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/worker-module.http.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/xhr.http.html
new file mode 100644
index 0000000000..866577c336
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/top.meta/unset/xhr.http.html
@@ -0,0 +1,142 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/fetch.http.html
new file mode 100644
index 0000000000..dac3a68322
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/worker-classic.http.html
new file mode 100644
index 0000000000..18ba58d76e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/worker-module.http.html
new file mode 100644
index 0000000000..7f15535572
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/xhr.http.html
new file mode 100644
index 0000000000..d3952c2944
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/fetch.http.html
new file mode 100644
index 0000000000..7fd76e6343
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/worker-classic.http.html
new file mode 100644
index 0000000000..5bec21542b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/worker-module.http.html
new file mode 100644
index 0000000000..ce37d95eb3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/xhr.http.html
new file mode 100644
index 0000000000..c86c9717eb
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/no-referrer/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..fd5c1c40b4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..0faa7b5885
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..186c854ae9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..1074f48768
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/fetch.http.html
new file mode 100644
index 0000000000..6cdc0b41d8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/worker-classic.http.html
new file mode 100644
index 0000000000..d4e7d5d815
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/worker-module.http.html
new file mode 100644
index 0000000000..aa988d50a7
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/xhr.http.html
new file mode 100644
index 0000000000..ccbf111956
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/fetch.http.html
new file mode 100644
index 0000000000..a1bc897efc
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/fetch.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/worker-classic.http.html
new file mode 100644
index 0000000000..520c0b65c0
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/worker-module.http.html
new file mode 100644
index 0000000000..8487eb46ef
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/xhr.http.html
new file mode 100644
index 0000000000..bbed4e8be2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/same-origin/xhr.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..7dd1c32a41
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..b4cf59c956
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..0abbb2c83c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..4438134838
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/fetch.http.html
new file mode 100644
index 0000000000..491266ebaf
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/worker-classic.http.html
new file mode 100644
index 0000000000..773126f571
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/worker-module.http.html
new file mode 100644
index 0000000000..59a6f8b15a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/xhr.http.html
new file mode 100644
index 0000000000..cd9a48a353
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/strict-origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/fetch.http.html
new file mode 100644
index 0000000000..39790d452f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/worker-classic.http.html
new file mode 100644
index 0000000000..0f6f2140f3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/worker-module.http.html
new file mode 100644
index 0000000000..7ef0c81886
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/xhr.http.html
new file mode 100644
index 0000000000..31ffe14974
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unsafe-url/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/fetch.http.html
new file mode 100644
index 0000000000..107e014414
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/fetch.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/worker-classic.http.html
new file mode 100644
index 0000000000..daa20c335d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/worker-module.http.html
new file mode 100644
index 0000000000..7d9e4dfc8e
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/xhr.http.html
new file mode 100644
index 0000000000..8e8d13831f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-classic.http-rp/unset/xhr.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-classic"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/fetch.http.html
new file mode 100644
index 0000000000..af82605922
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/worker-classic.http.html
new file mode 100644
index 0000000000..d2a9ba1b3a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/worker-module.http.html
new file mode 100644
index 0000000000..6ac89f1689
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/xhr.http.html
new file mode 100644
index 0000000000..a490391314
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer-when-downgrade/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer-when-downgrade"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/fetch.http.html
new file mode 100644
index 0000000000..bc8b3cdf0c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/worker-classic.http.html
new file mode 100644
index 0000000000..19eadf3a67
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/worker-module.http.html
new file mode 100644
index 0000000000..298db8c8ca
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/xhr.http.html
new file mode 100644
index 0000000000..0d4d12fa3b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/no-referrer/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "no-referrer"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..a4b35bf505
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..07799517d4
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..95586f4f24
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..a88a479413
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/fetch.http.html
new file mode 100644
index 0000000000..3a28efb5d8
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/worker-classic.http.html
new file mode 100644
index 0000000000..ca9a19c13a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/worker-module.http.html
new file mode 100644
index 0000000000..c213c0564b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/xhr.http.html
new file mode 100644
index 0000000000..fce3b7be70
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/fetch.http.html
new file mode 100644
index 0000000000..f200e415ca
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/fetch.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/worker-classic.http.html
new file mode 100644
index 0000000000..39ce69461d
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/worker-module.http.html
new file mode 100644
index 0000000000..55b9ee4eb2
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/xhr.http.html
new file mode 100644
index 0000000000..67a1b10069
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/same-origin/xhr.http.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "omitted",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects omitted for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "same-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/fetch.http.html
new file mode 100644
index 0000000000..4cc033b437
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/worker-classic.http.html
new file mode 100644
index 0000000000..b1a4a79540
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/worker-module.http.html
new file mode 100644
index 0000000000..ba3408d98c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/xhr.http.html
new file mode 100644
index 0000000000..d0ac356f06
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin-when-cross-origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin-when-cross-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/fetch.http.html
new file mode 100644
index 0000000000..1617f51513
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/worker-classic.http.html
new file mode 100644
index 0000000000..07d624de69
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/worker-module.http.html
new file mode 100644
index 0000000000..233abfb42c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/xhr.http.html
new file mode 100644
index 0000000000..81ddff1eb5
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/strict-origin/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "strict-origin"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/fetch.http.html
new file mode 100644
index 0000000000..b07a1144da
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/fetch.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/worker-classic.http.html
new file mode 100644
index 0000000000..f5f0fd461b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/worker-classic.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/worker-module.http.html
new file mode 100644
index 0000000000..fc5450adc3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/worker-module.http.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/xhr.http.html
new file mode 100644
index 0000000000..2c1f53cd9a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unsafe-url/xhr.http.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="no-referrer">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [
+ {
+ "deliveryType": "http-rp",
+ "key": "referrerPolicy",
+ "value": "unsafe-url"
+ }
+ ],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-https origin and swap-origin redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/fetch.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/fetch.http.html
new file mode 100644
index 0000000000..82d2157988
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/fetch.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "fetch",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/worker-classic.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/worker-classic.http.html
new file mode 100644
index 0000000000..896b9dce2b
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/worker-classic.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-classic",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-classic to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/worker-module.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/worker-module.http.html
new file mode 100644
index 0000000000..804ba16e35
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/worker-module.http.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "worker-module",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for worker-module to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/xhr.http.html b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/xhr.http.html
new file mode 100644
index 0000000000..6920a3c4c3
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/gen/worker-module.http-rp/unset/xhr.http.html
@@ -0,0 +1,203 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! Generated by `common/security-features/tools/generate.py --spec referrer-policy/` -->
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="timeout" content="long">
+ <meta name="referrer" content="unsafe-url">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/security-features/resources/common.sub.js"></script>
+ <script src="../../../generic/test-case.sub.js"></script>
+ </head>
+ <body>
+ <script>
+ TestCase(
+ [
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "cross-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-http",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context."
+ },
+ {
+ "expectation": "origin",
+ "origin": "same-https",
+ "redirection": "swap-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "keep-origin",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and keep-origin redirection from http context."
+ },
+ {
+ "expectation": "stripped-referrer",
+ "origin": "same-http",
+ "redirection": "no-redirect",
+ "source_context_list": [
+ {
+ "policyDeliveries": [],
+ "sourceContextType": "worker-module"
+ }
+ ],
+ "source_scheme": "http",
+ "subresource": "xhr",
+ "subresource_policy_deliveries": [],
+ "test_description": "Referrer Policy: Expects stripped-referrer for xhr to same-http origin and no-redirect redirection from http context."
+ }
+ ],
+ new SanityChecker()
+ ).start();
+ </script>
+ <div id="log"></div>
+ </body>
+</html>