From 5690096e79cb65c0a049735a515cc19fde492e1b Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 14 Aug 2019 13:41:47 +0200 Subject: [PATCH] COOP and COEP tests See the added html/cross-origin-opener-policy/README.md for details. See #18354 for remaining work. --- html/cross-origin-embedder-policy/README.md | 1 + .../blob.https.html | 44 ++++ .../blob.https.html.headers | 1 + .../data.https.html | 20 ++ .../data.https.html.headers | 1 + .../non-initial-about-blank.https.html | 21 ++ ...non-initial-about-blank.https.html.headers | 1 + .../none.https.html | 79 +++++++ .../none.https.html.headers | 1 + .../require-corp.https.html | 138 +++++++++++ .../require-corp.https.html.headers | 1 + .../resources/blob-url-factory.html | 17 ++ .../resources/blob-url-factory.html.headers | 2 + .../resources/navigate-none.sub.html} | 0 .../resources/navigate-require-corp.sub.html} | 0 .../navigate-require-corp.sub.html.headers | 1 + .../resources/nothing-cross-origin-corp.txt | 1 + .../nothing-cross-origin-corp.txt.headers | 1 + .../resources/nothing-same-origin-corp.txt | 1 + .../nothing-same-origin-corp.txt.headers | 1 + .../resources/script-factory.js | 23 ++ .../sandbox.https.html | 40 ++++ .../sandbox.https.html.headers | 1 + .../srcdoc.https.html | 21 ++ .../srcdoc.https.html.headers | 1 + html/cross-origin-opener-policy/README.md | 11 + .../coep-navigate-popup.https.html | 62 +++++ .../coep-navigate-popup.https.html.headers | 2 + .../coep-redirect.https.html | 67 ++++++ .../coep-redirect.https.html.headers | 2 + .../coep.https.html | 43 ++++ .../coep.https.html.headers | 2 + .../coop-navigated-popup.https.html | 29 +++ .../coop-navigated-popup.https.html.headers} | 0 .../coop-sandbox.https.html | 22 ++ .../coop-sandbox.https.html.headers} | 0 html/cross-origin-opener-policy/no-https.html | 18 ++ .../no-https.html.headers | 1 + .../popup-none.https.html} | 5 +- ...-origin-non-initial-about-blank.https.html | 15 ++ ...non-initial-about-blank.https.html.headers | 1 + ...e-origin-unsafe-allow-outgoing.https.html} | 3 +- ...n-unsafe-allow-outgoing.https.html.headers | 1 + .../popup-same-origin.https.html} | 3 +- .../popup-same-origin.https.html.headers | 1 + ...ame-site-unsafe-allow-outgoing.https.html} | 3 +- ...-unsafe-allow-outgoing.https.html.headers} | 0 .../popup-same-site.https.html} | 3 +- .../popup-same-site.https.html.headers} | 0 .../resources/common.js | 36 +++ .../resources/coop-coep.py | 35 +++ .../resources/postback.html | 10 + .../resources/postback.html.headers | 1 + html/cross-origin-opener/common.sub.js | 28 --- .../resources/coop_window.py | 10 - .../resources/postback.sub.html | 13 -- .../resources/window.sub.html | 18 -- .../resources/window.sub.html.headers | 1 - html/cross-origin/anonymous.tentative.html | 219 ------------------ .../anonymous.tentative.html.headers | 1 - html/cross-origin/null.tentative.html | 103 -------- html/cross-origin/null.tentative.html.headers | 1 - .../navigate_anonymous.sub.html.headers | 1 - .../navigate_usecredentials.sub.html | 18 -- .../navigate_usecredentials.sub.html.headers | 1 - html/cross-origin/resources/nothing.txt | 1 - .../resources/nothing.txt.headers | 1 - .../resources/popup_and_close.sub.html | 18 -- .../popup_and_close.sub.html.headers | 1 - .../usecredentials.tentative.html | 54 ----- .../usecredentials.tentative.html.headers | 1 - lint.whitelist | 2 + 72 files changed, 785 insertions(+), 501 deletions(-) create mode 100644 html/cross-origin-embedder-policy/README.md create mode 100644 html/cross-origin-embedder-policy/blob.https.html create mode 100644 html/cross-origin-embedder-policy/blob.https.html.headers create mode 100644 html/cross-origin-embedder-policy/data.https.html create mode 100644 html/cross-origin-embedder-policy/data.https.html.headers create mode 100644 html/cross-origin-embedder-policy/non-initial-about-blank.https.html create mode 100644 html/cross-origin-embedder-policy/non-initial-about-blank.https.html.headers create mode 100644 html/cross-origin-embedder-policy/none.https.html create mode 100644 html/cross-origin-embedder-policy/none.https.html.headers create mode 100644 html/cross-origin-embedder-policy/require-corp.https.html create mode 100644 html/cross-origin-embedder-policy/require-corp.https.html.headers create mode 100644 html/cross-origin-embedder-policy/resources/blob-url-factory.html create mode 100644 html/cross-origin-embedder-policy/resources/blob-url-factory.html.headers rename html/{cross-origin/resources/navigate_null.sub.html => cross-origin-embedder-policy/resources/navigate-none.sub.html} (100%) rename html/{cross-origin/resources/navigate_anonymous.sub.html => cross-origin-embedder-policy/resources/navigate-require-corp.sub.html} (100%) create mode 100644 html/cross-origin-embedder-policy/resources/navigate-require-corp.sub.html.headers create mode 100644 html/cross-origin-embedder-policy/resources/nothing-cross-origin-corp.txt create mode 100644 html/cross-origin-embedder-policy/resources/nothing-cross-origin-corp.txt.headers create mode 100644 html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt create mode 100644 html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt.headers create mode 100644 html/cross-origin-embedder-policy/resources/script-factory.js create mode 100644 html/cross-origin-embedder-policy/sandbox.https.html create mode 100644 html/cross-origin-embedder-policy/sandbox.https.html.headers create mode 100644 html/cross-origin-embedder-policy/srcdoc.https.html create mode 100644 html/cross-origin-embedder-policy/srcdoc.https.html.headers create mode 100644 html/cross-origin-opener-policy/README.md create mode 100644 html/cross-origin-opener-policy/coep-navigate-popup.https.html create mode 100644 html/cross-origin-opener-policy/coep-navigate-popup.https.html.headers create mode 100644 html/cross-origin-opener-policy/coep-redirect.https.html create mode 100644 html/cross-origin-opener-policy/coep-redirect.https.html.headers create mode 100644 html/cross-origin-opener-policy/coep.https.html create mode 100644 html/cross-origin-opener-policy/coep.https.html.headers create mode 100644 html/cross-origin-opener-policy/coop-navigated-popup.https.html rename html/{cross-origin-opener/new_window_same_origin_unsafe_allow_outgoing.tentative.html.headers => cross-origin-opener-policy/coop-navigated-popup.https.html.headers} (100%) create mode 100644 html/cross-origin-opener-policy/coop-sandbox.https.html rename html/{cross-origin-opener/new_window_same_origin.tentative.html.headers => cross-origin-opener-policy/coop-sandbox.https.html.headers} (100%) create mode 100644 html/cross-origin-opener-policy/no-https.html create mode 100644 html/cross-origin-opener-policy/no-https.html.headers rename html/{cross-origin-opener/new_window_null.tentative.html => cross-origin-opener-policy/popup-none.https.html} (93%) create mode 100644 html/cross-origin-opener-policy/popup-same-origin-non-initial-about-blank.https.html create mode 100644 html/cross-origin-opener-policy/popup-same-origin-non-initial-about-blank.https.html.headers rename html/{cross-origin-opener/new_window_same_origin_unsafe_allow_outgoing.tentative.html => cross-origin-opener-policy/popup-same-origin-unsafe-allow-outgoing.https.html} (96%) create mode 100644 html/cross-origin-opener-policy/popup-same-origin-unsafe-allow-outgoing.https.html.headers rename html/{cross-origin-opener/new_window_same_origin.tentative.html => cross-origin-opener-policy/popup-same-origin.https.html} (96%) create mode 100644 html/cross-origin-opener-policy/popup-same-origin.https.html.headers rename html/{cross-origin-opener/new_window_same_site_unsafe_allow_outgoing.tentative.html => cross-origin-opener-policy/popup-same-site-unsafe-allow-outgoing.https.html} (96%) rename html/{cross-origin-opener/new_window_same_site_unsafe_allow_outgoing.tentative.html.headers => cross-origin-opener-policy/popup-same-site-unsafe-allow-outgoing.https.html.headers} (100%) rename html/{cross-origin-opener/new_window_same_site.tentative.html => cross-origin-opener-policy/popup-same-site.https.html} (96%) rename html/{cross-origin-opener/new_window_same_site.tentative.html.headers => cross-origin-opener-policy/popup-same-site.https.html.headers} (100%) create mode 100644 html/cross-origin-opener-policy/resources/common.js create mode 100644 html/cross-origin-opener-policy/resources/coop-coep.py create mode 100644 html/cross-origin-opener-policy/resources/postback.html create mode 100644 html/cross-origin-opener-policy/resources/postback.html.headers delete mode 100644 html/cross-origin-opener/common.sub.js delete mode 100644 html/cross-origin-opener/resources/coop_window.py delete mode 100644 html/cross-origin-opener/resources/postback.sub.html delete mode 100644 html/cross-origin-opener/resources/window.sub.html delete mode 100644 html/cross-origin-opener/resources/window.sub.html.headers delete mode 100644 html/cross-origin/anonymous.tentative.html delete mode 100644 html/cross-origin/anonymous.tentative.html.headers delete mode 100644 html/cross-origin/null.tentative.html delete mode 100644 html/cross-origin/null.tentative.html.headers delete mode 100644 html/cross-origin/resources/navigate_anonymous.sub.html.headers delete mode 100644 html/cross-origin/resources/navigate_usecredentials.sub.html delete mode 100644 html/cross-origin/resources/navigate_usecredentials.sub.html.headers delete mode 100644 html/cross-origin/resources/nothing.txt delete mode 100644 html/cross-origin/resources/nothing.txt.headers delete mode 100644 html/cross-origin/resources/popup_and_close.sub.html delete mode 100644 html/cross-origin/resources/popup_and_close.sub.html.headers delete mode 100644 html/cross-origin/usecredentials.tentative.html delete mode 100644 html/cross-origin/usecredentials.tentative.html.headers diff --git a/html/cross-origin-embedder-policy/README.md b/html/cross-origin-embedder-policy/README.md new file mode 100644 index 00000000000000..16179eb0133a9e --- /dev/null +++ b/html/cross-origin-embedder-policy/README.md @@ -0,0 +1 @@ +See `../cross-origin-opener-policy/README.md`. diff --git a/html/cross-origin-embedder-policy/blob.https.html b/html/cross-origin-embedder-policy/blob.https.html new file mode 100644 index 00000000000000..aa4cf969d9e0fe --- /dev/null +++ b/html/cross-origin-embedder-policy/blob.https.html @@ -0,0 +1,44 @@ + + + + + + +
+ diff --git a/html/cross-origin-embedder-policy/blob.https.html.headers b/html/cross-origin-embedder-policy/blob.https.html.headers new file mode 100644 index 00000000000000..6604450991a122 --- /dev/null +++ b/html/cross-origin-embedder-policy/blob.https.html.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/html/cross-origin-embedder-policy/data.https.html b/html/cross-origin-embedder-policy/data.https.html new file mode 100644 index 00000000000000..c34f1336c8bd22 --- /dev/null +++ b/html/cross-origin-embedder-policy/data.https.html @@ -0,0 +1,20 @@ + + + + + +
+ diff --git a/html/cross-origin-embedder-policy/data.https.html.headers b/html/cross-origin-embedder-policy/data.https.html.headers new file mode 100644 index 00000000000000..6604450991a122 --- /dev/null +++ b/html/cross-origin-embedder-policy/data.https.html.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/html/cross-origin-embedder-policy/non-initial-about-blank.https.html b/html/cross-origin-embedder-policy/non-initial-about-blank.https.html new file mode 100644 index 00000000000000..7fed1fe58194a2 --- /dev/null +++ b/html/cross-origin-embedder-policy/non-initial-about-blank.https.html @@ -0,0 +1,21 @@ + + + + +
+ diff --git a/html/cross-origin-embedder-policy/non-initial-about-blank.https.html.headers b/html/cross-origin-embedder-policy/non-initial-about-blank.https.html.headers new file mode 100644 index 00000000000000..6604450991a122 --- /dev/null +++ b/html/cross-origin-embedder-policy/non-initial-about-blank.https.html.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/html/cross-origin-embedder-policy/none.https.html b/html/cross-origin-embedder-policy/none.https.html new file mode 100644 index 00000000000000..b1bb6fefc6cfa4 --- /dev/null +++ b/html/cross-origin-embedder-policy/none.https.html @@ -0,0 +1,79 @@ + + +Cross-Origin-Embedder-Policy header and nested navigable resource without such header + + + +
+ diff --git a/html/cross-origin-embedder-policy/none.https.html.headers b/html/cross-origin-embedder-policy/none.https.html.headers new file mode 100644 index 00000000000000..43c44cffd64e01 --- /dev/null +++ b/html/cross-origin-embedder-policy/none.https.html.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: unknown-should-be-parsed-as-null diff --git a/html/cross-origin-embedder-policy/require-corp.https.html b/html/cross-origin-embedder-policy/require-corp.https.html new file mode 100644 index 00000000000000..0bd6aab729533b --- /dev/null +++ b/html/cross-origin-embedder-policy/require-corp.https.html @@ -0,0 +1,138 @@ + + +Cross-Origin-Embedder-Policy header and nested navigable resource without such header + + + + +
+ diff --git a/html/cross-origin-embedder-policy/require-corp.https.html.headers b/html/cross-origin-embedder-policy/require-corp.https.html.headers new file mode 100644 index 00000000000000..6604450991a122 --- /dev/null +++ b/html/cross-origin-embedder-policy/require-corp.https.html.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/html/cross-origin-embedder-policy/resources/blob-url-factory.html b/html/cross-origin-embedder-policy/resources/blob-url-factory.html new file mode 100644 index 00000000000000..7d90aacd8bbf20 --- /dev/null +++ b/html/cross-origin-embedder-policy/resources/blob-url-factory.html @@ -0,0 +1,17 @@ + + + diff --git a/html/cross-origin-embedder-policy/resources/blob-url-factory.html.headers b/html/cross-origin-embedder-policy/resources/blob-url-factory.html.headers new file mode 100644 index 00000000000000..4e798cd9f5d3f7 --- /dev/null +++ b/html/cross-origin-embedder-policy/resources/blob-url-factory.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Embedder-Policy: require-corp +Cross-Origin-Resource-Policy: cross-origin diff --git a/html/cross-origin/resources/navigate_null.sub.html b/html/cross-origin-embedder-policy/resources/navigate-none.sub.html similarity index 100% rename from html/cross-origin/resources/navigate_null.sub.html rename to html/cross-origin-embedder-policy/resources/navigate-none.sub.html diff --git a/html/cross-origin/resources/navigate_anonymous.sub.html b/html/cross-origin-embedder-policy/resources/navigate-require-corp.sub.html similarity index 100% rename from html/cross-origin/resources/navigate_anonymous.sub.html rename to html/cross-origin-embedder-policy/resources/navigate-require-corp.sub.html diff --git a/html/cross-origin-embedder-policy/resources/navigate-require-corp.sub.html.headers b/html/cross-origin-embedder-policy/resources/navigate-require-corp.sub.html.headers new file mode 100644 index 00000000000000..6604450991a122 --- /dev/null +++ b/html/cross-origin-embedder-policy/resources/navigate-require-corp.sub.html.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/html/cross-origin-embedder-policy/resources/nothing-cross-origin-corp.txt b/html/cross-origin-embedder-policy/resources/nothing-cross-origin-corp.txt new file mode 100644 index 00000000000000..e61d8ee36c9af6 --- /dev/null +++ b/html/cross-origin-embedder-policy/resources/nothing-cross-origin-corp.txt @@ -0,0 +1 @@ +nothing with cross-origin CORP diff --git a/html/cross-origin-embedder-policy/resources/nothing-cross-origin-corp.txt.headers b/html/cross-origin-embedder-policy/resources/nothing-cross-origin-corp.txt.headers new file mode 100644 index 00000000000000..1b88136c01cbca --- /dev/null +++ b/html/cross-origin-embedder-policy/resources/nothing-cross-origin-corp.txt.headers @@ -0,0 +1 @@ +Cross-Origin-Resource-Policy: cross-origin diff --git a/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt b/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt new file mode 100644 index 00000000000000..b9ba801f78e5f3 --- /dev/null +++ b/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt @@ -0,0 +1 @@ +nothing with same-origin CORP diff --git a/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt.headers b/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt.headers new file mode 100644 index 00000000000000..30ddeac2e7a359 --- /dev/null +++ b/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt.headers @@ -0,0 +1 @@ +Cross-Origin-Resource-Policy: same-origin diff --git a/html/cross-origin-embedder-policy/resources/script-factory.js b/html/cross-origin-embedder-policy/resources/script-factory.js new file mode 100644 index 00000000000000..9db75522602047 --- /dev/null +++ b/html/cross-origin-embedder-policy/resources/script-factory.js @@ -0,0 +1,23 @@ +// This creates a serialized + + +
+ diff --git a/html/cross-origin-embedder-policy/sandbox.https.html.headers b/html/cross-origin-embedder-policy/sandbox.https.html.headers new file mode 100644 index 00000000000000..6604450991a122 --- /dev/null +++ b/html/cross-origin-embedder-policy/sandbox.https.html.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/html/cross-origin-embedder-policy/srcdoc.https.html b/html/cross-origin-embedder-policy/srcdoc.https.html new file mode 100644 index 00000000000000..3fbba961b2736e --- /dev/null +++ b/html/cross-origin-embedder-policy/srcdoc.https.html @@ -0,0 +1,21 @@ + + + + + + +
+ diff --git a/html/cross-origin-embedder-policy/srcdoc.https.html.headers b/html/cross-origin-embedder-policy/srcdoc.https.html.headers new file mode 100644 index 00000000000000..6604450991a122 --- /dev/null +++ b/html/cross-origin-embedder-policy/srcdoc.https.html.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/html/cross-origin-opener-policy/README.md b/html/cross-origin-opener-policy/README.md new file mode 100644 index 00000000000000..3f080c82d25de7 --- /dev/null +++ b/html/cross-origin-opener-policy/README.md @@ -0,0 +1,11 @@ +This directory as well as `../cross-origin-embedder-policy/` contains tests for `Cross-Origin-Opener-Policy` and `Cross-Origin-Embedder-Policy`. Some light background reading: + +* [COOP and COEP explained](https://docs.google.com/document/d/1zDlfvfTJ_9e8Jdc8ehuV4zMEu9ySMCiTGMS9y0GU92k/edit) +* [COOP processing model](https://gist.github.com/annevk/6f2dd8c79c77123f39797f6bdac43f3e) (also defines interaction with COEP) +* [COEP processing model](https://mikewest.github.io/corpp/) +* [Open COOP issues](https://github.com/whatwg/html/labels/topic%3A%20cross-origin-opener-policy) +* [Open COEP issues](https://github.com/whatwg/html/labels/topic%3A%20cross-origin-embedder-policy) + +Notes: + +* Top-level navigation to a `data:` URL does not work in Chrome and Firefox and is therefore not tested. (This should probably be standardized.) diff --git a/html/cross-origin-opener-policy/coep-navigate-popup.https.html b/html/cross-origin-opener-policy/coep-navigate-popup.https.html new file mode 100644 index 00000000000000..717122b4b2f2e7 --- /dev/null +++ b/html/cross-origin-opener-policy/coep-navigate-popup.https.html @@ -0,0 +1,62 @@ + +Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy: a navigating popup + + + + + diff --git a/html/cross-origin-opener-policy/coep-navigate-popup.https.html.headers b/html/cross-origin-opener-policy/coep-navigate-popup.https.html.headers new file mode 100644 index 00000000000000..63b60e490f47f4 --- /dev/null +++ b/html/cross-origin-opener-policy/coep-navigate-popup.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/html/cross-origin-opener-policy/coep-redirect.https.html b/html/cross-origin-opener-policy/coep-redirect.https.html new file mode 100644 index 00000000000000..73f07ddef88877 --- /dev/null +++ b/html/cross-origin-opener-policy/coep-redirect.https.html @@ -0,0 +1,67 @@ + +Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy: redirects + + + + + diff --git a/html/cross-origin-opener-policy/coep-redirect.https.html.headers b/html/cross-origin-opener-policy/coep-redirect.https.html.headers new file mode 100644 index 00000000000000..63b60e490f47f4 --- /dev/null +++ b/html/cross-origin-opener-policy/coep-redirect.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/html/cross-origin-opener-policy/coep.https.html b/html/cross-origin-opener-policy/coep.https.html new file mode 100644 index 00000000000000..1c04ed30dd7b3e --- /dev/null +++ b/html/cross-origin-opener-policy/coep.https.html @@ -0,0 +1,43 @@ + +Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy + + + + + diff --git a/html/cross-origin-opener-policy/coep.https.html.headers b/html/cross-origin-opener-policy/coep.https.html.headers new file mode 100644 index 00000000000000..63b60e490f47f4 --- /dev/null +++ b/html/cross-origin-opener-policy/coep.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/html/cross-origin-opener-policy/coop-navigated-popup.https.html b/html/cross-origin-opener-policy/coop-navigated-popup.https.html new file mode 100644 index 00000000000000..0b51512c221d90 --- /dev/null +++ b/html/cross-origin-opener-policy/coop-navigated-popup.https.html @@ -0,0 +1,29 @@ + +Cross-Origin-Opener-Policy: a navigated popup + + + + + diff --git a/html/cross-origin-opener/new_window_same_origin_unsafe_allow_outgoing.tentative.html.headers b/html/cross-origin-opener-policy/coop-navigated-popup.https.html.headers similarity index 100% rename from html/cross-origin-opener/new_window_same_origin_unsafe_allow_outgoing.tentative.html.headers rename to html/cross-origin-opener-policy/coop-navigated-popup.https.html.headers diff --git a/html/cross-origin-opener-policy/coop-sandbox.https.html b/html/cross-origin-opener-policy/coop-sandbox.https.html new file mode 100644 index 00000000000000..e471b1eda2ef28 --- /dev/null +++ b/html/cross-origin-opener-policy/coop-sandbox.https.html @@ -0,0 +1,22 @@ + +Sandboxed Cross-Origin-Opener-Policy popup should result in a network error + + + +
+ diff --git a/html/cross-origin-opener/new_window_same_origin.tentative.html.headers b/html/cross-origin-opener-policy/coop-sandbox.https.html.headers similarity index 100% rename from html/cross-origin-opener/new_window_same_origin.tentative.html.headers rename to html/cross-origin-opener-policy/coop-sandbox.https.html.headers diff --git a/html/cross-origin-opener-policy/no-https.html b/html/cross-origin-opener-policy/no-https.html new file mode 100644 index 00000000000000..da9efdce777c43 --- /dev/null +++ b/html/cross-origin-opener-policy/no-https.html @@ -0,0 +1,18 @@ + + +Cross-Origin-Opener-Policy requires secure contexts + + + diff --git a/html/cross-origin-opener-policy/no-https.html.headers b/html/cross-origin-opener-policy/no-https.html.headers new file mode 100644 index 00000000000000..46ad58d83bf6e9 --- /dev/null +++ b/html/cross-origin-opener-policy/no-https.html.headers @@ -0,0 +1 @@ +Cross-Origin-Opener-Policy: same-origin diff --git a/html/cross-origin-opener/new_window_null.tentative.html b/html/cross-origin-opener-policy/popup-none.https.html similarity index 93% rename from html/cross-origin-opener/new_window_null.tentative.html rename to html/cross-origin-opener-policy/popup-none.https.html index 35a42fd2f0963f..62633457d3f571 100644 --- a/html/cross-origin-opener/new_window_null.tentative.html +++ b/html/cross-origin-opener-policy/popup-none.https.html @@ -3,8 +3,7 @@ - - +
diff --git a/html/cross-origin-opener-policy/popup-same-origin-non-initial-about-blank.https.html b/html/cross-origin-opener-policy/popup-same-origin-non-initial-about-blank.https.html new file mode 100644 index 00000000000000..65ec3b26aa0c6e --- /dev/null +++ b/html/cross-origin-opener-policy/popup-same-origin-non-initial-about-blank.https.html @@ -0,0 +1,15 @@ + +Cross-Origin-Opener-Policy: about:blank + + + diff --git a/html/cross-origin-opener-policy/popup-same-origin-non-initial-about-blank.https.html.headers b/html/cross-origin-opener-policy/popup-same-origin-non-initial-about-blank.https.html.headers new file mode 100644 index 00000000000000..46ad58d83bf6e9 --- /dev/null +++ b/html/cross-origin-opener-policy/popup-same-origin-non-initial-about-blank.https.html.headers @@ -0,0 +1 @@ +Cross-Origin-Opener-Policy: same-origin diff --git a/html/cross-origin-opener/new_window_same_origin_unsafe_allow_outgoing.tentative.html b/html/cross-origin-opener-policy/popup-same-origin-unsafe-allow-outgoing.https.html similarity index 96% rename from html/cross-origin-opener/new_window_same_origin_unsafe_allow_outgoing.tentative.html rename to html/cross-origin-opener-policy/popup-same-origin-unsafe-allow-outgoing.https.html index bbd55130d7a903..2f8ebc3be3fcc7 100644 --- a/html/cross-origin-opener/new_window_same_origin_unsafe_allow_outgoing.tentative.html +++ b/html/cross-origin-opener-policy/popup-same-origin-unsafe-allow-outgoing.https.html @@ -3,8 +3,7 @@ - - +
- - +
- - +
- - +
+ + +""" diff --git a/html/cross-origin-opener-policy/resources/postback.html b/html/cross-origin-opener-policy/resources/postback.html new file mode 100644 index 00000000000000..cf3c93bbe1d358 --- /dev/null +++ b/html/cross-origin-opener-policy/resources/postback.html @@ -0,0 +1,10 @@ + + + diff --git a/html/cross-origin-opener-policy/resources/postback.html.headers b/html/cross-origin-opener-policy/resources/postback.html.headers new file mode 100644 index 00000000000000..6604450991a122 --- /dev/null +++ b/html/cross-origin-opener-policy/resources/postback.html.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/html/cross-origin-opener/common.sub.js b/html/cross-origin-opener/common.sub.js deleted file mode 100644 index a73a95aba86252..00000000000000 --- a/html/cross-origin-opener/common.sub.js +++ /dev/null @@ -1,28 +0,0 @@ -const SAME_ORIGIN = {origin: get_host_info().HTTP_ORIGIN, name: "SAME_ORIGIN"}; -const SAME_SITE = {origin: get_host_info().HTTP_REMOTE_ORIGIN, name: "SAME_SITE"}; -const CROSS_ORIGIN = {origin: get_host_info().HTTP_NOTSAMESITE_ORIGIN, name: "CROSS_ORIGIN"} - -function coop_test(t, host, coop, channelName, hasOpener) { - let bc = new BroadcastChannel(channelName); - bc.onmessage = t.step_func_done((event) => { - let payload = event.data; - assert_equals(payload.name, hasOpener ? channelName : ""); - assert_equals(payload.opener, hasOpener); - }); - - let w = window.open(`${host.origin}/html/cross-origin-opener/resources/coop_window.py?path=window.sub.html&coop=${escape(coop)}&channel=${channelName}`, channelName); - - // w will be closed by its postback iframe. When out of process, - // window.close() does not work. - t.add_cleanup(() => w.close()); -} - -function run_coop_tests(mainTest, testArray) { - for (let test of tests) { - async_test(t => { - coop_test(t, test[0], test[1], - `${mainTest}_to_${test[0].name}_${test[1].replace(/ /g,"-")}`, - test[2]); - }, `${mainTest} document opening popup to ${test[0].origin} with COOP: "${test[1]}"`); - } -} diff --git a/html/cross-origin-opener/resources/coop_window.py b/html/cross-origin-opener/resources/coop_window.py deleted file mode 100644 index b24d6d55a9a368..00000000000000 --- a/html/cross-origin-opener/resources/coop_window.py +++ /dev/null @@ -1,10 +0,0 @@ -import urllib -import os.path - -def main(request, response): - coop = request.GET.first('coop') - if coop: - response.headers.set('Cross-Origin-Opener-Policy', urllib.unquote(coop)) - - path = os.path.join(os.path.dirname(__file__), request.GET.first('path')) - response.content = open(path, mode='rb').read() diff --git a/html/cross-origin-opener/resources/postback.sub.html b/html/cross-origin-opener/resources/postback.sub.html deleted file mode 100644 index ee08bab4d55ed4..00000000000000 --- a/html/cross-origin-opener/resources/postback.sub.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - diff --git a/html/cross-origin-opener/resources/window.sub.html b/html/cross-origin-opener/resources/window.sub.html deleted file mode 100644 index 524efe2588d08e..00000000000000 --- a/html/cross-origin-opener/resources/window.sub.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - diff --git a/html/cross-origin-opener/resources/window.sub.html.headers b/html/cross-origin-opener/resources/window.sub.html.headers deleted file mode 100644 index 34bd099a302f89..00000000000000 --- a/html/cross-origin-opener/resources/window.sub.html.headers +++ /dev/null @@ -1 +0,0 @@ -Cross-Origin-Opener-Policy: same-site diff --git a/html/cross-origin/anonymous.tentative.html b/html/cross-origin/anonymous.tentative.html deleted file mode 100644 index ef9b9bb7b878a7..00000000000000 --- a/html/cross-origin/anonymous.tentative.html +++ /dev/null @@ -1,219 +0,0 @@ - - -Cross-Origin header and nested navigable resource without such header - - - -
- diff --git a/html/cross-origin/anonymous.tentative.html.headers b/html/cross-origin/anonymous.tentative.html.headers deleted file mode 100644 index a76b601291ec43..00000000000000 --- a/html/cross-origin/anonymous.tentative.html.headers +++ /dev/null @@ -1 +0,0 @@ -Cross-Origin: anonymous diff --git a/html/cross-origin/null.tentative.html b/html/cross-origin/null.tentative.html deleted file mode 100644 index ae871c4a273533..00000000000000 --- a/html/cross-origin/null.tentative.html +++ /dev/null @@ -1,103 +0,0 @@ - - -Cross-Origin header and nested navigable resource without such header - - - -
- diff --git a/html/cross-origin/null.tentative.html.headers b/html/cross-origin/null.tentative.html.headers deleted file mode 100644 index fd34f127d558b1..00000000000000 --- a/html/cross-origin/null.tentative.html.headers +++ /dev/null @@ -1 +0,0 @@ -Cross-Origin: unknown-should-be-parsed-as-null diff --git a/html/cross-origin/resources/navigate_anonymous.sub.html.headers b/html/cross-origin/resources/navigate_anonymous.sub.html.headers deleted file mode 100644 index a76b601291ec43..00000000000000 --- a/html/cross-origin/resources/navigate_anonymous.sub.html.headers +++ /dev/null @@ -1 +0,0 @@ -Cross-Origin: anonymous diff --git a/html/cross-origin/resources/navigate_usecredentials.sub.html b/html/cross-origin/resources/navigate_usecredentials.sub.html deleted file mode 100644 index 1008f70ff123ae..00000000000000 --- a/html/cross-origin/resources/navigate_usecredentials.sub.html +++ /dev/null @@ -1,18 +0,0 @@ - - diff --git a/html/cross-origin/resources/navigate_usecredentials.sub.html.headers b/html/cross-origin/resources/navigate_usecredentials.sub.html.headers deleted file mode 100644 index a84d3782037e7a..00000000000000 --- a/html/cross-origin/resources/navigate_usecredentials.sub.html.headers +++ /dev/null @@ -1 +0,0 @@ -Cross-Origin: use-credentials diff --git a/html/cross-origin/resources/nothing.txt b/html/cross-origin/resources/nothing.txt deleted file mode 100644 index 9dafe9be2099a3..00000000000000 --- a/html/cross-origin/resources/nothing.txt +++ /dev/null @@ -1 +0,0 @@ -nothing diff --git a/html/cross-origin/resources/nothing.txt.headers b/html/cross-origin/resources/nothing.txt.headers deleted file mode 100644 index cb762eff806849..00000000000000 --- a/html/cross-origin/resources/nothing.txt.headers +++ /dev/null @@ -1 +0,0 @@ -Access-Control-Allow-Origin: * diff --git a/html/cross-origin/resources/popup_and_close.sub.html b/html/cross-origin/resources/popup_and_close.sub.html deleted file mode 100644 index 2489fa8d2470df..00000000000000 --- a/html/cross-origin/resources/popup_and_close.sub.html +++ /dev/null @@ -1,18 +0,0 @@ - - diff --git a/html/cross-origin/resources/popup_and_close.sub.html.headers b/html/cross-origin/resources/popup_and_close.sub.html.headers deleted file mode 100644 index a76b601291ec43..00000000000000 --- a/html/cross-origin/resources/popup_and_close.sub.html.headers +++ /dev/null @@ -1 +0,0 @@ -Cross-Origin: anonymous diff --git a/html/cross-origin/usecredentials.tentative.html b/html/cross-origin/usecredentials.tentative.html deleted file mode 100644 index 55c0f2235db27a..00000000000000 --- a/html/cross-origin/usecredentials.tentative.html +++ /dev/null @@ -1,54 +0,0 @@ - - -Cross-Origin header and nested navigable resource without such header - - -
- diff --git a/html/cross-origin/usecredentials.tentative.html.headers b/html/cross-origin/usecredentials.tentative.html.headers deleted file mode 100644 index a84d3782037e7a..00000000000000 --- a/html/cross-origin/usecredentials.tentative.html.headers +++ /dev/null @@ -1 +0,0 @@ -Cross-Origin: use-credentials diff --git a/lint.whitelist b/lint.whitelist index ea899da8b3c7a8..669038166ab38e 100644 --- a/lint.whitelist +++ b/lint.whitelist @@ -309,6 +309,8 @@ SET TIMEOUT: css/css-fonts/font-display/font-display-feature-policy-01.tentative SET TIMEOUT: css/css-fonts/font-display/font-display-feature-policy-02.tentative.html SET TIMEOUT: css/css-fonts/font-display/font-display-preload.html SET TIMEOUT: html/browsers/windows/auxiliary-browsing-contexts/resources/close-opener.html +SET TIMEOUT: html/cross-origin-embedder-policy/resources/navigate-none.sub.html +SET TIMEOUT: html/cross-origin-embedder-policy/resources/navigate-require-corp.sub.html SET TIMEOUT: html/dom/documents/dom-tree-accessors/Document.currentScript.html SET TIMEOUT: html/webappapis/timers/* SET TIMEOUT: resources/chromium/*