<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[283910] branches/safari-612-branch/LayoutTests</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/283910">283910</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2021-10-11 10:49:51 -0700 (Mon, 11 Oct 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Cherry-pick <a href="http://trac.webkit.org/projects/webkit/changeset/281775">r281775</a>. <rdar://83954681></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari612branchLayoutTestsChangeLog">branches/safari-612-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari612branchLayoutTestsTestExpectations">branches/safari-612-branch/LayoutTests/TestExpectations</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cChangeLog">branches/safari-612-branch/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframeresourcesw3cimportlog">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/resources/w3c-import.log</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframew3cimportlog">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/w3c-import.log</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyblobhttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/blob.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallesscachestoragetentativehttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/cache-storage.tentative.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallessreportingsubresourcecorptentativehttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/reporting-subresource-corp.tentative.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallessresourcescommonjs">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/common.js</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallessresourcesw3cimportlog">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/w3c-import.log</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallesssharedworkertentativehttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/shared-worker.tentative.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallessw3cimportlog">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/w3c-import.log</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicynonehttpsexpectedtxt">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none.https-expected.txt</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicynonehttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyreportingnavigationhttpsexpectedtxt">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-navigation.https-expected.txt</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyreportingnavigationhttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-navigation.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyreportingsubresourcecorphttpsexpectedtxt">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-subresource-corp.https-expected.txt</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyreportingsubresourcecorphttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-subresource-corp.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyreportingtoendpointhttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-to-endpoint.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyresourcesbloburlfactoryhtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/blob-url-factory.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyresourcesnavigatenonesubhtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/navigate-none.sub.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyresourcesw3cimportlog">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/w3c-import.log</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyw3cimportlog">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/w3c-import.log</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicycoopsameoriginallowpopupsdocumentwriteexpectedtxt">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-same-origin-allow-popups-document-write-expected.txt</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicycoopsameoriginallowpopupsdocumentwritehtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-same-origin-allow-popups-document-write.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicypopupcoopbyswhttpsexpectedtxt">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw.https-expected.txt</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicypopupcoopbyswhttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicyresourcesw3cimportlog">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/w3c-import.log</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicyw3cimportlog">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/w3c-import.log</a></li>
<li><a href="#branchessafari612branchLayoutTeststestsoptionsjson">branches/safari-612-branch/LayoutTests/tests-options.json</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyaboutblankpopuphttpsexpectedtxt">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/about-blank-popup.https-expected.txt</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyaboutblankpopuphttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/about-blank-popup.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyaboutblankpopuphttpshtmlheaders">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/about-blank-popup.https.html.headers</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframeanonymousiframepopuptentativehttpsexpectedtxt">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/anonymous-iframe-popup.tentative.https-expected.txt</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframeanonymousiframepopuptentativehttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/anonymous-iframe-popup.tentative.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframerequirecorpembedanonymousiframetentativehttpsexpectedtxt">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/require-corp-embed-anonymous-iframe.tentative.https-expected.txt</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframerequirecorpembedanonymousiframetentativehttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/require-corp-embed-anonymous-iframe.tentative.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframerequirecorpembedanonymousiframetentativehttpshtmlheaders">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/require-corp-embed-anonymous-iframe.tentative.https.html.headers</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframeresourcesserviceworkerpartitioninghelperjs">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/resources/serviceworker-partitioning-helper.js</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframeserviceworkerpartitioningtentativehttpsexpectedtxt">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/serviceworker-partitioning.tentative.https-expected.txt</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframeserviceworkerpartitioningtentativehttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/serviceworker-partitioning.tentative.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallessresourcessw_executorjs">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/sw_executor.js</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallessserviceworkercoepcredentiallessproxytentativehttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/service-worker-coep-credentialless-proxy.tentative.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallessserviceworkercoepnoneproxytentativehttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/service-worker-coep-none-proxy.tentative.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyiframehistorynonerequirecorphttpsexpectedtxt">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/iframe-history-none-require-corp.https-expected.txt</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyiframehistorynonerequirecorphttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/iframe-history-none-require-corp.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyresourcespostmessagereadyhtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/postmessage-ready.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyresourcessharedworkerjs">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/shared-worker.js</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyworkerinheritancesubhttpsexpectedtxt">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/worker-inheritance.sub.https-expected.txt</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyworkerinheritancesubhttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/worker-inheritance.sub.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyworkerinheritancesubhttpshtmlheaders">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/worker-inheritance.sub.https.html.headers</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicycoopnavigatesameorigincspsandboxhtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-navigate-same-origin-csp-sandbox.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicyresourcessw_executorjs">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/sw_executor.js</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicypopupcoopbyswfromcoophttpsexpectedtxt">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https-expected.txt</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicypopupcoopbyswfromcoophttpshtml">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicypopupcoopbyswfromcoophttpshtmlheaders">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html.headers</a></li>
<li><a href="#branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicyresourcespopupcoopbyswjs">branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/popup-coop-by-sw.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari612branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/ChangeLog (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/ChangeLog 2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/ChangeLog    2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2021-08-30  Chris Dumez  <cdumez@apple.com>
+
+        Resync COOP / COEP WPT tests from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=229678
+
+        Reviewed by Alex Christensen.
+
+        * TestExpectations:
+        * tests-options.json:
+
</ins><span class="cx"> 2021-08-27  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [WK2] Reuse the same network load when process-swapping on resource response due to COOP
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/TestExpectations (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/TestExpectations  2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/TestExpectations     2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -401,6 +401,7 @@
</span><span class="cx"> imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-weird.html [ DumpJSConsoleLogInStdErr ]
</span><span class="cx"> imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html [ DumpJSConsoleLogInStdErr ]
</span><span class="cx"> imported/w3c/web-platform-tests/html/browsers/sandboxing/sandbox-disallow-popups.html [ DumpJSConsoleLogInStdErr ]
</span><ins>+imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/require-corp-embed-anonymous-iframe.tentative.https.html [ DumpJSConsoleLogInStdErr ]
</ins><span class="cx"> imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/blob.https.html [ DumpJSConsoleLogInStdErr ]
</span><span class="cx"> imported/w3c/web-platform-tests/html/cross-origin-opener-policy/navigate-to-aboutblank.https.html [ DumpJSConsoleLogInStdErr ]
</span><span class="cx"> imported/w3c/web-platform-tests/html/cross-origin-opener-policy/navigate-top-to-aboutblank.https.html [ DumpJSConsoleLogInStdErr ]
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/ChangeLog (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/ChangeLog    2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/ChangeLog       2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2021-08-30  Chris Dumez  <cdumez@apple.com>
+
+        Resync COOP / COEP WPT tests from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=229678
+
+        Reviewed by Alex Christensen.
+
+        Resync COOP / COEP WPT tests from upstream e216db9509def8bc72b24e482.
+
+        * web-platform-tests/html/cross-origin-embedder-policy/*: Updated.
+        * web-platform-tests/html/cross-origin-opener-policy/*: Updated.
+
</ins><span class="cx"> 2021-08-24  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [WK2] Implement process-swapping based on Cross-Origin-Opener-Policy HTTP header
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyaboutblankpopuphttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/about-blank-popup.https-expected.txt (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/about-blank-popup.https-expected.txt                            (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/about-blank-popup.https-expected.txt       2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header.
+CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html due to access control checks.
+CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header.
+CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html due to access control checks.
+
+PASS Cross-Origin-Embedder-Policy is inherited by about:blank popup.
+
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyaboutblankpopuphttpshtml"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/about-blank-popup.https.html (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/about-blank-popup.https.html                            (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/about-blank-popup.https.html       2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+<!doctype html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/script-factory.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="/common/utils.js"></script>
+<script>
+  const origins = get_host_info();
+
+  promise_test(async t => {
+    const popup = window.open();
+    t.add_cleanup(() => { popup.close(); });
+
+    let data_from_popup = () => new Promise(resolve =>
+      window.addEventListener("message", (({ data }) => resolve(data))));
+
+    let check_result = (data, text) => {
+      assert_equals(data.origin, origin);
+      assert_true(data.sameOriginNoCORPSuccess,
+                  text + ": Same-origin without CORP did not succeed");
+      assert_true(data.crossOriginNoCORPFailure,
+                  text + ": Cross-origin without CORP did not fail");
+    };
+
+    // Check if COEP is inherited by the popup.
+    let script = popup.document.createElement('script');
+    script.innerHTML =
+      `${createScript(window.origin, origins.HTTPS_REMOTE_ORIGIN, "opener")}`;
+    popup.document.body.appendChild(script);
+    check_result(await data_from_popup(), "Initial empty document");
+
+    // Navigate the popup away.
+    popup.location = origins.HTTPS_REMOTE_ORIGIN +
+      "/html/cross-origin-embedder-policy/resources/postmessage-ready.html";
+    assert_equals(await new Promise(resolve =>
+      window.addEventListener("message", msg => resolve(msg.data))),
+      "ready");
+
+    // Navigate the popup to about:blank and wait for it.
+    popup.location = "about:blank";
+    await t.step_wait(
+      condition = () => {
+        try {
+          return popup.location.href === "about:blank";
+        } catch {}
+        return false;
+      },
+      description = "Wait for the popup to navigate.",
+      timeout=3000,
+      interval=50);
+
+    // Check again if COEP is inherited.
+    script = popup.document.createElement('script');
+    script.innerHTML =
+      `${createScript(window.origin, origins.HTTPS_REMOTE_ORIGIN, "opener")}`;
+    popup.document.body.appendChild(script);
+    check_result(await data_from_popup(), "Non-initial about:blank document");
+  }, `Cross-Origin-Embedder-Policy is inherited by about:blank popup.`);
+</script>
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyaboutblankpopuphttpshtmlheadersfromrev283909branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicypopupcoopbyswfromcoophttpshtmlheaders"></a>
<div class="copfile"><h4>Copied: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/about-blank-popup.https.html.headers (from rev 283909, branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html.headers) (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/about-blank-popup.https.html.headers                            (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/about-blank-popup.https.html.headers       2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Cross-Origin-Embedder-Policy: require-corp
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframeanonymousiframepopuptentativehttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/anonymous-iframe-popup.tentative.https-expected.txt (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/anonymous-iframe-popup.tentative.https-expected.txt                            (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/anonymous-iframe-popup.tentative.https-expected.txt       2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+
+
+FAIL Cross-origin popup from normal/anonymous iframes. assert_equals: Opener from anonymous iframe should be blocked. expected null but got object "[object Window]"
+FAIL Same-origin popup from normal/anonymous iframes. assert_equals: Opener from anonymous iframe should be blocked. expected null but got object "[object Window]"
+
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframeanonymousiframepopuptentativehttpshtml"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/anonymous-iframe-popup.tentative.https.html (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/anonymous-iframe-popup.tentative.https.html                            (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/anonymous-iframe-popup.tentative.https.html       2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+<!doctype html>
+<meta name="timeout" content="long">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="/common/utils.js"></script>
+<script src="../credentialless/resources/common.js"></script>
+<script src="../credentialless/resources/dispatcher.js"></script>
+<body>
+<script>
+const {ORIGIN, REMOTE_ORIGIN} = get_host_info();
+const control_iframe = document.createElement('iframe');
+const anonymous_iframe = document.createElement('iframe');
+
+promise_setup(async t => {
+  const createControlIframe = new Promise(async resolve => {
+    control_iframe.onload = resolve;
+    control_iframe.src = ORIGIN + `/common/blank.html`;
+    document.body.append(control_iframe);
+  });
+
+  const createAnonymousIframe = new Promise(async resolve => {
+    anonymous_iframe.onload = resolve;
+    anonymous_iframe.src = ORIGIN + `/common/blank.html`;
+    anonymous_iframe.anonymous = true;
+    document.body.append(anonymous_iframe);
+  });
+
+  await Promise.all([createControlIframe, createAnonymousIframe]);
+});
+
+// Create cross-origin popup from iframes. The opener should be blocked for
+// anonymous iframe and work for normal iframe.
+promise_test(async t => {
+  const control_token = token();
+  const control_src = REMOTE_ORIGIN + executor_path + `&uuid=${control_token}`;
+  const control_popup = control_iframe.contentWindow.open(control_src);
+  add_completion_callback(() => send(control_token, "close();"));
+  assert_equals(
+    control_popup.opener, control_iframe.contentWindow,
+    "Opener from normal iframe should be available.");
+
+  const anonymous_token = token();
+  const anonymous_src =
+    REMOTE_ORIGIN + executor_path + `&uuid=${anonymous_token}`;
+  const anonymous_popup = anonymous_iframe.contentWindow.open(anonymous_src);
+  add_completion_callback(() => send(anonymous_token, "close();"));
+  assert_equals(
+    anonymous_popup, null, "Opener from anonymous iframe should be blocked.");
+}, 'Cross-origin popup from normal/anonymous iframes.');
+
+// Create a same-origin popup from iframes. The opener should be blocked for
+// anonymous iframe and work for normal iframe.
+promise_test(async t => {
+  const control_token = token();
+  const control_src = ORIGIN + executor_path + `&uuid=${control_token}`;
+  const control_popup = control_iframe.contentWindow.open(control_src);
+  add_completion_callback(() => send(control_token, "close();"));
+  assert_equals(
+    control_popup.opener, control_iframe.contentWindow,
+    "Opener from normal iframe should be available.");
+
+  const anonymous_token = token();
+  const anonymous_src =
+    ORIGIN + executor_path + `&uuid=${anonymous_token}`;
+  const anonymous_popup = anonymous_iframe.contentWindow.open(anonymous_src);
+  add_completion_callback(() => send(anonymous_token, "close();"));
+  assert_equals(
+    anonymous_popup, null, "Opener from anonymous iframe should be blocked.");
+}, 'Same-origin popup from normal/anonymous iframes.');
+</script>
+</body>
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframerequirecorpembedanonymousiframetentativehttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/require-corp-embed-anonymous-iframe.tentative.https-expected.txt (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/require-corp-embed-anonymous-iframe.tentative.https-expected.txt                               (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/require-corp-embed-anonymous-iframe.tentative.https-expected.txt  2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+FAIL Loading an anonymous iframe with COEP: require-corp is allowed. assert_true: The anonymous iframe should be allowed. expected true got false
+
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframerequirecorpembedanonymousiframetentativehttpshtml"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/require-corp-embed-anonymous-iframe.tentative.https.html (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/require-corp-embed-anonymous-iframe.tentative.https.html                               (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/require-corp-embed-anonymous-iframe.tentative.https.html  2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+<!doctype html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/utils.js"></script>
+<body>
+<script>
+
+promise_test(async t => {
+  let iframe_allowed = (iframe, bc) => new Promise(async resolve => {
+    bc.onmessage = t.step_func(event => {
+      assert_equals(event.data, "loaded",
+                    "Unexpected message from broadcast channel.");
+      resolve(true);
+    });
+
+    // To see whether the iframe was blocked, we check whether it
+    // becomes cross-origin (since error pages are loaded cross-origin).
+    await t.step_wait(() => {
+      try {
+        // Accessing contentWindow.location.href cross-origin throws.
+        iframe.contentWindow.location.href === null;
+        return false;
+      } catch {
+        return true;
+      }
+    });
+    resolve(false);
+  });
+
+  // Create an anonymous child iframe.
+  const child = document.createElement("iframe");
+  child.anonymous = true;
+  t.add_cleanup(() => child.remove());
+
+  const bc_child = new BroadcastChannel(token());
+  child.src =
+    `../resources/navigate-none.sub.html?channelName=${bc_child.name}`;
+  document.body.append(child);
+
+  assert_true(await iframe_allowed(child, bc_child),
+              "The anonymous iframe should be allowed.");
+
+  // Create a child of the anonymous iframe. Even if the grandchild
+  // does not have the 'anonymous' attribute set, it inherits the
+  // anonymous property from the parent.
+  const grandchild = child.contentDocument.createElement("iframe");
+  const bc_grandchild = new BroadcastChannel(token());
+
+  grandchild.src =
+    `../resources/navigate-none.sub.html?channelName=${bc_grandchild.name}`;
+  child.contentDocument.body.append(grandchild);
+
+  assert_true(await iframe_allowed(grandchild, bc_grandchild),
+             "The child of the anonymous iframe should be allowed.");
+}, 'Loading an anonymous iframe with COEP: require-corp is allowed.');
+
+</script>
+</body>
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframerequirecorpembedanonymousiframetentativehttpshtmlheadersfromrev283909branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicypopupcoopbyswfromcoophttpshtmlheaders"></a>
<div class="copfile"><h4>Copied: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/require-corp-embed-anonymous-iframe.tentative.https.html.headers (from rev 283909, branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html.headers) (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/require-corp-embed-anonymous-iframe.tentative.https.html.headers                               (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/require-corp-embed-anonymous-iframe.tentative.https.html.headers  2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Cross-Origin-Embedder-Policy: require-corp
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframeresourcesserviceworkerpartitioninghelperjs"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/resources/serviceworker-partitioning-helper.js (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/resources/serviceworker-partitioning-helper.js                         (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/resources/serviceworker-partitioning-helper.js    2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+let messages = {};
+let ports = {};
+
+self.addEventListener("message", e => {
+  const from = e.data.from;
+  const check = e.data.check;
+
+  if (from) {
+    messages[from] = true;
+    ports[from] = e.ports[0];
+  }
+
+  if (check) {
+    ports[check].postMessage(messages);
+  }
+});
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframeresourcesw3cimportlog"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/resources/w3c-import.log (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/resources/w3c-import.log       2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/resources/w3c-import.log  2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -15,3 +15,4 @@
</span><span class="cx"> ------------------------------------------------------------------------
</span><span class="cx"> List of files:
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/resources/common.js
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/resources/serviceworker-partitioning-helper.js
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframeserviceworkerpartitioningtentativehttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/serviceworker-partitioning.tentative.https-expected.txt (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/serviceworker-partitioning.tentative.https-expected.txt                                (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/serviceworker-partitioning.tentative.https-expected.txt   2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+
+FAIL Anonymous iframes get partitioned service workers. assert_false: expected false got true
+
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframeserviceworkerpartitioningtentativehttpshtml"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/serviceworker-partitioning.tentative.https.html (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/serviceworker-partitioning.tentative.https.html                                (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/serviceworker-partitioning.tentative.https.html   2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+<!doctype html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/utils.js"></script>
+<body>
+<script>
+const sw_url = location.pathname.replace(/[^/]*$/, '') +
+      "./resources/serviceworker-partitioning-helper.js";
+
+promise_test(async t => {
+  // Create 4 iframes (two normal and two anonymous ones) and register
+  // a serviceworker with the same scope and url in all of them.
+  //
+  // Registering the same service worker again with the same url and
+  // scope is a no-op. However, anonymous iframes get partitioned
+  // service workers, so we should have a total of 2 service workers
+  // at the end (one for the normal iframes and one for the anonymous
+  // ones).
+  let iframes = await Promise.all([
+    { name: "normal", anonymous: false},
+    { name: "normal_control", anonymous: false},
+    { name: "anonymous", anonymous: true},
+    { name: "anonymous_control", anonymous: true},
+  ].map(async ({name, anonymous}) => {
+
+    let iframe = await new Promise(resolve => {
+      let iframe = document.createElement('iframe');
+      iframe.onload = () => resolve(iframe);
+      iframe.src = '/common/blank.html';
+      if (anonymous) iframe.anonymous = true;
+      document.body.append(iframe);
+    });
+
+    let sw = await new Promise(resolve => {
+      iframe.contentWindow.navigator.serviceWorker.register(sw_url)
+        .then(r => {
+          add_completion_callback(_ => r.unregister());
+          resolve(r.active || r.installing || r.waiting);
+        });
+    });
+    return { iframe: iframe, name: name, sw: sw };
+  }));
+
+  // Setup a MessageChannel for each pair (iframe, serviceworker).
+  // Ping each serviceworker telling him which iframe it belongs to.
+  iframes.forEach((iframe, i) => {
+    iframe.channel = new MessageChannel();
+    iframe.sw.postMessage({ from: iframe.name }, [iframe.channel.port2]);
+  });
+
+  let msg_promises = iframes.map(iframe => new Promise(resolve => {
+    iframe.channel.port1.onmessage = event => resolve(event.data);
+  }));
+
+  // Ping each (iframe, serviceworker) asking for which messages it got.
+  iframes.map(iframe => iframe.sw.postMessage({ check: iframe.name }));
+
+  // Collect all replies.
+  let msgs = await Promise.all(msg_promises);
+
+  // The "normal" iframe serviceworker belongs to the "normal" and the
+  // "normal_control" iframes.
+  assert_true(!!msgs[0]["normal"]);
+  assert_true(!!msgs[0]["normal_control"]);
+  assert_false(!!msgs[0]["anonymous"]);
+  assert_false(!!msgs[0]["anonymous_control"]);
+
+  // The "normal_control" iframe shares the same serviceworker as the "normal"
+  // iframe.
+  assert_true(!!msgs[1]["normal"]);
+  assert_true(!!msgs[1]["normal_control"]);
+  assert_false(!!msgs[1]["anonymous"]);
+  assert_false(!!msgs[1]["anonymous_control"]);
+
+  // The "anonymous" iframe serviceworker belongs to the "anonymous" and the
+  // "anonymous_control" iframes.
+  assert_false(!!msgs[2]["normal"]);
+  assert_false(!!msgs[2]["normal_control"]);
+  assert_true(!!msgs[2]["anonymous"]);
+  assert_true(!!msgs[2]["anonymous_control"]);
+
+  // The "anonymous_control" iframe shares the same serviceworker as
+  // the "anonymous" iframe.
+  assert_false(!!msgs[3]["normal"]);
+  assert_false(!!msgs[3]["normal_control"]);
+  assert_true(!!msgs[3]["anonymous"]);
+  assert_true(!!msgs[3]["anonymous_control"]);
+
+}, "Anonymous iframes get partitioned service workers.");
+
+</script>
+</body>
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyanonymousiframew3cimportlog"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/w3c-import.log (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/w3c-import.log 2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/w3c-import.log    2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -14,5 +14,9 @@
</span><span class="cx"> None
</span><span class="cx"> ------------------------------------------------------------------------
</span><span class="cx"> List of files:
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/anonymous-iframe-popup.tentative.https.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/cookie.tentative.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/local-storage.tentative.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/require-corp-embed-anonymous-iframe.tentative.https.html
+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/require-corp-embed-anonymous-iframe.tentative.https.html.headers
+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/serviceworker-partitioning.tentative.https.html
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyblobhttpshtml"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/blob.https.html (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/blob.https.html 2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/blob.https.html    2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -21,7 +21,7 @@
</span><span class="cx">     "crossOrigin": origins.HTTPS_ORIGIN
</span><span class="cx">   }
</span><span class="cx"> ].forEach(({ origin, crossOrigin }) => {
</span><del>-  ["subframe", "navigate"].forEach(variant => {
</del><ins>+  ["subframe", "navigate", "popup"].forEach(variant => {
</ins><span class="cx">     async_test(t => {
</span><span class="cx">       const id = token();
</span><span class="cx">       const frame = document.createElement("iframe");
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">       t.add_cleanup(() => { frame.remove(); });
</span><span class="cx">       const path = new URL("resources/blob-url-factory.html", window.location).pathname;
</span><span class="cx">       frame.src = `${origin}${path}?id=${id}&variant=${variant}&crossOrigin=${crossOrigin}`;
</span><del>-      window.addEventListener("message", t.step_func_done(({ data }) => {
</del><ins>+      window.addEventListener("message", t.step_func(({ data }) => {
</ins><span class="cx">         if (data.id !== id) {
</span><span class="cx">           return;
</span><span class="cx">         }
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx">         assert_equals(data.origin, origin);
</span><span class="cx">         assert_true(data.sameOriginNoCORPSuccess, "Same-origin without CORP did not succeed");
</span><span class="cx">         assert_true(data.crossOriginNoCORPFailure, "Cross-origin without CORP did not fail");
</span><ins>+        t.done();
</ins><span class="cx">       }));
</span><span class="cx">       document.body.append(frame);
</span><span class="cx">     }, `Cross-Origin-Embedder-Policy and blob: URL from ${origin} in subframe via ${variant}`);
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallesscachestoragetentativehttpshtml"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/cache-storage.tentative.https.html (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/cache-storage.tentative.https.html       2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/cache-storage.tentative.https.html  2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -61,9 +61,9 @@
</span><span class="cx"> const environment = location.search.substr(1);
</span><span class="cx"> const constructor = environments[environment];
</span><span class="cx"> 
</span><del>-const context_none = constructor(coep_none);
-const context_credentialless = constructor(coep_credentialless);
-const context_require_corp = constructor(coep_require_corp);
</del><ins>+const context_none = constructor(coep_none)[0];
+const context_credentialless = constructor(coep_credentialless)[0];
+const context_require_corp = constructor(coep_require_corp)[0];
</ins><span class="cx"> 
</span><span class="cx"> cacheStorageTest(`[${environment}] unsafe-none => unsafe-none`,
</span><span class="cx">   context_none,
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallessreportingsubresourcecorptentativehttpshtml"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/reporting-subresource-corp.tentative.https.html (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/reporting-subresource-corp.tentative.https.html  2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/reporting-subresource-corp.tentative.https.html     2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -10,47 +10,44 @@
</span><span class="cx"> <script>
</span><span class="cx"> const {ORIGIN, REMOTE_ORIGIN} = get_host_info();
</span><span class="cx"> const BASE = "/html/cross-origin-embedder-policy/resources";
</span><del>-const FRAME_URL = `${ORIGIN}/common/blank.html` +
-  '?pipe=header(cross-origin-embedder-policy,credentialless)' +
-  `|header(cross-origin-embedder-policy-report-only,credentialless)`;
-const WORKER_URL = `${ORIGIN}${BASE}/reporting-worker.js` +
-  '?pipe=header(cross-origin-embedder-policy,credentialless)' +
-  `|header(cross-origin-embedder-policy-report-only,credentialless)`;
</del><span class="cx"> const REPORTING_FRAME_URL = `${ORIGIN}${BASE}/reporting-empty-frame.html` +
</span><span class="cx">   '?pipe=header(cross-origin-embedder-policy,credentialless)' +
</span><del>-  `|header(cross-origin-embedder-policy-report-only,credentialless)`;
</del><ins>+  '&token=${token()}';
</ins><span class="cx"> 
</span><del>-function wait(ms) {
-  return new Promise(resolve => step_timeout(resolve, ms));
</del><ins>+async function observeReports(global, expected_count) {
+  const reports = [];
+  const receivedEveryReports = new Promise(resolve => {
+    if (expected_count == 0)
+      resolve();
+
+    const observer = new global.ReportingObserver((rs) => {
+      for (const r of rs) {
+        reports.push(r.toJSON());
+      }
+      if (expected_count <= reports.length)
+        resolve();
+    });
+    observer.observe();
+
+  });
+
+  await receivedEveryReports;
+  // Wait 1000ms more to catch additionnal unexpected reports.
+  await new Promise(r => step_timeout(r, 1000));
+  return reports;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-async function fetchInFrame(t, frameUrl, url) {
-  const reports = [];
</del><ins>+async function fetchInFrame(t, frameUrl, url, expected_count) {
</ins><span class="cx">   const frame = await with_iframe(frameUrl);
</span><span class="cx">   t.add_cleanup(() => frame.remove());
</span><span class="cx"> 
</span><del>-  const observer = new frame.contentWindow.ReportingObserver((rs) => {
-    for (const report of rs) {
-      reports.push(report.toJSON());
-    }
-  });
-  observer.observe();
</del><span class="cx">   const init = { mode: 'no-cors', cache: 'no-store' };
</span><ins>+  let future_reports = observeReports(frame.contentWindow, expected_count);
</ins><span class="cx">   await frame.contentWindow.fetch(url, init).catch(() => {});
</span><span class="cx"> 
</span><del>-  // Wait 1000ms for reports to settle.
-  await new Promise(r => step_timeout(r, 1000));
-  return reports;
</del><ins>+  return await future_reports;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-async function fetchInWorker(workerOrPort, url) {
-  const script =
-    `fetch('${url}', {mode: 'no-cors', cache: 'no-store'}).catch(() => {});`;
-  const mc = new MessageChannel();
-  workerOrPort.postMessage({script, port: mc.port2}, [mc.port2]);
-  return (await new Promise(r => mc.port1.onmessage = r)).data;
-}
-
</del><span class="cx"> function checkReport(report, contextUrl, blockedUrl, disposition, destination) {
</span><span class="cx">   assert_equals(report.type, 'coep');
</span><span class="cx">   assert_equals(report.url, contextUrl);
</span><span class="lines">@@ -60,143 +57,26 @@
</span><span class="cx">   assert_equals(report.body.destination, destination);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// We want to test several URLs in various environments (document,
-// dedicated worker, shared worker, service worker). As expectations
-// are independent of environment except for the context URLs in reports,
-// we define ENVIRONMENTS and CASES to reduce the code duplication.
-//
-// ENVIRONMENTS is a list of dictionaries. Each dictionary consists of:
-//  - tag: the name of the environment
-//  - contextUrl: the URL of the environment settings object
-//  - run: an async function which generates reports
-//    - test: a testharness Test object
-//    - url: the URL for a test case (see below)
-//
-// CASES is a list of test cases. Each test case consists of:
-//  - name: the name of the test case
-//  - url: the URL of the test case
-//  - check: a function to check the results
-//    - reports: the generated reports
-//    - url: the URL of the test case
-//    - contextUrl: the URL of the environment settings object (see
-//                  ENVORONMENTS)
-
-const ENVIRONMENTS = [{
-  tag: 'document',
-  contextUrl: FRAME_URL,
-  run: async (test, url) => {
-    return await fetchInFrame(test, FRAME_URL, url);
-  },
-}, {
-  tag: 'dedicated worker',
-  contextUrl: WORKER_URL,
-  run: async (test, url) => {
-    const worker = new Worker(WORKER_URL);
-    worker.addEventListener('error', test.unreached_func('Worker.onerror'));
-    test.add_cleanup(() => worker.terminate());
-    return await fetchInWorker(worker, url);
-  },
-}, {
-  tag: 'shared worker',
-  contextUrl: WORKER_URL,
-  run: async (test, url) => {
-    const worker = new SharedWorker(WORKER_URL);
-    worker.addEventListener('error', test.unreached_func('Worker.onerror'));
-    return await fetchInWorker(worker.port, url);
-  },
-}, {
-  tag: 'service worker',
-  contextUrl: WORKER_URL,
-  run: async (test, url) => {
-    // Generate a one-time scope for service workeer.
-    const SCOPE = `${BASE}/${token()}.html`;
-    const reg =
-      await service_worker_unregister_and_register(test, WORKER_URL, SCOPE);
-    test.add_cleanup(() => reg.unregister());
-    const worker = reg.installing || reg.waiting || reg.active;
-    worker.addEventListener('error', test.unreached_func('Worker.onerror'));
-    return await fetchInWorker(worker, url);
-  },
-}, {
-  tag: 'between service worker and page',
-  contextUrl: REPORTING_FRAME_URL,
-  run: async (test, url) => {
-    // Service Worker without COEP.
-    const WORKER_URL = `${ORIGIN}${BASE}/sw.js`;
-    const reg = await service_worker_unregister_and_register(
-      test, WORKER_URL, REPORTING_FRAME_URL);
-    test.add_cleanup(() => reg.unregister());
-    const worker = reg.installing || reg.waiting || reg.active;
-    worker.addEventListener('error', test.unreached_func('Worker.onerror'));
-    return await fetchInFrame(
-      test, REPORTING_FRAME_URL, url);
-  },
-}];
-
-const CASES = [{
-  name: 'same-origin',
-  url: '/common/text-plain.txt',
-  check: (reports, url, contextUrl) => {
-    assert_equals(reports.length, 0);
-  }
-}, {
-  name: 'blocked by CORP: same-origin',
-  url: `${REMOTE_ORIGIN}${BASE}/nothing-same-origin-corp.txt`,
-  check: (reports, url, contextUrl) => {
-    assert_equals(reports.length, 0);
-  }
-}, {
-  name: 'blocked due to COEP',
-  url: `${REMOTE_ORIGIN}/common/text-plain.txt`,
-  check: (reports, contextUrl, url) => {
-    assert_equals(reports.length, 0);
-  }
-}, {
-  name: 'blocked during redirect',
-  url: `${ORIGIN}/common/redirect.py?location=` +
-       encodeURIComponent(`${REMOTE_ORIGIN}/common/text-plain.txt`),
-  check: (reports, contextUrl, url) => {
-    // The redirection is blocked because CORP is required on the response here
-    // according to https://github.com/w3c/ServiceWorker/issues/1592
-    if (contextUrl === REPORTING_FRAME_URL) {
-      assert_equals(reports.length, 1);
-      checkReport(reports[0], contextUrl, url, 'enforce', '');
-    } else {
-      assert_equals(reports.length, 0);
-    }
-  },
-}];
-
-for (const env of ENVIRONMENTS) {
-  for (const testcase of CASES) {
-    promise_test(async (t) => {
-      const reports = await env.run(t, testcase.url);
-      testcase.check(reports, env.contextUrl, testcase.url);
-    }, `[${env.tag}] ${testcase.name}`);
-  }
-}
-
-// A test for a non-empty destination.
</del><ins>+// A redirection is used, so that the initial request is same-origin and is
+// proxyied through the service worker. The ServiceWorker is COEP:unsafe-none,
+// so it will make the cross-origin request with credentials. The fetch will
+// succeed, but the response will be blocked by CORP when entering the
+// COEP:credentialless document.
+// https://github.com/w3c/ServiceWorker/issues/1592
</ins><span class="cx"> promise_test(async (t) => {
</span><del>-  const reports = [];
-  const frame = await with_iframe(FRAME_URL);
-  t.add_cleanup(() => frame.remove());
</del><ins>+  const url = `${ORIGIN}/common/redirect.py?location=` +
+       encodeURIComponent(`${REMOTE_ORIGIN}/common/text-plain.txt`);
+  const WORKER_URL = `${ORIGIN}${BASE}/sw.js`;
+  const reg = await service_worker_unregister_and_register(
+    t, WORKER_URL, REPORTING_FRAME_URL);
+  t.add_cleanup(() => reg.unregister());
+  const worker = reg.installing || reg.waiting || reg.active;
+  worker.addEventListener('error', t.unreached_func('Worker.onerror'));
+  await wait_for_state(t, worker, 'activated');
</ins><span class="cx"> 
</span><del>-  const observer = new frame.contentWindow.ReportingObserver((rs) => {
-    for (const report of rs) {
-      reports.push(report.toJSON());
-    }
-  });
-  observer.observe();
-  const url = `${REMOTE_ORIGIN}/common/utils.js`;
-  const script = frame.contentDocument.createElement('script');
-  script.src = url;
-  frame.contentDocument.body.appendChild(script);
</del><ins>+  const reports = await fetchInFrame(t, REPORTING_FRAME_URL, url, 1);
+  assert_equals(reports.length, 1);
+  checkReport(reports[0], REPORTING_FRAME_URL, url, 'enforce', '');
+});
</ins><span class="cx"> 
</span><del>-  // Wait 200ms for reports to settle.
-  await t.step_timeout(200);
-
-  assert_equals(reports.length, 0);
-}, 'destination: script');
-
</del><span class="cx"> </script>
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallessresourcescommonjs"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/common.js (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/common.js      2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/common.js 2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> const directory = '/html/cross-origin-embedder-policy/credentialless';
</span><span class="cx"> const executor_path = directory + '/resources/executor.html?pipe=';
</span><span class="cx"> const executor_js_path = directory + '/resources/executor.js?pipe=';
</span><ins>+const sw_executor_js_path = directory + '/resources/sw_executor.js?pipe=';
</ins><span class="cx"> 
</span><span class="cx"> // COEP
</span><span class="cx"> const coep_none =
</span><span class="lines">@@ -89,6 +90,11 @@
</span><span class="cx">   return sub_document_token;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+// A common interface for building the 4 type of execution contexts:
+// It outputs: [
+//   - The token to communicate with the environment.
+//   - A promise resolved when the environment encounters an error.
+// ]
</ins><span class="cx"> const environments = {
</span><span class="cx">   document: headers => {
</span><span class="cx">     const tok = token();
</span><span class="lines">@@ -95,7 +101,7 @@
</span><span class="cx">     const url = window.origin + executor_path + headers + `&uuid=${tok}`;
</span><span class="cx">     const context = window.open(url);
</span><span class="cx">     add_completion_callback(() => context.close());
</span><del>-    return tok;
</del><ins>+    return [tok, new Promise(resolve => {})];
</ins><span class="cx">   },
</span><span class="cx"> 
</span><span class="cx">   dedicated_worker: headers => {
</span><span class="lines">@@ -102,7 +108,7 @@
</span><span class="cx">     const tok = token();
</span><span class="cx">     const url = window.origin + executor_js_path + headers + `&uuid=${tok}`;
</span><span class="cx">     const context = new Worker(url);
</span><del>-    return tok;
</del><ins>+    return [tok, new Promise(resolve => context.onerror = resolve)];
</ins><span class="cx">   },
</span><span class="cx"> 
</span><span class="cx">   shared_worker: headers => {
</span><span class="lines">@@ -109,7 +115,7 @@
</span><span class="cx">     const tok = token();
</span><span class="cx">     const url = window.origin + executor_js_path + headers + `&uuid=${tok}`;
</span><span class="cx">     const context = new SharedWorker(url);
</span><del>-    return tok;
</del><ins>+    return [tok, new Promise(resolve => context.onerror = resolve)];
</ins><span class="cx">   },
</span><span class="cx"> 
</span><span class="cx">   service_worker: headers => {
</span><span class="lines">@@ -116,12 +122,12 @@
</span><span class="cx">     const tok = token();
</span><span class="cx">     const url = window.origin + executor_js_path + headers + `&uuid=${tok}`;
</span><span class="cx">     const scope = url; // Generate a one-time scope for service worker.
</span><del>-    navigator.serviceWorker.register(url, {scope: scope})
-    .then(registration => {
-      add_completion_callback(() => registration.unregister());
</del><ins>+    const error = new Promise(resolve => {
+      navigator.serviceWorker.register(url, {scope: scope})
+        .then(registration => {
+          add_completion_callback(() => registration.unregister());
+        }, /* catch */ resolve);
</ins><span class="cx">     });
</span><del>-    return tok;
</del><ins>+    return [tok, error];
</ins><span class="cx">   },
</span><span class="cx"> };
</span><del>-
-
</del></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallessresourcessw_executorjs"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/sw_executor.js (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/sw_executor.js                         (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/sw_executor.js    2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+importScripts('./dispatcher.js');
+
+const params = new URLSearchParams(location.search);
+const uuid = params.get('uuid');
+
+// The fetch handler must be registered before parsing the main script response.
+// So do it here, for future use.
+fetchHandler = () => {}
+addEventListener('fetch', e => {
+  fetchHandler(e);
+});
+
+// Force ServiceWorker to immediately activate itself.
+addEventListener('install', event => {
+  skipWaiting();
+});
+
+let executeOrders = async function() {
+  while(true) {
+    let task = await receive(uuid);
+    eval(`(async () => {${task}})()`);
+  }
+};
+executeOrders();
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallessresourcesw3cimportlog"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/w3c-import.log (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/w3c-import.log 2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/w3c-import.log    2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -21,3 +21,4 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/executor.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/executor.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/iframeTest.js
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/resources/sw_executor.js
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallessserviceworkercoepcredentiallessproxytentativehttpshtml"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/service-worker-coep-credentialless-proxy.tentative.https.html (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/service-worker-coep-credentialless-proxy.tentative.https.html                            (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/service-worker-coep-credentialless-proxy.tentative.https.html       2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="/common/utils.js"></script>
+<script src="./resources/common.js"></script>
+<script src="./resources/dispatcher.js"></script>
+<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
+<script>
+
+const resource_path = directory + "/resources/";
+const same_origin = get_host_info().HTTPS_ORIGIN;
+const cross_origin = get_host_info().HTTPS_REMOTE_ORIGIN;
+
+promise_test(async test => {
+  const this_token_1 = token();
+  const this_token_2 = token();
+
+  // Register a COEP:credentialless ServiceWorker.
+  const sw_token = token();
+  const sw_url =
+    sw_executor_js_path + coep_credentialless + `&uuid=${sw_token}`;
+  const sw_registration =
+    await service_worker_unregister_and_register(test, sw_url, resource_path);
+  test.add_cleanup(() => sw_registration.unregister());
+  await wait_for_state(test, sw_registration.installing, 'activated');
+
+  // Configure the ServiceWorker to proxy the fetch requests. Wait for the
+  // worker to be installed and activated.
+  send(sw_token, `
+    fetchHandler = event => {
+      if (!event.request.url.includes("/proxied"))
+        return;
+
+      send("${this_token_1}", "ServiceWorker: Proxying");
+
+      // Response with a cross-origin no-cors resource.
+      const url = "${cross_origin}" + "/common/blank.html}";
+
+      event.respondWith(new Promise(async resolve => {
+        try {
+          let response = await fetch(url, {
+            mode: "no-cors",
+            credentials: "include"
+          });
+          send("${this_token_1}", "ServiceWorker: Fetch success");
+          resolve(response);
+        } catch (error) {
+          send("${this_token_1}", "ServiceWorker: Fetch failure");
+          resolve(new Response("", {status: 400}));
+        }
+      }));
+    }
+
+    await clients.claim();
+
+    send("${this_token_1}", serviceWorker.state);
+  `)
+  assert_equals(await receive(this_token_1), "activated");
+
+  // Create a COEP:credentialless document.
+  const document_token = environments["document"](coep_credentialless)[0];
+
+  // The document fetches a same-origin no-cors resource. The requests needs to
+  // be same-origin to be handled by the ServiceWorker.
+  send(document_token, `
+    try {
+      const response = await fetch("/proxied", { mode: "no-cors", });
+
+      send("${this_token_2}", "Document: Fetch success");
+    } catch (error) {
+      send("${this_token_2}", "Document: Fetch error");
+    }
+  `);
+
+  // The COEP:credentialless ServiceWorker is able to handle the cross-origin
+  // no-cors request, requested with credentials.
+  assert_equals(await receive(this_token_1), "ServiceWorker: Proxying");
+  assert_equals(await receive(this_token_1), "ServiceWorker: Fetch success");
+
+  // The COEP:credentialless Document is allowed by CORP to get it.
+  assert_equals(await receive(this_token_2), "Document: Fetch success");
+
+  // test.add_cleanup doesn't allow waiting for a promise. Unregistering a
+  // ServiceWorker is an asynchronous operation. It might not be completed on
+  // time for the next test. Do it here for extra flakiness safety.
+  await sw_registration.unregister()
+}, "COEP:credentialless ServiceWorker");
+
+</script>
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallessserviceworkercoepnoneproxytentativehttpshtml"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/service-worker-coep-none-proxy.tentative.https.html (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/service-worker-coep-none-proxy.tentative.https.html                              (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/service-worker-coep-none-proxy.tentative.https.html 2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="/common/utils.js"></script>
+<script src="./resources/common.js"></script>
+<script src="./resources/dispatcher.js"></script>
+<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
+<script>
+
+const resource_path = directory + "/resources/";
+const same_origin = get_host_info().HTTPS_ORIGIN;
+const cross_origin = get_host_info().HTTPS_REMOTE_ORIGIN;
+
+promise_test(async test => {
+  const this_token_1 = token();
+  const this_token_2 = token();
+
+  // Register a COEP:none ServiceWorker.
+  const sw_token = token();
+  const sw_url = sw_executor_js_path + coep_none + `&uuid=${sw_token}`;
+  const sw_registration =
+    await service_worker_unregister_and_register(test, sw_url, resource_path);
+  test.add_cleanup(() => sw_registration.unregister());
+  await wait_for_state(test, sw_registration.installing, 'activated');
+
+  // Configure the ServiceWorker to proxy the fetch requests. Wait for the
+  // worker to be installed and activated.
+  send(sw_token, `
+    fetchHandler = event => {
+      if (!event.request.url.includes("/proxied"))
+        return;
+
+      send("${this_token_1}", "ServiceWorker: Proxying");
+
+      // Response with a cross-origin no-cors resource.
+      const url = "${cross_origin}" + "/common/blank.html}";
+
+      event.respondWith(new Promise(async resolve => {
+        try {
+          let response = await fetch(url, {
+            mode: "no-cors",
+            credentials: "include"
+          });
+          send("${this_token_1}", "ServiceWorker: Fetch success");
+          resolve(response);
+        } catch (error) {
+          send("${this_token_1}", "ServiceWorker: Fetch failure");
+          resolve(new Response("", {status: 400}));
+        }
+      }));
+    }
+
+    await clients.claim();
+
+    send("${this_token_1}", serviceWorker.state);
+  `)
+  assert_equals(await receive(this_token_1), "activated");
+
+  // Create a COEP:credentialless document.
+  const document_token = environments["document"](coep_credentialless)[0];
+
+  // The document fetches a same-origin no-cors resource. The requests needs to
+  // be same-origin to be handled by the ServiceWorker.
+  send(document_token, `
+    try {
+      const response = await fetch("/proxied", {
+        mode: "no-cors",
+        credentials: "include"
+      });
+
+      send("${this_token_2}", "Document: Fetch success");
+    } catch (error) {
+      send("${this_token_2}", "Document: Fetch error");
+    }
+  `);
+
+  // The COEP:unsafe-none ServiceWorker is able to handle the cross-origin
+  // no-cors request, requested with credentials.
+  assert_equals(await receive(this_token_1), "ServiceWorker: Proxying");
+  assert_equals(await receive(this_token_1), "ServiceWorker: Fetch success");
+
+  // However, the COEP:credentialless Document is disallowed by CORP to get it.
+  assert_equals(await receive(this_token_2), "Document: Fetch error");
+
+  // test.add_cleanup doesn't allow waiting for a promise. Unregistering a
+  // ServiceWorker is an asynchronous operation. It might not be completed on
+  // time for the next test. Do it here for extra flakiness safety.
+  await sw_registration.unregister()
+}, "COEP:unsafe-none ServiceWorker");
+
+</script>
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallesssharedworkertentativehttpshtml"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/shared-worker.tentative.https.html (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/shared-worker.tentative.https.html       2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/shared-worker.tentative.https.html  2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx">   sharedWorkerTest("same-origin",
</span><span class="cx">     same_origin, coep_none,
</span><span class="cx">     cookie_same_origin,
</span><del>-    "Worker blocked");
</del><ins>+    cookie_same_origin);
</ins><span class="cx"> 
</span><span class="cx">   sharedWorkerTest("same-origin + credentialless worker",
</span><span class="cx">     same_origin, coep_credentialless,
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx">   sharedWorkerTest("cross-origin",
</span><span class="cx">     cross_origin, coep_none,
</span><span class="cx">     cookie_cross_origin,
</span><del>-    "Worker blocked");
</del><ins>+    cookie_cross_origin);
</ins><span class="cx"> 
</span><span class="cx">   sharedWorkerTest("cross-origin + credentialless worker",
</span><span class="cx">     cross_origin, coep_credentialless,
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicycredentiallessw3cimportlog"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/w3c-import.log (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/w3c-import.log   2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/w3c-import.log      2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/reporting-navigation.tentative.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/reporting-subresource-corp.tentative.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/script.tentative.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/service-worker-coep-credentialless-proxy.tentative.https.html
+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/service-worker-coep-none-proxy.tentative.https.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/service-worker.tentative.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/shared-worker.tentative.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/video.tentative.https.html
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyiframehistorynonerequirecorphttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/iframe-history-none-require-corp.https-expected.txt (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/iframe-history-none-require-corp.https-expected.txt                             (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/iframe-history-none-require-corp.https-expected.txt        2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+PASS "none" top-level: navigating a frame back from "require-corp" should succeed
+
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyiframehistorynonerequirecorphttpshtml"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/iframe-history-none-require-corp.https.html (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/iframe-history-none-require-corp.https.html                             (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/iframe-history-none-require-corp.https.html        2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+<meta name="timeout" content="long">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=/common/utils.js></script
+<script src="/common/get-host-info.sub.js"></script>
+<script>
+
+promise_test(async test => {
+  // TODO(arthursonzogni): Consider switching toward another message passing
+  // API like:
+  // /html/cross-origin-embedder-policy/credentialless/resources/dispatcher.js
+  const bc = new BroadcastChannel(token());
+  const futureMessage = () => {
+    return new Promise(resolve => {
+      bc.onmessage = event => resolve(event.data);
+    });
+  };
+
+  const prefix = document.URL.substr(0, document.URL.lastIndexOf('/'))
+  const attribute = `?channelName=${bc.name}`;
+  const url_coep_none =
+    prefix + "/resources/navigate-none.sub.html" + attribute;
+  const url_coep_require_corp =
+    prefix + "/resources/navigate-require-corp.sub.html" + attribute;
+
+  const w = window.open();
+  test.add_cleanup(() => w.close());
+
+  // Navigate to COEP:unsafe-none.
+  w.location.href = url_coep_none;
+  assert_equals(await futureMessage(), "loaded");
+  assert_equals(w.location.href, url_coep_none);
+
+  // For unknown reasons so far. Waiting in between the different navigations
+  // avoids flakes.
+  await new Promise(resolve => test.step_timeout(resolve, 1000));
+
+  // Navigate to COEP:require-corp.
+  w.location.href = url_coep_require_corp;
+  assert_equals(await futureMessage(), "loaded");
+  assert_equals(w.location.href, url_coep_require_corp);
+
+  // For unknown reasons so far. Waiting in between the different navigations
+  // avoids flakes.
+  await new Promise(resolve => test.step_timeout(resolve, 1000));
+
+  // Navigate back to COEP:unsafe-none, using the history API.
+  // Note: `url_coep_none` already take the BFCache into account.
+  w.history.back();
+  assert_equals(await futureMessage(), "loaded");
+  assert_equals(w.location.href, url_coep_none);
+}, `"none" top-level: navigating a frame back from "require-corp" should succeed`);
+
+</script>
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicynonehttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none.https-expected.txt (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none.https-expected.txt 2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none.https-expected.txt    2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -1,7 +1,6 @@
</span><span class="cx"> 
</span><span class="cx"> PASS "none" top-level: navigating a frame to "none" should succeed
</span><span class="cx"> PASS "none" top-level: navigating a frame from "require-corp" to "none" should succeed
</span><del>-PASS "none" top-level: navigating a frame back from "require-corp" should succeed
</del><span class="cx"> PASS "require-corp" top-level noopener popup: navigating to "none" should succeed
</span><span class="cx"> PASS CORP: same-site is not checked.
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicynonehttpshtml"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none.https.html (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none.https.html 2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none.https.html    2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -1,4 +1,3 @@
</span><del>-<!doctype html>
</del><span class="cx"> <meta name="timeout" content="long">
</span><span class="cx"> <title>Cross-Origin-Embedder-Policy header and nested navigable resource without such header</title>
</span><span class="cx"> <script src=/resources/testharness.js></script>
</span><span class="lines">@@ -7,6 +6,7 @@
</span><span class="cx"> <script src="/common/get-host-info.sub.js"></script>
</span><span class="cx"> <div id=log></div>
</span><span class="cx"> <script>
</span><ins>+
</ins><span class="cx"> const HOST = get_host_info();
</span><span class="cx"> const BASE = new URL("resources", location).pathname;
</span><span class="cx"> 
</span><span class="lines">@@ -42,38 +42,10 @@
</span><span class="cx"> }, `"none" top-level: navigating a frame from "require-corp" to "none" should succeed`);
</span><span class="cx"> 
</span><span class="cx"> async_test(t => {
</span><del>-  Promise.resolve().then(async () => {
-    const bc = new BroadcastChannel(token());
-    const futureMessage = () => {
-      return new Promise(resolve => {
-        bc.onmessage = event => resolve(event.data);
-      });
-    };
-
-    const prefix = document.URL.substr(0, document.URL.lastIndexOf('/'))
-    const attribute = `?channelName=${bc.name}`;
-    const url_1 = prefix + "/resources/navigate-none.sub.html" + attribute;
-    const url_2 = prefix + "/resources/navigate-require-corp.sub.html" + attribute;
-
-    const w = window.open(url_1, "window_name");
-    t.add_cleanup(() => w.close());
-    assert_equals(await futureMessage(), "loaded");
-    assert_equals(w.location.href, url_1);
-
-    w.location.href = url_2;
-    assert_equals(await futureMessage(), "loaded");
-    assert_equals(w.location.href, url_2);
-
-    w.history.back();
-    assert_equals(await futureMessage(), "loaded");
-    assert_equals(w.location.href, url_1);
-
-    t.done();
-  }).catch((e) => t.unreached_func(e));
-}, `"none" top-level: navigating a frame back from "require-corp" should succeed`);
-
-async_test(t => {
</del><span class="cx">   let pageLoaded = false;
</span><ins>+  // TODO(arthursonzogni): Consider switching toward another message passing
+  // API like:
+  // /html/cross-origin-embedder-policy/credentialless/resources/dispatcher.js
</ins><span class="cx">   const bc = new BroadcastChannel(token());
</span><span class="cx">   let finished = false;
</span><span class="cx">   let doneCheck = _ => {
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyreportingnavigationhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-navigation.https-expected.txt (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-navigation.https-expected.txt 2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-navigation.https-expected.txt    2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -1,152 +1,34 @@
</span><ins>+CONSOLE MESSAGE: Refused to load https://127.0.0.1:9443/common/blank.html?pipe=|header(cross-origin-resource-policy,cross-origin)|header(content-security-policy,frame-ancestors%20%27none%27) because it does not appear in the frame-ancestors directive of the Content Security Policy.
+CONSOLE MESSAGE: Refused to load https://127.0.0.1:9443/common/blank.html?pipe=|header(cross-origin-resource-policy,cross-origin)|header(content-security-policy,frame-ancestors%20%27none%27) because it does not appear in the frame-ancestors directive of the Content Security Policy.
</ins><span class="cx"> 
</span><del>-FAIL parent: (none), target: (none), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: (none), target: (none), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: (none), target: |header(cross-origin-embedder-policy,require-corp), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: (none), target: |header(cross-origin-embedder-policy,require-corp), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-embedder-policy,require-corp), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-embedder-policy,require-corp), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: (none), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: (none), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: (none), target: |header(cross-origin-resource-policy,cross-origin), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: (none), target: |header(cross-origin-resource-policy,cross-origin), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-resource-policy,cross-origin), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-resource-policy,cross-origin), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: (none), target: |header(cross-origin-embedder-policy,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: (none), target: |header(cross-origin-embedder-policy,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-embedder-policy,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-embedder-policy,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: |header(cross-origin-embedder-policy,require-corp), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: |header(cross-origin-embedder-policy,require-corp), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: (none), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: (none), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: |header(cross-origin-resource-policy,cross-origin), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: |header(cross-origin-resource-policy,cross-origin), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: |header(cross-origin-embedder-policy,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: |header(cross-origin-embedder-policy,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-embedder-policy-report-only,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-embedder-policy-report-only,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-resource-policy,cross-origin)|header(content-security-policy,frame-ancestors 'none'), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-resource-policy,cross-origin)|header(content-security-policy,frame-ancestors 'none'), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-resource-policy,cross-origin)|header(x-frame-options,deny), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
-FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-resource-policy,cross-origin)|header(x-frame-options,deny), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
-  })')
</del><ins>+PASS parent: (none), target: (none), with empty frame: false
+PASS parent: (none), target: (none), with empty frame: true
+PASS parent: (none), target: |header(cross-origin-embedder-policy,require-corp), with empty frame: false
+PASS parent: (none), target: |header(cross-origin-embedder-policy,require-corp), with empty frame: true
+FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-embedder-policy,require-corp), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver')
+FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-embedder-policy,require-corp), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver')
+FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: (none), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver')
+FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: (none), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver')
+PASS parent: (none), target: |header(cross-origin-resource-policy,cross-origin), with empty frame: false
+PASS parent: (none), target: |header(cross-origin-resource-policy,cross-origin), with empty frame: true
+FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-resource-policy,cross-origin), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver')
+FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-resource-policy,cross-origin), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver')
+PASS parent: (none), target: |header(cross-origin-embedder-policy,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: false
+PASS parent: (none), target: |header(cross-origin-embedder-policy,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: true
+PASS parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-embedder-policy,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: false
+PASS parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-embedder-policy,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: true
+FAIL parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: |header(cross-origin-embedder-policy,require-corp), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver')
+FAIL parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: |header(cross-origin-embedder-policy,require-corp), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver')
+FAIL parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: (none), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver')
+FAIL parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: (none), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver')
+FAIL parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: |header(cross-origin-resource-policy,cross-origin), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver')
+FAIL parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: |header(cross-origin-resource-policy,cross-origin), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver')
+PASS parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: |header(cross-origin-embedder-policy,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: false
+PASS parent: |header(cross-origin-embedder-policy-report-only,require-corp), target: |header(cross-origin-embedder-policy,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: true
+FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-embedder-policy-report-only,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver')
+FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-embedder-policy-report-only,require-corp)|header(cross-origin-resource-policy,cross-origin), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver')
+PASS parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-resource-policy,cross-origin)|header(content-security-policy,frame-ancestors 'none'), with empty frame: false
+PASS parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-resource-policy,cross-origin)|header(content-security-policy,frame-ancestors 'none'), with empty frame: true
+FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-resource-policy,cross-origin)|header(x-frame-options,deny), with empty frame: false undefined is not a constructor (evaluating 'new global.ReportingObserver')
+FAIL parent: |header(cross-origin-embedder-policy,require-corp), target: |header(cross-origin-resource-policy,cross-origin)|header(x-frame-options,deny), with empty frame: true undefined is not a constructor (evaluating 'new global.ReportingObserver')
</ins><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyreportingnavigationhttpshtml"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-navigation.https.html (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-navigation.https.html 2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-navigation.https.html    2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -5,6 +5,7 @@
</span><span class="cx"> <script src="/resources/testharness.js"></script>
</span><span class="cx"> <script src="/resources/testharnessreport.js"></script>
</span><span class="cx"> <script src="/common/get-host-info.sub.js"></script>
</span><ins>+<script src="./credentialless/resources/common.js"></script>
</ins><span class="cx"> <script>
</span><span class="cx"> const {ORIGIN, REMOTE_ORIGIN} = get_host_info();
</span><span class="cx"> const COEP = '|header(cross-origin-embedder-policy,require-corp)';
</span><span class="lines">@@ -67,16 +68,25 @@
</span><span class="cx">   return parent;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-async function observeReports(global) {
</del><ins>+async function observeReports(global, expected_count) {
</ins><span class="cx">   const reports = [];
</span><del>-  const observer = new global.ReportingObserver((rs) => {
-    for (const r of rs) {
-      reports.push(r.toJSON());
-    }
</del><ins>+  const receivedEveryReports = new Promise(resolve => {
+    if (expected_count == 0)
+      resolve();
+
+    const observer = new global.ReportingObserver((rs) => {
+      for (const r of rs) {
+        reports.push(r.toJSON());
+      }
+      if (expected_count <= reports.length)
+        resolve();
+    });
+    observer.observe();
+
</ins><span class="cx">   });
</span><del>-  observer.observe();
</del><span class="cx"> 
</span><del>-  // Wait 5000ms for reports to settle.
</del><ins>+  // Wait 5000 ms more to catch additionnal unexpected reports.
+  await receivedEveryReports;
</ins><span class="cx">   await new Promise(r => step_timeout(r, 5000));
</span><span class="cx">   return reports;
</span><span class="cx"> }
</span><span class="lines">@@ -125,30 +135,31 @@
</span><span class="cx">       loadFrames(t, testcase.parent, withEmptyFrame, targetUrl)
</span><span class="cx">           .then(t.step_func(parent => {
</span><span class="cx">         const contextUrl = parent.src ? parent.src : 'about:blank';
</span><del>-        observeReports(parent.contentWindow).then(t.step_func(reports => {
-          assert_equals(reports.length, testcase.reports.length);
-          for (let i = 0; i < reports.length; i += 1) {
-            const report = reports[i];
-            switch (testcase.reports[i]) {
-              case 'CORP':
-                checkCorpReport(report, contextUrl, targetUrl, 'enforce');
-                break;
-              case 'CORP-RO':
-                checkCorpReport(report, contextUrl, targetUrl, 'reporting');
-                break;
-              case 'NAV':
-                checkCoepMismatchReport(report, contextUrl, targetUrl, 'enforce');
-                break;
-              case 'NAV-RO':
-                checkCoepMismatchReport(report, contextUrl, targetUrl, 'reporting');
-                break;
-              default:
-                assert_unreached(
-                  'Unexpected report expeaction: ' + testcase.reports[i]);
</del><ins>+        observeReports(parent.contentWindow, testcase.reports.length)
+          .then(t.step_func(reports => {
+            assert_equals(reports.length, testcase.reports.length);
+            for (let i = 0; i < reports.length; i += 1) {
+              const report = reports[i];
+              switch (testcase.reports[i]) {
+                case 'CORP':
+                  checkCorpReport(report, contextUrl, targetUrl, 'enforce');
+                  break;
+                case 'CORP-RO':
+                  checkCorpReport(report, contextUrl, targetUrl, 'reporting');
+                  break;
+                case 'NAV':
+                  checkCoepMismatchReport(report, contextUrl, targetUrl, 'enforce');
+                  break;
+                case 'NAV-RO':
+                  checkCoepMismatchReport(report, contextUrl, targetUrl, 'reporting');
+                  break;
+                default:
+                  assert_unreached(
+                    'Unexpected report expeaction: ' + testcase.reports[i]);
+              }
</ins><span class="cx">             }
</span><del>-          }
-          t.done();
-        })).catch(t.step_func(e => { throw e; }));
</del><ins>+            t.done();
+          })).catch(t.step_func(e => { throw e; }));
</ins><span class="cx">       })).catch(t.step_func(e => { throw e; }));
</span><span class="cx">     }, `parent: ${desc(testcase.parent)}, target: ${desc(testcase.target)}, ` +
</span><span class="cx">        `with empty frame: ${withEmptyFrame}`);
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyreportingsubresourcecorphttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-subresource-corp.https-expected.txt (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-subresource-corp.https-expected.txt   2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-subresource-corp.https-expected.txt      2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -1,3 +1,11 @@
</span><ins>+CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt because it violates the resource's Cross-Origin-Resource-Policy response header.
+CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt due to access control checks.
+CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: undefined is not a constructor (evaluating 'new global.ReportingObserver')
+CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/text-plain.txt because it violates the resource's Cross-Origin-Resource-Policy response header.
+CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/text-plain.txt due to access control checks.
+CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: undefined is not a constructor (evaluating 'new global.ReportingObserver')
+CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/text-plain.txt because it violates the resource's Cross-Origin-Resource-Policy response header.
+CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/text-plain.txt due to access control checks.
</ins><span class="cx"> CONSOLE MESSAGE: ReferenceError: Can't find variable: ReportingObserver
</span><span class="cx"> CONSOLE MESSAGE: ReferenceError: Can't find variable: ReportingObserver
</span><span class="cx"> CONSOLE MESSAGE: ReferenceError: Can't find variable: ReportingObserver
</span><span class="lines">@@ -5,26 +13,10 @@
</span><span class="cx"> 
</span><span class="cx"> Harness Error (FAIL), message = ReferenceError: Can't find variable: ReportingObserver
</span><span class="cx"> 
</span><del>-FAIL [document] same-origin promise_test: Unhandled rejection with value: object "TypeError: undefined is not a constructor (evaluating 'new frame.contentWindow.ReportingObserver((rs) => {
-    for (const report of rs) {
-      reports.push(report.toJSON());
-    }
-  })')"
-FAIL [document] blocked by CORP: same-origin promise_test: Unhandled rejection with value: object "TypeError: undefined is not a constructor (evaluating 'new frame.contentWindow.ReportingObserver((rs) => {
-    for (const report of rs) {
-      reports.push(report.toJSON());
-    }
-  })')"
-FAIL [document] blocked due to COEP promise_test: Unhandled rejection with value: object "TypeError: undefined is not a constructor (evaluating 'new frame.contentWindow.ReportingObserver((rs) => {
-    for (const report of rs) {
-      reports.push(report.toJSON());
-    }
-  })')"
-FAIL [document] blocked during redirect promise_test: Unhandled rejection with value: object "TypeError: undefined is not a constructor (evaluating 'new frame.contentWindow.ReportingObserver((rs) => {
-    for (const report of rs) {
-      reports.push(report.toJSON());
-    }
-  })')"
</del><ins>+PASS [document] same-origin
+PASS [document] blocked by CORP: same-origin
+FAIL [document] blocked due to COEP promise_test: Unhandled rejection with value: object "TypeError: undefined is not a constructor (evaluating 'new global.ReportingObserver')"
+FAIL [document] blocked during redirect promise_test: Unhandled rejection with value: object "TypeError: undefined is not a constructor (evaluating 'new global.ReportingObserver')"
</ins><span class="cx"> FAIL [dedicated worker] same-origin assert_unreached: Worker.onerror Reached unreachable code
</span><span class="cx"> FAIL [dedicated worker] blocked by CORP: same-origin assert_unreached: Worker.onerror Reached unreachable code
</span><span class="cx"> FAIL [dedicated worker] blocked due to COEP assert_unreached: Worker.onerror Reached unreachable code
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyreportingsubresourcecorphttpshtml"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-subresource-corp.https.html (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-subresource-corp.https.html   2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-subresource-corp.https.html      2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -20,8 +20,27 @@
</span><span class="cx">   '?pipe=header(cross-origin-embedder-policy,require-corp)' +
</span><span class="cx">   `|header(cross-origin-embedder-policy-report-only,require-corp)`;
</span><span class="cx"> 
</span><del>-function wait(ms) {
-  return new Promise(resolve => step_timeout(resolve, ms));
</del><ins>+async function observeReports(global, expected_count) {
+  const reports = [];
+  const receivedEveryReports = new Promise(resolve => {
+    if (expected_count == 0)
+      resolve();
+
+    const observer = new global.ReportingObserver((rs) => {
+      for (const r of rs) {
+        reports.push(r.toJSON());
+      }
+      if (expected_count <= reports.length)
+        resolve();
+    });
+    observer.observe();
+
+  });
+
+  await receivedEveryReports;
+  // Wait 500ms more to catch additionnal unexpected reports.
+  await new Promise(r => step_timeout(r, 500));
+  return reports;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function checkReport(report, contextUrl, blockedUrl, disposition, destination) {
</span><span class="lines">@@ -33,23 +52,15 @@
</span><span class="cx">   assert_equals(report.body.destination, destination);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-async function fetchInFrame(t, frameUrl, url) {
-  const reports = [];
</del><ins>+async function fetchInFrame(t, frameUrl, url, expected_count) {
</ins><span class="cx">   const frame = await with_iframe(frameUrl);
</span><span class="cx">   t.add_cleanup(() => frame.remove());
</span><span class="cx"> 
</span><del>-  const observer = new frame.contentWindow.ReportingObserver((rs) => {
-    for (const report of rs) {
-      reports.push(report.toJSON());
-    }
-  });
-  observer.observe();
</del><span class="cx">   const init = { mode: 'no-cors', cache: 'no-store' };
</span><ins>+  let future_reports = observeReports(frame.contentWindow, expected_count);
</ins><span class="cx">   await frame.contentWindow.fetch(url, init).catch(() => {});
</span><span class="cx"> 
</span><del>-  // Wait 200ms for reports to settle.
-  await wait(200);
-  return reports;
</del><ins>+  return await future_reports;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> async function fetchInWorker(workerOrPort, url) {
</span><span class="lines">@@ -84,13 +95,13 @@
</span><span class="cx"> const ENVIRONMENTS = [{
</span><span class="cx">   tag: 'document',
</span><span class="cx">   contextUrl: FRAME_URL,
</span><del>-  run: async (test, url) => {
-    return await fetchInFrame(test, FRAME_URL, url);
</del><ins>+  run: async (test, url, expected_count) => {
+    return await fetchInFrame(test, FRAME_URL, url, expected_count);
</ins><span class="cx">   },
</span><span class="cx"> }, {
</span><span class="cx">   tag: 'dedicated worker',
</span><span class="cx">   contextUrl: WORKER_URL,
</span><del>-  run: async (test, url) => {
</del><ins>+  run: async (test, url, expected_count) => {
</ins><span class="cx">     const worker = new Worker(WORKER_URL);
</span><span class="cx">     worker.addEventListener('error', test.unreached_func('Worker.onerror'));
</span><span class="cx">     test.add_cleanup(() => worker.terminate());
</span><span class="lines">@@ -99,7 +110,7 @@
</span><span class="cx"> }, {
</span><span class="cx">   tag: 'shared worker',
</span><span class="cx">   contextUrl: WORKER_URL,
</span><del>-  run: async (test, url) => {
</del><ins>+  run: async (test, url, expected_count) => {
</ins><span class="cx">     const worker = new SharedWorker(WORKER_URL);
</span><span class="cx">     worker.addEventListener('error', test.unreached_func('Worker.onerror'));
</span><span class="cx">     return await fetchInWorker(worker.port, url);
</span><span class="lines">@@ -107,7 +118,7 @@
</span><span class="cx"> }, {
</span><span class="cx">   tag: 'service worker',
</span><span class="cx">   contextUrl: WORKER_URL,
</span><del>-  run: async (test, url) => {
</del><ins>+  run: async (test, url, expected_count) => {
</ins><span class="cx">     // As we don't want the service worker to control any page, generate a
</span><span class="cx">     // one-time scope.
</span><span class="cx">     const SCOPE = new URL(`resources/${token()}.html`, location).pathname;
</span><span class="lines">@@ -121,7 +132,7 @@
</span><span class="cx"> }, {
</span><span class="cx">   tag: 'between service worker and page',
</span><span class="cx">   contextUrl: REPORTING_FRAME_URL,
</span><del>-  run: async (test, url) => {
</del><ins>+  run: async (test, url, expected_count) => {
</ins><span class="cx">     // Here we use a Service Worker without COEP.
</span><span class="cx">     const WORKER_URL = `${ORIGIN}${BASE}/sw.js`;
</span><span class="cx">     const reg = await service_worker_unregister_and_register(
</span><span class="lines">@@ -130,7 +141,7 @@
</span><span class="cx">     const worker = reg.installing || reg.waiting || reg.active;
</span><span class="cx">     worker.addEventListener('error', test.unreached_func('Worker.onerror'));
</span><span class="cx">     return await fetchInFrame(
</span><del>-      test, REPORTING_FRAME_URL, url);
</del><ins>+      test, REPORTING_FRAME_URL, url, expected_count);
</ins><span class="cx">   },
</span><span class="cx"> }];
</span><span class="cx"> 
</span><span class="lines">@@ -137,20 +148,18 @@
</span><span class="cx"> const CASES = [{
</span><span class="cx">   name: 'same-origin',
</span><span class="cx">   url: '/common/text-plain.txt',
</span><del>-  check: (reports, url, contextUrl) => {
-    assert_equals(reports.length, 0);
-  }
</del><ins>+  expected_count: 0,
+  check: (reports, url, contextUrl) => {}
</ins><span class="cx"> }, {
</span><span class="cx">   name: 'blocked by CORP: same-origin',
</span><span class="cx">   url: `${REMOTE_ORIGIN}${BASE}/nothing-same-origin-corp.txt`,
</span><del>-  check: (reports, url, contextUrl) => {
-    assert_equals(reports.length, 0);
-  }
</del><ins>+  expected_count: 0,
+  check: (reports, url, contextUrl) => {}
</ins><span class="cx"> }, {
</span><span class="cx">   name: 'blocked due to COEP',
</span><span class="cx">   url: `${REMOTE_ORIGIN}/common/text-plain.txt`,
</span><ins>+  expected_count: 2,
</ins><span class="cx">   check: (reports, contextUrl, url) => {
</span><del>-    assert_equals(reports.length, 2);
</del><span class="cx">     checkReport(reports[0], contextUrl, url, 'reporting', '');
</span><span class="cx">     checkReport(reports[1], contextUrl, url, 'enforce', '');
</span><span class="cx">   }
</span><span class="lines">@@ -157,9 +166,9 @@
</span><span class="cx"> }, {
</span><span class="cx">   name: 'blocked during redirect',
</span><span class="cx">   url: `${ORIGIN}/common/redirect.py?location=` +
</span><del>-       encodeURIComponent(`${REMOTE_ORIGIN}/common/text-plain.txt`),
</del><ins>+    encodeURIComponent(`${REMOTE_ORIGIN}/common/text-plain.txt`),
+   expected_count: 2,
</ins><span class="cx">   check: (reports, contextUrl, url) => {
</span><del>-    assert_equals(reports.length, 2);
</del><span class="cx">     checkReport(reports[0], contextUrl, url, 'reporting', '');
</span><span class="cx">     checkReport(reports[1], contextUrl, url, 'enforce', '');
</span><span class="cx">   },
</span><span class="lines">@@ -168,8 +177,10 @@
</span><span class="cx"> for (const env of ENVIRONMENTS) {
</span><span class="cx">   for (const testcase of CASES) {
</span><span class="cx">     promise_test(async (t) => {
</span><del>-      const reports = await env.run(t, testcase.url);
</del><ins>+      const reports = await env.run(
+        t, testcase.url, testcase.expected_count);
</ins><span class="cx"> 
</span><ins>+      assert_equals(reports.length, testcase.expected_count);
</ins><span class="cx">       testcase.check(reports, env.contextUrl, testcase.url);
</span><span class="cx">     }, `[${env.tag}] ${testcase.name}`);
</span><span class="cx">   }
</span><span class="lines">@@ -177,24 +188,16 @@
</span><span class="cx"> 
</span><span class="cx"> // A test for a non-empty destination.
</span><span class="cx"> promise_test(async (t) => {
</span><del>-  const reports = [];
</del><span class="cx">   const frame = await with_iframe(FRAME_URL);
</span><span class="cx">   t.add_cleanup(() => frame.remove());
</span><span class="cx"> 
</span><del>-  const observer = new frame.contentWindow.ReportingObserver((rs) => {
-    for (const report of rs) {
-      reports.push(report.toJSON());
-    }
-  });
-  observer.observe();
</del><span class="cx">   const url = `${REMOTE_ORIGIN}/common/utils.js`;
</span><span class="cx">   const script = frame.contentDocument.createElement('script');
</span><span class="cx">   script.src = url;
</span><ins>+  const future_reports = observeReports(frame.contentWindow, 2);
</ins><span class="cx">   frame.contentDocument.body.appendChild(script);
</span><span class="cx"> 
</span><del>-  // Wait 200ms for reports to settle.
-  await wait(200);
-
</del><ins>+  const reports = await future_reports;
</ins><span class="cx">   assert_equals(reports.length, 2);
</span><span class="cx">   checkReport(reports[0], FRAME_URL, url, 'reporting', 'script');
</span><span class="cx">   checkReport(reports[1], FRAME_URL, url, 'enforce', 'script');
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyreportingtoendpointhttpshtml"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-to-endpoint.https.html (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-to-endpoint.https.html        2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-to-endpoint.https.html   2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -24,6 +24,9 @@
</span><span class="cx"> const FRAME_URL = `resources/reporting-empty-frame.html` +
</span><span class="cx">   `?pipe=header(cross-origin-embedder-policy,require-corp;report-to="endpoint")` +
</span><span class="cx">   `|header(cross-origin-embedder-policy-report-only,require-corp;report-to="report-only-endpoint")`;
</span><ins>+const WORKER_URL = `resources/shared-worker.js` +
+  '?pipe=header(cross-origin-embedder-policy,require-corp;report-to="endpoint")' +
+  `|header(cross-origin-embedder-policy-report-only,require-corp;report-to="report-only-endpoint")`;
</ins><span class="cx"> 
</span><span class="cx"> function wait(ms) {
</span><span class="cx">   return new Promise(resolve => step_timeout(resolve, ms));
</span><span class="lines">@@ -58,7 +61,7 @@
</span><span class="cx">     }
</span><span class="cx">     await wait(retryDelay);
</span><span class="cx">   }
</span><del>-  assert_unreached(`A report whose blockedURL is ${blockedUrl} and url is ${contextUrl} is not found.`);
</del><ins>+  assert_unreached(`A report whose blockedURL is ${blockedUrl.split("?")[0]} and url is ${contextUrl} is not found.`);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> async function checkNavigationReportExistence(endpoint, blockedUrl, contextUrl, disposition) {
</span><span class="lines">@@ -80,7 +83,7 @@
</span><span class="cx">     }
</span><span class="cx">     await wait(retryDelay);
</span><span class="cx">   }
</span><del>-  assert_unreached(`A report whose blockedURL is ${blockedUrl} and url is ${contextUrl} is not found.`);
</del><ins>+  assert_unreached(`A report whose blockedURL is ${blockedUrl.split("?")[0]} and url is ${contextUrl} is not found.`);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> promise_test(async t => {
</span><span class="lines">@@ -177,4 +180,27 @@
</span><span class="cx"> 
</span><span class="cx"> }, 'Two COEP headers, split inside report-to value');
</span><span class="cx"> 
</span><ins>+// Shared worker do not support observer currently, so add test for endpoint
+// here.
+promise_test(async (t) => {
+  const iframe = document.createElement('iframe');
+  t.add_cleanup(() => iframe.remove());
+
+  iframe.src = FRAME_URL;
+  const targetUrl = `${REMOTE_ORIGIN}/common/blank.html?${token()}`;
+  document.body.appendChild(iframe);
+
+  const worker = new iframe.contentWindow.SharedWorker(WORKER_URL);
+  worker.port.start();
+  const script =
+    `fetch('${targetUrl}', {mode: 'no-cors', cache: 'no-store'}).catch(e => {});`;
+  worker.addEventListener('error', t.unreached_func('Worker.onerror'));
+  worker.port.postMessage(script);
+
+  await checkCorpReportExistence(
+      'endpoint', targetUrl, WORKER_URL, 'iframe', 'enforce');
+  await checkCorpReportExistence(
+      'report-only-endpoint', targetUrl, WORKER_URL, 'iframe', 'reporting');
+}, 'Shared worker fetch');
+
</ins><span class="cx"> </script>
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyresourcesbloburlfactoryhtml"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/blob-url-factory.html (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/blob-url-factory.html 2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/blob-url-factory.html    2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -4,7 +4,12 @@
</span><span class="cx"> const query = new URLSearchParams(window.location.search);
</span><span class="cx"> const id = query.get("id");
</span><span class="cx"> const variant = query.get("variant");
</span><del>-const parent = (variant === "subframe") ? "parent.parent" : "parent";
</del><ins>+let parent = "parent";
+if (variant === "subframe") {
+  parent = "parent.parent";
+} else if (variant === "popup") {
+  parent = "opener.parent";
+}
</ins><span class="cx"> const blob = new Blob([`<script>${createScript(window.origin, query.get("crossOrigin"), parent, id)}<\/script>`], { type: "text/html" });
</span><span class="cx"> const blobURL = URL.createObjectURL(blob);
</span><span class="cx"> if (variant === "subframe") {
</span><span class="lines">@@ -11,6 +16,8 @@
</span><span class="cx">   const frame = document.createElement("iframe");
</span><span class="cx">   frame.src = blobURL;
</span><span class="cx">   document.body.append(frame);
</span><ins>+} else if (variant === "popup") {
+  window.open(blobURL);
</ins><span class="cx"> } else {
</span><span class="cx">   window.location = blobURL;
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyresourcesnavigatenonesubhtml"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/navigate-none.sub.html (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/navigate-none.sub.html        2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/navigate-none.sub.html   2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -13,8 +13,12 @@
</span><span class="cx"> 
</span><span class="cx">   if (channelName) {
</span><span class="cx">     let bc = new BroadcastChannel(channelName);
</span><del>-    bc.postMessage("loaded");
</del><span class="cx"> 
</span><ins>+    // Broadcast only once the DOM is loaded, so that the caller can
+    // access reliably this document's body.
+    window.addEventListener("DOMContentLoaded", () =>
+    bc.postMessage("loaded"));
+
</ins><span class="cx">     // The page can also be restored from the back-forward cache:
</span><span class="cx">     window.addEventListener('pageshow', function(event) {
</span><span class="cx">       if (event.persisted)
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyresourcespostmessagereadyhtml"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/postmessage-ready.html (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/postmessage-ready.html                                (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/postmessage-ready.html   2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+<!DOCTYPE html>
+<script>
+  opener.postMessage("ready", "*");
+</script>
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyresourcessharedworkerjs"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/shared-worker.js (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/shared-worker.js                              (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/shared-worker.js 2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+onconnect = (event) => {
+  const port = event.ports[0];
+  port.onmessage = (event) => {
+    eval(event.data);
+  };
+  port.postMessage('ready');
+};
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyresourcesw3cimportlog"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/w3c-import.log (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/w3c-import.log        2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/w3c-import.log   2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/nothing-cross-origin-corp.txt.headers
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt.headers
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/postmessage-ready.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/report.py
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/reporting-empty-frame-multiple-headers.html.asis
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/reporting-empty-frame.html
</span><span class="lines">@@ -44,6 +45,7 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/require-corp-sw.js.headers
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/script-factory.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/shared-worker-fetch.js.py
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/shared-worker.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/sw-store-to-cache-storage.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/sw.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/resources/universal-worker.js
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyw3cimportlog"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/w3c-import.log (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/w3c-import.log  2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/w3c-import.log     2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -16,6 +16,8 @@
</span><span class="cx"> List of files:
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/META.yml
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/README.md
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/about-blank-popup.https.html
+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/about-blank-popup.https.html.headers
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/blob.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/blob.https.html.headers
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/cache-storage-reporting-dedicated-worker.https.html
</span><span class="lines">@@ -31,6 +33,7 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker-cache-storage.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/header-parsing.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/iframe-history-none-require-corp.https.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/javascript.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/javascript.https.html.headers
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/meta-http-equiv.https.html
</span><span class="lines">@@ -70,3 +73,5 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/shared-workers.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/srcdoc.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/srcdoc.https.html.headers
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/worker-inheritance.sub.https.html
+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/worker-inheritance.sub.https.html.headers
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyworkerinheritancesubhttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/worker-inheritance.sub.https-expected.txt (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/worker-inheritance.sub.https-expected.txt                               (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/worker-inheritance.sub.https-expected.txt  2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+Blocked access to external URL https://www.localhost:9444/common/blank.html
+
+FAIL Test that local scheme workers inherit COEP: require-corp from the creating document promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: SharedWorker"
+PASS blob URL dedicated worker: Same origin should be allowed.
+PASS blob URL dedicated worker: Cross origin should be blocked.
+
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyworkerinheritancesubhttpshtml"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/worker-inheritance.sub.https.html (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/worker-inheritance.sub.https.html                               (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/worker-inheritance.sub.https.html  2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+<!DOCTYPE html>
+<title>Test that local scheme workers inherit COEP: require-corp from the creating document</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+  promise_test(async t => {
+    let sameOrigin = "{{location[server]}}";
+    let crossOrigin = "https://{{hosts[][www]}}:{{ports[https][1]}}";
+
+    let testHarness = await fetch(`${sameOrigin}/resources/testharness.js`)
+        .then(r => r.text());
+
+    // Test that fetching same-origin is allowed by COEP.
+    let same_origin_allowed_test = testName => `
+        promise_test(async t => {
+          return fetch("${sameOrigin}/common/blank.html", { mode: "no-cors" });
+        }, "${testName}: Same origin should be allowed.");
+    `;
+
+    // For data URLs, since everything is cross-origin in that case.
+    let same_origin_blocked_test = testName => `
+        promise_test(t => {
+          return promise_rejects_js(
+              t, TypeError,
+              fetch("${sameOrigin}/common/blank.html", { mode: "no-cors" }));
+        }, "${testName}: Same origin should be blocked.");
+    `;
+
+    // Test that fetching cross-origin is blocked by COEP.
+    let cross_origin_blocked_test = testName => `
+        promise_test(t => {
+          return promise_rejects_js(
+              t, TypeError,
+              fetch("${crossOrigin}/common/blank.html", { mode: "no-cors" }));
+        }, "${testName}: Cross origin should be blocked.");
+    `;
+
+    let blob_string = testName => testHarness +
+        same_origin_allowed_test(testName) +
+        cross_origin_blocked_test(testName) + "done();";
+
+    let data_string = testName => testHarness +
+        same_origin_blocked_test(testName) +
+        cross_origin_blocked_test(testName) + "done();";
+
+    let blob_url = context => {
+      let blob = new Blob([blob_string(`blob URL ${context}`)],
+                          { type: 'application/javascript' });
+      return URL.createObjectURL(blob);
+    };
+
+    await fetch_tests_from_worker(new Worker(blob_url("dedicated worker")));
+    await fetch_tests_from_worker(new SharedWorker(blob_url("shared worker")));
+
+    let data_url = context => `data:application/javascript,` +
+        `${encodeURIComponent(data_string("data URL " + context))}`;
+
+    await fetch_tests_from_worker(new Worker(data_url("dedicated worker")));
+    await fetch_tests_from_worker(new Worker(data_url("shared worker")));
+  });
+</script>
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginembedderpolicyworkerinheritancesubhttpshtmlheadersfromrev283909branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicypopupcoopbyswfromcoophttpshtmlheaders"></a>
<div class="copfile"><h4>Copied: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/worker-inheritance.sub.https.html.headers (from rev 283909, branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html.headers) (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/worker-inheritance.sub.https.html.headers                               (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/worker-inheritance.sub.https.html.headers  2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Cross-Origin-Embedder-Policy: require-corp
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicycoopnavigatesameorigincspsandboxhtml"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-navigate-same-origin-csp-sandbox.html (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-navigate-same-origin-csp-sandbox.html                                (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-navigate-same-origin-csp-sandbox.html   2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="/common/utils.js"></script>
+<script src="./resources/common.js"></script>
+<script src="./resources/dispatcher.js"></script>
+<script>
+
+const directory = '/html/cross-origin-opener-policy/';
+const executor_path = directory + '/resources/executor.html?pipe=';
+
+const https_origin = get_host_info().HTTPS_ORIGIN;
+const coop_same_origin =
+    '|header(Cross-Origin-Opener-Policy,same-origin)';
+const csp_sandbox =
+    '|header(Content-Security-Policy, sandbox allow-scripts)';
+
+promise_test(async test => {
+  const driver_token = token();
+
+  // 1. Start from a COOP:same-origin document.
+  const opener_token = token();
+  const opener_url = https_origin + executor_path + coop_same_origin +
+    `&uuid=${opener_token}`;
+  const w = window.open(opener_url);
+  add_completion_callback(() => w.close());
+
+  // 2. It opens a popups, and then navigates the popup toward a same-origin
+  // COOP:same-origin document with CSP:sandbox
+  const openee_token = token();
+  const openee_url = https_origin + executor_path + coop_same_origin +
+    csp_sandbox + `&uuid=${openee_token}`;
+  send(opener_token, `
+    openee = window.open("${openee_url}");
+  `);
+  add_completion_callback(() => send(openee_token, "close()"));
+
+  // Because of CSP:sandbox, the popup is not considered same-origin with
+  // its openee. Check the openee/opener relationship is now closed.
+  send(openee_token, `
+    if (opener)
+      send("${driver_token}", "Error: have opener");
+    else
+      send("${driver_token}", "Success: no opener");
+  `);
+  assert_equals(await receive(driver_token), "Success: no opener");
+
+  // Technically, the opener's "openee" WindowProxy should appear as closed at
+  // this time. The popup loaded a new document, and at least two fetch requests
+  // were made. This is more than enough. However, in theory, there is nothing
+  // to guarantee we can observe "openee.close". Wait a bit to ensure this will
+  // never flake.
+  await new Promise(r => test.step_timeout(r, 1000));
+
+  send(opener_token, `
+    if (openee.closed)
+      send("${driver_token}", "Success: openee closed");
+    else
+      send("${driver_token}", "Error: can still access openee");
+  `);
+  assert_equals(await receive(driver_token), "Success: openee closed");
+});
+
+</script>
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicycoopsameoriginallowpopupsdocumentwriteexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-same-origin-allow-popups-document-write-expected.txt (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-same-origin-allow-popups-document-write-expected.txt 2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-same-origin-allow-popups-document-write-expected.txt    2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><span class="cx"> 
</span><del>-PASS coop-same-origin-allow-popups-document-write
</del><ins>+FAIL coop-same-origin-allow-popups-document-write assert_equals: opener == null expected "true" but got "false"
</ins><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicycoopsameoriginallowpopupsdocumentwritehtml"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-same-origin-allow-popups-document-write.html (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-same-origin-allow-popups-document-write.html 2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-same-origin-allow-popups-document-write.html    2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -42,20 +42,22 @@
</span><span class="cx">     openee.document.close();
</span><span class="cx">   `);
</span><span class="cx"> 
</span><del>-  // Check the openee is loaded and has access to its opener.
</del><ins>+  // Check the openee is loaded without access to the opener.
</ins><span class="cx">   send(openee_token, `
</span><del>-    send("${this_window_token}", opener != null)
-    send("${this_window_token}", opener.closed);
</del><ins>+    send("${this_window_token}", opener == null)
</ins><span class="cx">   `);
</span><del>-  assert_equals(await receive(this_window_token), "true", "opener exists");
-  assert_equals(await receive(this_window_token), "false", "opener not closed");
</del><ins>+  assert_equals(await receive(this_window_token), "true", "opener == null");
</ins><span class="cx"> 
</span><del>-  // Check the opener has still access to its openee.
</del><ins>+  // To get the state of the openee reflected into the opener's process, waiting
+  // for the openee' document to load and the various fetch() with the
+  // dispatcher should be largely enough. However these aren't causal guarantee.
+  // So wait a bit to be sure:
+  await new Promise(r => test.step_timeout(r, 1000));
+
+  // Check the opener see the openee as 'closed' after the navigation.
</ins><span class="cx">   send(opener_token, `
</span><del>-    send("${this_window_token}", openee != null)
-    send("${this_window_token}", openee.closed);
</del><ins>+    send("${this_window_token}", openee.closed)
</ins><span class="cx">   `);
</span><del>-  assert_equals(await receive(this_window_token), "true", "openee exists");
-  assert_equals(await receive(this_window_token), "false", "openee not closed");
</del><ins>+  assert_equals(await receive(this_window_token), "true", "openee.closed");
</ins><span class="cx"> });
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicypopupcoopbyswfromcoophttpsexpectedtxt"></a>
<div class="delfile"><h4>Deleted: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https-expected.txt (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https-expected.txt     2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https-expected.txt        2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -1,6 +0,0 @@
</span><del>-
-PASS sw_normal, popup_normal
-PASS sw_normal, popup_coop
-PASS sw_coop, popup_normal
-PASS sw_coop, popup_coop
-
</del></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicypopupcoopbyswfromcoophttpshtml"></a>
<div class="delfile"><h4>Deleted: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html     2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html        2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -1,40 +0,0 @@
</span><del>-<!doctype html>
-<html>
-<head>
-  <title>
-    Check ServiceWorkers can set COOP/COEP headers for documents's responses
-  </title>
-  <meta name="timeout" content="long">
-  <script src="/resources/testharness.js"></script>
-  <script src="/resources/testharnessreport.js"></script>
-  <script src="/common/utils.js"></script>
-  <script src="/service-workers/service-worker/resources/test-helpers.sub.js">
-  </script>
-  <script src="./resources/popup-coop-by-sw.js"> </script>
-</head>
-<body>
-<script>
-
-// The current document have COOP/COEP defined. A popup will be opened.
-// Its response will be provided by a ServiceWorker. A browsing context
-// group swap must happen if the popup's headers contains COOP/COEP headers.
-
-popupCoopBySwTest("sw_normal, popup_normal",
-                   sw_normal, popup_normal,
-                   swap_browsing_context_group)
-
-popupCoopBySwTest("sw_normal, popup_coop",
-                   sw_normal, popup_coop,
-                   keep_browsing_context_group)
-
-popupCoopBySwTest("sw_coop, popup_normal",
-                   sw_coop, popup_normal,
-                   swap_browsing_context_group)
-
-popupCoopBySwTest("sw_coop, popup_coop",
-                   sw_coop, popup_coop,
-                   keep_browsing_context_group)
-
-</script>
-</body>
-</html>
</del></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicypopupcoopbyswfromcoophttpshtmlheaders"></a>
<div class="delfile"><h4>Deleted: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html.headers (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html.headers     2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html.headers        2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -1,2 +0,0 @@
</span><del>-Cross-Origin-Opener-Policy: same-origin
-Cross-Origin-Embedder-Policy: require-corp
</del></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicypopupcoopbyswhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw.https-expected.txt (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw.https-expected.txt       2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw.https-expected.txt  2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -1,6 +1,12 @@
</span><span class="cx"> 
</span><del>-PASS sw_normal, popup_normal
-PASS sw_normal, popup_coop
-PASS sw_coop, popup_normal
-PASS sw_coop, popup_coop
</del><ins>+Harness Error (TIMEOUT), message = null
</ins><span class="cx"> 
</span><ins>+TIMEOUT opener:basic, openee:basic, sw:basic Test timed out
+NOTRUN opener:basic, openee:basic, sw:coi
+NOTRUN opener:basic, openee:coi, sw:basic
+NOTRUN opener:basic, openee:coi, sw:coi
+NOTRUN opener:coi, openee:basic, sw:basic
+NOTRUN opener:coi, openee:basic, sw:coi
+NOTRUN opener:coi, openee:coi, sw:basic
+NOTRUN opener:coi, openee:coi, sw:coi
+
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicypopupcoopbyswhttpshtml"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw.https.html (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw.https.html       2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw.https.html  2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -1,40 +1,137 @@
</span><del>-<!doctype html>
-<html>
-<head>
-  <title>
-    Check ServiceWorkers can set COOP/COEP headers for documents's responses
-  </title>
-  <meta name="timeout" content="long">
-  <script src="/resources/testharness.js"></script>
-  <script src="/resources/testharnessreport.js"></script>
-  <script src="/common/utils.js"></script>
-  <script src="/service-workers/service-worker/resources/test-helpers.sub.js">
-  </script>
-  <script src="./resources/popup-coop-by-sw.js"> </script>
-</head>
-<body>
</del><ins>+<meta name="timeout" content="long">
+<meta name="variant" content="?1-4">
+<meta name="variant" content="?5-last">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src="/common/subset-tests.js"></script>
+<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
+<script src="/common/utils.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="./resources/dispatcher.js"></script>
</ins><span class="cx"> <script>
</span><span class="cx"> 
</span><del>-// The current document do not have COOP/COEP defined. A popup will be opened.
-// Its response will be provided by a ServiceWorker. A browsing context group
-// swap must happen if the popup's headers contains COOP/COEP headers.
</del><ins>+const resources = "/html/cross-origin-opener-policy/resources";
+const executor_path = resources + "/executor.html?pipe=";
+const sw_executor_path  = resources + "/sw_executor.js?pipe=";
</ins><span class="cx"> 
</span><del>-popupCoopBySwTest("sw_normal, popup_normal",
-                   sw_normal, popup_normal,
-                   keep_browsing_context_group)
</del><ins>+const coop_header = `|header(Cross-Origin-Opener-Policy,same-origin)`;
+const coep_header = `|header(Cross-Origin-Embedder-Policy,require-corp)`;
</ins><span class="cx"> 
</span><del>-popupCoopBySwTest("sw_normal, popup_coop",
-                   sw_normal, popup_coop,
-                   swap_browsing_context_group)
</del><ins>+const https_origin = get_host_info().HTTPS_ORIGIN;
</ins><span class="cx"> 
</span><del>-popupCoopBySwTest("sw_coop, popup_normal",
-                   sw_coop, popup_normal,
-                   keep_browsing_context_group)
</del><ins>+const swap_browsing_context_group = true;
+const keep_browsing_context_group = false;
</ins><span class="cx"> 
</span><del>-popupCoopBySwTest("sw_coop, popup_coop",
-                   sw_coop, popup_coop,
-                   swap_browsing_context_group)
</del><ins>+const opener_basic = "";
+const opener_coi = coop_header + coep_header;
</ins><span class="cx"> 
</span><ins>+const sw_basic = "";
+const sw_coi = coop_header + coep_header;
+
+const openee_basic = {
+  'content-type': 'text/html',
+};
+const openee_coi = {
+  'content-type': 'text/html',
+  'cross-origin-embedder-policy': 'require-corp',
+  'cross-origin-opener-policy': 'same-origin',
+};
+
+// A document opens a popup. The popup's document is served from a synthetic
+// response by a ServiceWorker. Check how cross-origin isolation works in this
+// case.
+const popupCoopBySwTest = (
+  description,
+  // Test parameters:
+  opener_headers,
+  openee_headers,
+  sw_headers,
+  // Test expectations:
+  expected_browing_context_group
+) => {
+  subsetTest(promise_test, async test => {
+    const driver_token = token();
+
+    // 1. Create the opener.
+    const opener_token = token();
+    const opener_url = https_origin + executor_path + opener_headers +
+      `&uuid=${opener_token}`;
+    const opener_window = window.open(opener_url);
+    test.add_cleanup(() => opener_window.close());
+
+    // 2. Define the openee's URL as being served by the service worker.
+    const openee_url = https_origin + resources + "/proxied?" + token();
+
+    // 3. Register, install and activate a ServiceWorker serving the openee_url.
+    const sw_token = token();
+    const sw_url = https_origin + sw_executor_path + sw_headers +
+      `&uuid=${sw_token}`;
+    const sw_scope = openee_url; // One-time scope, because of the token.
+
+    const sw_registration =
+      await service_worker_unregister_and_register(test, sw_url, sw_scope);
+    test.add_cleanup(() => sw_registration.unregister());
+    await wait_for_state(test, sw_registration.installing, 'activated');
+
+    send(sw_token, `
+      fetchHandler = event => {
+        if (!event.request.url.includes("proxied"))
+          return;
+
+        const response = new Response(\`
+          <script src="./dispatcher.js"></scr\`+\`ipt>
+          <script>
+            send("${driver_token}", opener ? "opener is set"
+                                           : "opener is null");
+          </scr\` + \`ipt>
+        \`, {
+          status: 200,
+          headers: ${JSON.stringify(openee_headers)},
+        });
+        event.respondWith(response);
+      }
+
+      await clients.claim();
+
+      send("${driver_token}", serviceWorker.state);
+    `)
+    assert_equals(await receive(driver_token), "activated");
+
+    // 4. The opener opens a popup. Its document is a synthetic response served
+    // from the Service Worker.
+    send(opener_token, `
+        window.open("${openee_url}");
+    `);
+
+    assert_equals(await receive(driver_token),
+     (expected_browing_context_group == swap_browsing_context_group)
+            ? "opener is null"
+            : "opener is set");
+  }, description);
+};
+
+popupCoopBySwTest("opener:basic, openee:basic, sw:basic",
+                   opener_basic, openee_basic, sw_basic,
+                   keep_browsing_context_group);
+popupCoopBySwTest("opener:basic, openee:basic, sw:coi",
+                   opener_basic, openee_basic, sw_coi,
+                   keep_browsing_context_group);
+popupCoopBySwTest("opener:basic, openee:coi, sw:basic",
+                   opener_basic, openee_coi, sw_basic,
+                   swap_browsing_context_group);
+popupCoopBySwTest("opener:basic, openee:coi, sw:coi",
+                   opener_basic, openee_coi, sw_coi,
+                   swap_browsing_context_group);
+popupCoopBySwTest("opener:coi, openee:basic, sw:basic",
+                   opener_coi, openee_basic, sw_basic,
+                   swap_browsing_context_group);
+popupCoopBySwTest("opener:coi, openee:basic, sw:coi",
+                   opener_coi, openee_basic, sw_coi,
+                   swap_browsing_context_group);
+popupCoopBySwTest("opener:coi, openee:coi, sw:basic",
+                   opener_coi, openee_coi, sw_basic,
+                   keep_browsing_context_group);
+popupCoopBySwTest("opener:coi, openee:coi, sw:coi",
+                   opener_coi, openee_coi, sw_coi,
+                   keep_browsing_context_group);
</ins><span class="cx"> </script>
</span><del>-</body>
-</html>
</del></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicyresourcespopupcoopbyswjs"></a>
<div class="delfile"><h4>Deleted: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/popup-coop-by-sw.js (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/popup-coop-by-sw.js     2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/popup-coop-by-sw.js        2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -1,104 +0,0 @@
</span><del>-const test_token = token();
-const bc = new BroadcastChannel(test_token);
-
-// Define a page served entirely from the ServiceWorker.
-const popup_url = new URL("./resources/i-do-not-exist.html", location);
-const popup_normal= {
-  'content-type': 'text/html',
-};
-const popup_coop = {
-  'content-type': 'text/html',
-  'cross-origin-embedder-policy': 'require-corp',
-  'cross-origin-opener-policy': 'same-origin',
-};
-const popup_body = `
-  <script>
-    const bc = new BroadcastChannel('${test_token}');
-    if (opener)
-      bc.postMessage("An opener is set");
-    else
-      bc.postMessage("No opener is set");
-    window.close();
-  </scrip`+`t>
-`;
-
-const header_coop= `|header(cross-origin-embedder-policy,same_origin)`;
-const header_coep = `|header(cross-origin-opener-policy,require-corp)`;
-
-const sw_normal = new URL("./resources/universal-worker.js?pipe=", location);
-const sw_coop = sw_normal + header_coop + header_coep;
-
-const swap_browsing_context_group = true;
-const keep_browsing_context_group = false;
-
-const SW_SCOPE = "./resources/"
-
-// Send a message to the |worker|. Return a promise containing its response.
-function executeCommandInServiceWorker(worker, command) {
-  const channel = new MessageChannel();
-  const response = new Promise(resolve => channel.port1.onmessage = resolve);
-  worker.postMessage(command, [ channel.port2 ]);
-  return response;
-}
-
-function popupCoopBySwTest(test_name,
-  // Test parameters
-  sw_url,
-  new_window_headers,
-  // Test expectations:
-  expected_browing_context_group) {
-  promise_test(async (t) => {
-    // Create a ServiceWorker and wait for its activation.
-    window.id = window.id == undefined ? 0 : window.id + 1;
-    const reg =
-      await service_worker_unregister_and_register(t, sw_url, SW_SCOPE);
-    t.add_cleanup(() => reg.unregister());
-    const worker = reg.installing || reg.waiting || reg.active;
-    wait_for_state(t, worker, 'active');
-
-    // Register a fetch handler. New documents loaded will use the
-    // |new_window_headers| from now and the custom response.
-    const worker_script = `
-      fetchHandler = event => {
-        const response = new Response(\`${popup_body}\`, {
-          status: 200,
-          headers: ${JSON.stringify(new_window_headers)},
-        });
-        event.respondWith(response);
-      };
-
-      message.ports[0].postMessage('done');
-    `;
-    const fetch_handler_registered =
-      await executeCommandInServiceWorker(worker, worker_script);
-    assert_equals(fetch_handler_registered.data, "done");
-
-    // Create a popup. The popup document's response is provided by the
-    // ServiceWorker.
-    bc_response = new Promise(resolve => bc.onmessage = resolve);
-    const openee = window.open(popup_url);
-    const {data} = await bc_response;
-    await reg.unregister();
-
-    if (expected_browing_context_group === keep_browsing_context_group) {
-      // From the openee point of view: The opener is preserved, because the
-      // popup is still in the same browsing context group.
-      assert_equals(data, "An opener is set");
-      return;
-    }
-
-    // From the openee point of view: There are no opener, because the new
-    // window lives in a different browsing context group.
-    assert_equals(data, "No opener is set");
-
-    // From the opener point of view: the openee must appear closed shortly
-    // after the popup navigation commit.
-    const openee_closed = new Promise(resolve => {
-      setInterval(() => {
-        if (openee.closed)
-          resolve();
-      }, 100);
-    });
-    await openee_closed;
-  }, test_name);
-}
</del></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicyresourcessw_executorjs"></a>
<div class="addfile"><h4>Added: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/sw_executor.js (0 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/sw_executor.js                          (rev 0)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/sw_executor.js     2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+importScripts('./dispatcher.js');
+
+const params = new URLSearchParams(location.search);
+const uuid = params.get('uuid');
+
+// The fetch handler must be registered before parsing the main script response.
+// So do it here, for future use.
+fetchHandler = () => {}
+addEventListener('fetch', e => {
+  fetchHandler(e);
+});
+
+// Force ServiceWorker to immediately activate itself.
+addEventListener('install', event => {
+  skipWaiting();
+});
+
+let executeOrders = async function() {
+  while(true) {
+    let task = await receive(uuid);
+    eval(`(async () => {${task}})()`);
+  }
+};
+executeOrders();
</ins></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicyresourcesw3cimportlog"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/w3c-import.log (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/w3c-import.log  2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/w3c-import.log     2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -24,10 +24,10 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/executor.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/iframe-popup.sub.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/javascript-url-same-origin.https.html
</span><del>-/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/popup-coop-by-sw.js
</del><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/postback.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/postback.html.headers
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/redirect.py
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/resource-cleanup.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/resource-popup.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/sw_executor.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/resources/universal-worker.js
</span></span></pre></div>
<a id="branchessafari612branchLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicyw3cimportlog"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/w3c-import.log (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/w3c-import.log    2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/w3c-import.log       2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-coep-sandbox.https.html.headers
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-csp-sandbox-navigate.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-csp-sandbox.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-navigate-same-origin-csp-sandbox.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-navigated-history-popup.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-navigated-popup.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coop-navigated-popup.https.html.headers
</span><span class="lines">@@ -56,8 +57,6 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/navigate-top-to-aboutblank.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/no-https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/no-https.html.headers
</span><del>-/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html
-/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html.headers
</del><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-meta-http-equiv.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-redirect-cache.https.html
</span></span></pre></div>
<a id="branchessafari612branchLayoutTeststestsoptionsjson"></a>
<div class="modfile"><h4>Modified: branches/safari-612-branch/LayoutTests/tests-options.json (283909 => 283910)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612-branch/LayoutTests/tests-options.json        2021-10-11 17:46:05 UTC (rev 283909)
+++ branches/safari-612-branch/LayoutTests/tests-options.json   2021-10-11 17:49:51 UTC (rev 283910)
</span><span class="lines">@@ -2555,6 +2555,9 @@
</span><span class="cx">     "imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.zero.html": [
</span><span class="cx">         "slow"
</span><span class="cx">     ],
</span><ins>+    "imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/anonymous-iframe-popup.tentative.https.html": [
+        "slow"
+    ],
</ins><span class="cx">     "imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/cache-storage-reporting-dedicated-worker.https.html": [
</span><span class="cx">         "slow"
</span><span class="cx">     ],
</span><span class="lines">@@ -2591,6 +2594,9 @@
</span><span class="cx">     "imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/header-parsing.https.html": [
</span><span class="cx">         "slow"
</span><span class="cx">     ],
</span><ins>+    "imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/iframe-history-none-require-corp.https.html": [
+        "slow"
+    ],
</ins><span class="cx">     "imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none.https.html": [
</span><span class="cx">         "slow"
</span><span class="cx">     ],
</span></span></pre>
</div>
</div>

</body>
</html>