From 271d0c1d95605e1edea81048ee66c86635bb2013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A2ris=20MEULEMAN?= Date: Mon, 22 Feb 2021 17:20:46 -0800 Subject: [PATCH] Add WPT for COOP behavior in navigations to about:blank This CL adds a WPT test that checks the interaction of COOP same-origin-allow-popups with about:blank navigations. As discussed in https://github.com/whatwg/html/issues/5198. Change-Id: Iabe461416c36468f73a41af0f69c46c545744e14 --- .../navigate-to-aboutblank.https.html | 171 ++++++++++++++++++ .../navigate-top-to-aboutblank.https.html | 158 ++++++++++++++++ lint.ignore | 4 +- 3 files changed, 332 insertions(+), 1 deletion(-) create mode 100644 html/cross-origin-opener-policy/navigate-to-aboutblank.https.html create mode 100644 html/cross-origin-opener-policy/navigate-top-to-aboutblank.https.html diff --git a/html/cross-origin-opener-policy/navigate-to-aboutblank.https.html b/html/cross-origin-opener-policy/navigate-to-aboutblank.https.html new file mode 100644 index 00000000000000..a9deefbcc79b3b --- /dev/null +++ b/html/cross-origin-opener-policy/navigate-to-aboutblank.https.html @@ -0,0 +1,171 @@ + + This tests the inheritance of navigations to about:blank. + + + + + + + + + + +

Non-initial empty documents (about:blank) should inherit their + cross-origin-opener-policy from the navigation's initiator top level document, + if the initiator and its top level document are same-origin, or default + (unsafe-none) otherwise. +

+ +
    +
  1. Create the opener popup with a given COOP openerCOOP.
  2. +
  3. add iframe to the opener popup that is either same-origin or + cross-origin. +
  4. +
  5. opener's iframe opens a new window, to a network document with openeeCOOP.
  6. +
  7. opener's iframe navigates the openee popup to about:blank.
  8. +
+ + \ No newline at end of file diff --git a/html/cross-origin-opener-policy/navigate-top-to-aboutblank.https.html b/html/cross-origin-opener-policy/navigate-top-to-aboutblank.https.html new file mode 100644 index 00000000000000..c6308057d115e9 --- /dev/null +++ b/html/cross-origin-opener-policy/navigate-top-to-aboutblank.https.html @@ -0,0 +1,158 @@ + + This tests the inheritance of navigations to about:blank of the top document. + + + + + + + + + + +

Non-initial empty documents (about:blank) should inherit their + cross-origin-opener-policy from the navigation's initiator top level document, + if the initiator and its top level document are same-origin, or default (to + unsafe-none) otherwise. +

+ +
    +
  1. Create the opener popup with a given COOP openerCOOP.
  2. +
  3. Add iframe to the opener popup that is either same-origin or + cross-origin. +
  4. +
  5. Opener opens a new window, to a network document with the same origin and + COOP value as opener.
  6. +
  7. Opener's iframe navigates its parent frame (opener) to about:blank.
  8. +
  9. Verify the openee still has access to its opener.
  10. +
+ + \ No newline at end of file diff --git a/lint.ignore b/lint.ignore index bcf58ea5cfe0f6..5e936757c193d6 100644 --- a/lint.ignore +++ b/lint.ignore @@ -308,7 +308,9 @@ SET TIMEOUT: document-policy/font-display/override-to-optional.tentative.html SET TIMEOUT: feature-policy/experimental-features/resources/focus-without-user-activation-iframe-tentative.html SET TIMEOUT: permissions-policy/experimental-features/resources/focus-without-user-activation-iframe-tentative.html SET TIMEOUT: html/browsers/windows/auxiliary-browsing-contexts/resources/close-opener.html -SET TIMEOUT: html/cross-origin-embedder-policy/resources/reporting-worker.js +SET TIMEOUT: html/cross-origin-embedder-policy/resources/reporting-worker.justfortest +SET TIMEOUT: html/cross-origin-opener-policy/navigate-to-aboutblank.https.html +SET TIMEOUT: html/cross-origin-opener-policy/navigate-top-to-aboutblank.https.html SET TIMEOUT: html/cross-origin-opener-policy/reporting/resources/dispatcher.js SET TIMEOUT: html/dom/documents/dom-tree-accessors/Document.currentScript.html SET TIMEOUT: html/webappapis/timers/*