<!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>[279389] trunk/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/279389">279389</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2021-06-29 15:04:42 -0700 (Tue, 29 Jun 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Resync service-worker WPT tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=227490

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

Resync service-worker WPT tests from upstream a38612f39e7752c353208.

* web-platform-tests/service-workers/*: Updated.

LayoutTests:

* TestExpectations:
* tests-options.json:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cresourcesresourcefilesjson">trunk/LayoutTests/imported/w3c/resources/resource-files.json</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestorageresourcesvarypy">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/vary.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragescripttestscacheaddjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-add.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragescripttestscachematchjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragescripttestscacheputjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-put.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestorageserviceworkercacheaddhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-add.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestorageserviceworkercachematchhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-match.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestorageserviceworkercacheputhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-put.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragewindowcacheaddhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-add.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragewindowcacheaddhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-add.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragewindowcachematchhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-match.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragewindowcacheputhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-put.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragewindowcacheputhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-put.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestorageworkercacheaddhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-add.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestorageworkercachematchhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-match.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestorageworkercacheputhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-put.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerServiceWorkerGlobalScopefetchontherightinterfacehttpsanyjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/fetch-on-the-right-interface.https.any.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkeractivationhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/activation.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclaimfetchhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-fetch.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclaimworkerfetchhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-worker-fetch.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclaimworkerfetchhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-worker-fetch.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclientnavigatehttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-navigate.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkercredentialshttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/credentials.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkercredentialshttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/credentials.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerdatatransferfileshttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/data-transfer-files.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerdatatransferfileshttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/data-transfer-files.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerdetachedcontexthttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/detached-context.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchcsphttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-csp.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventhandledhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-handled.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventreferrerpolicyhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-referrer-policy.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventreferrerpolicyhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-referrer-policy.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventwithinswhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestcssbaseurlhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-base-url.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestcssimageshttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-images.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestredirecthttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-redirect.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestresourceshttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-resources.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestresourceshttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-resources.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernavigationpreloadresourceschunkedencodingscopepy">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-preload/resources/chunked-encoding-scope.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernavigationtiminghttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-timing.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernavigationtiminghttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-timing.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerperformancetimelinehttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/performance-timeline.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerredirectedresponsehttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/redirected-response.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerredirectedresponsehttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/redirected-response.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerreferrerpolicyheaderhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-policy-header.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerreferrerpolicyheaderhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-policy-header.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerreferrertoplevelscriptfetchhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-toplevel-script-fetch.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerreferrertoplevelscriptfetchhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-toplevel-script-fetch.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationbasichttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-basic.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationschedulejobhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-schedule-job.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationschedulejobhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-schedule-job.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationscripthttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationupdateviacachehttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-updateviacache.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcetimingsubhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resource-timing.sub.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesclientnavigateworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-navigate-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetcheventtestworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-event-test-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetcheventwithinswworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-event-within-sw-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchmixedcontentiframeinscopetoinscopehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-mixed-content-iframe-inscope-to-inscope.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchmixedcontentiframeinscopetooutscopehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-mixed-content-iframe-inscope-to-outscope.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequestcssbaseurlstylecss">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-css-base-url-style.css</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequestcssbaseurlworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-css-base-url-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequesthtmlimportsiframehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-html-imports-iframe.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequesthtmlimportsworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-html-imports-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequestresourcesiframehttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-resources-iframe.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequestresourcesworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-resources-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequestxhriframehttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-iframe.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequestxhrworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchresponsexhriframehttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-response-xhr-iframe.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchresponsexhrworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-response-xhr-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrewriteworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-rewrite-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesimmutableprototypeserviceworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/immutable-prototype-serviceworker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesinvalidblobtypeiframehttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-blobtype-iframe.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesinvalidblobtypeworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-blobtype-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesinvalidheaderiframehttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-header-iframe.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesinvalidheaderworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-header-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesisolatin1headeriframehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/iso-latin1-header-iframe.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesisolatin1headerworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/iso-latin1-header-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourceslocalurlinheritcontrollerframehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/local-url-inherit-controller-frame.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourceslocalurlinheritcontrollerworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/local-url-inherit-controller-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesperformancetimelineworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/performance-timeline-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesredirectworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/redirect-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesregistrationtestsscriptjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-script.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesresourcetimingiframesubhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/resource-timing-iframe.sub.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesresourcetimingworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/resource-timing-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesscope1w3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/w3c-import.log</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesscope2w3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope2/w3c-import.log</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcestesthelperssubjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-helpers.sub.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcestestharnesshelpersjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/testharness-helpers.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesunregisterimmediatelyhelpersjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/unregister-immediately-helpers.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesw3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/w3c-import.log</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourceswindowclientnavigateworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/windowclient-navigate-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkersvgtargetreftesthttpsexpectedhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/svg-target-reftest.https-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerupdateafteronedayhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-after-oneday.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerupdatebytecheckhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerw3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/w3c-import.log</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerwindowclientnavigatehttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/windowclient-navigate.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerworkerinterceptionhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerworkerinterceptionhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerxhrresponseurlhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-response-url.https.html</a></li>
<li><a href="#trunkLayoutTeststestsoptionsjson">trunk/LayoutTests/tests-options.json</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclienturlofbloburlworkerhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-url-of-blob-url-worker.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclienturlofbloburlworkerhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-url-of-blob-url-worker.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclientsmatchallbloburlworkerhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-blob-url-worker.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclientsmatchallbloburlworkerhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-blob-url-worker.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestxhrsyncerrorhttpswindowexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-error.https.window-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestxhrsyncerrorhttpswindowhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-error.https.window.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestxhrsyncerrorhttpswindowjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-error.https.window.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerhistoricalhttpsanyjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/historical.https.any.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerhistoricalhttpsanyserviceworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/historical.https.any.serviceworker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerhistoricalhttpsanyserviceworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/historical.https.any.serviceworker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerimportscriptscrossoriginhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-cross-origin.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerimportscriptscrossoriginhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-cross-origin.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernavigationredirectresolutionhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect-resolution.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernavigationredirectresolutionhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect-resolution.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernestedbloburlworkershttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/nested-blob-url-workers.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernestedbloburlworkershttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/nested-blob-url-workers.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernodynamicimportanyjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/no-dynamic-import.any.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernodynamicimportanyserviceworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/no-dynamic-import.any.serviceworker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernodynamicimportanyserviceworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/no-dynamic-import.any.serviceworker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationscopemodulestaticimporthttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-scope-module-static-import.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationscopemodulestaticimporthttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-scope-module-static-import.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationscriptmodulehttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script-module.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationscriptmodulehttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script-module.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesbasicmodule2js">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/basic-module-2.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesbasicmodulejs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/basic-module.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesclaimbloburlworkerfetchiframehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/claim-blob-url-worker-fetch-iframe.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesclienturlofbloburlworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-url-of-blob-url-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesclienturlofbloburlworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-url-of-blob-url-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesclientsmatchallbloburlworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-matchall-blob-url-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcescreatebloburlworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/create-blob-url-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcescreateoutofscopeworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/create-out-of-scope-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequestxhrsyncerrorworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-sync-error-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesimportechocookieworkermodulepy">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-echo-cookie-worker-module.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesimportscriptscrossoriginworkersubjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-scripts-cross-origin-worker.sub.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesnestedbloburlworkercreatedfromworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-blob-url-worker-created-from-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesnestedbloburlworkershtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-blob-url-workers.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesnestedworkercreatedfrombloburlworkerhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-worker-created-from-blob-url-worker.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesnodynamicimportjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/no-dynamic-import.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcespostmessagefetchedtextjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/postmessage-fetched-text.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcessampleworkerinterceptorjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample-worker-interceptor.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcessamplehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcessampletxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesscope1moduleworkerimportingredirecttoscope2js">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/module-worker-importing-redirect-to-scope2.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesscope1moduleworkerimportingscope2js">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/module-worker-importing-scope2.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesscope2importedmodulescriptjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope2/imported-module-script.js</a></li>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/subdir/</li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcessubdirblankhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/subdir/blank.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcessubdirw3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/subdir/w3c-import.log</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcestestrequestmodeworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-request-mode-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcestestrequestmodeworkerpy">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-request-mode-worker.py</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcestypecheckworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/type-check-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesxhrcontentlengthworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/xhr-content-length-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkersvgtargetreftest001framehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/svg-target-reftest-001-frame.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerupdatebytecheckcorsimporthttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck-cors-import.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerupdatebytecheckcorsimporthttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck-cors-import.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerupdatemodulerequestmodehttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-module-request-mode.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerupdatemodulerequestmodehttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-module-request-mode.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerxhrcontentlengthhttpswindowexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-content-length.https.window-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerxhrcontentlengthhttpswindowhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-content-length.https.window.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerxhrcontentlengthhttpswindowjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-content-length.https.window.js</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventishistorybackwardnavigationmanualhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-backward-navigation-manual.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventishistoryforwardnavigationmanualhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-forward-navigation-manual.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventisreloadiframenavigationmanualhttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-iframe-navigation-manual.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventisreloadiframenavigationmanualhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-iframe-navigation-manual.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventisreloadnavigationmanualhttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-navigation-manual.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerimportmodulescriptshttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-module-scripts.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerimportmodulescriptshttpshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-module-scripts.https.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesdummyworkerinterceptorjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy-worker-interceptor.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesdummyhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesdummytxt">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesregistrationtestsbasicjs">trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-basic.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/ChangeLog 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2021-06-29  Chris Dumez  <cdumez@apple.com>
+
+        Resync service-worker WPT tests from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=227490
+
+        Reviewed by Geoffrey Garen.
+
+        * TestExpectations:
+        * tests-options.json:
+
</ins><span class="cx"> 2021-06-29  Ayumi Kojima  <ayumi_kojima@apple.com>
</span><span class="cx"> 
</span><span class="cx">         REGRESSION: accessibility/table-title.html is a flaky timeout on BigSur wk2 Debug
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations       2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/TestExpectations  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -316,7 +316,10 @@
</span><span class="cx"> imported/w3c/web-platform-tests/service-workers/service-worker/multipart-image.https.html [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/service-workers/service-worker/worker-in-sandboxed-iframe-by-csp-fetch-event.https.html [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-worker-timing-frame.tentative.https.html [ Skip ]
</span><ins>+imported/w3c/web-platform-tests/service-workers/service-worker/claim-worker-fetch.https.html [ Skip ]
</ins><span class="cx"> imported/w3c/web-platform-tests/service-workers/service-worker/client-navigate.https.html [ Skip ]
</span><ins>+imported/w3c/web-platform-tests/service-workers/service-worker/nested-blob-url-workers.https.html [ Skip ]
+imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck-cors-import.https.html [ Skip ]
</ins><span class="cx"> 
</span><span class="cx"> # Thee tests are crashing in Debug (https://bugs.webkit.org/show_bug.cgi?id=227310)
</span><span class="cx"> [ Debug ] imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic.any.html [ Skip ]
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/ChangeLog    2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,5 +1,16 @@
</span><span class="cx"> 2021-06-29  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><ins>+        Resync service-worker WPT tests from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=227490
+
+        Reviewed by Geoffrey Garen.
+
+        Resync service-worker WPT tests from upstream a38612f39e7752c353208.
+
+        * web-platform-tests/service-workers/*: Updated.
+
+2021-06-29  Chris Dumez  <cdumez@apple.com>
+
</ins><span class="cx">         Resync IDL interfaces from upstream web-platform-tests
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=227485
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cresourcesresourcefilesjson"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/resources/resource-files.json (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/resources/resource-files.json     2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/resources/resource-files.json        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -2675,6 +2675,7 @@
</span><span class="cx">         "web-platform-tests/service-workers/service-worker/multi-globals/current/current.https.html",
</span><span class="cx">         "web-platform-tests/service-workers/service-worker/multi-globals/incumbent/incumbent.https.html",
</span><span class="cx">         "web-platform-tests/service-workers/service-worker/multi-globals/relevant/relevant.https.html",
</span><ins>+        "web-platform-tests/service-workers/service-worker/svg-target-reftest-001-frame.html",
</ins><span class="cx">         "web-platform-tests/shadow-dom/declarative/support/declarative-child-frame.html",
</span><span class="cx">         "web-platform-tests/shadow-dom/event-on-pseudo-element-crash.html",
</span><span class="cx">         "web-platform-tests/shadow-dom/imperative-slot-api-crash.html",
</span><span class="lines">@@ -2774,4 +2775,4 @@
</span><span class="cx">         "web-platform-tests/xhr/xmlhttprequest-sync-block-defer-scripts-subframe.html",
</span><span class="cx">         "web-platform-tests/xhr/xmlhttprequest-sync-not-hang-scriptloader-subframe.html"
</span><span class="cx">     ]
</span><del>-}
</del><span class="cx">\ No newline at end of file
</span><ins>+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestorageresourcesvarypy"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/vary.py (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/vary.py        2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/resources/vary.py   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,5 +1,3 @@
</span><del>-from six import text_type
-
</del><span class="cx"> def main(request, response):
</span><span class="cx">   if b"clear-vary-value-override-cookie" in request.GET:
</span><span class="cx">     response.unset_cookie(b"vary-value-override")
</span><span class="lines">@@ -15,9 +13,9 @@
</span><span class="cx">   # for the VARY header no matter what the query string is set to.  This
</span><span class="cx">   # override is necessary to test the case when two URLs are identical
</span><span class="cx">   # (including query), but differ by VARY header.
</span><del>-  cookie_vary = request.cookies.get(b"vary-value-override");
</del><ins>+  cookie_vary = request.cookies.get(b"vary-value-override")
</ins><span class="cx">   if cookie_vary:
</span><del>-    response.headers.set(b"vary", text_type(cookie_vary))
</del><ins>+    response.headers.set(b"vary", str(cookie_vary))
</ins><span class="cx">   else:
</span><span class="cx">     # If there is no cookie, then use the query string value, if present.
</span><span class="cx">     query_vary = request.GET.first(b"vary", default=b"")
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragescripttestscacheaddjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-add.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-add.js        2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-add.js   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,8 +1,11 @@
</span><span class="cx"> if (self.importScripts) {
</span><span class="cx">     importScripts('/resources/testharness.js');
</span><ins>+    importScripts('/common/get-host-info.sub.js');
</ins><span class="cx">     importScripts('../resources/test-helpers.js');
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const { REMOTE_HOST } = get_host_info();
+
</ins><span class="cx"> cache_test(function(cache, test) {
</span><span class="cx">     return promise_rejects_js(
</span><span class="cx">       test,
</span><span class="lines">@@ -105,9 +108,24 @@
</span><span class="cx">   }, 'Cache.addAll with 206 response');
</span><span class="cx"> 
</span><span class="cx"> cache_test(function(cache, test) {
</span><ins>+    var urls = ['../resources/fetch-status.py?status=206',
+                '../resources/fetch-status.py?status=200'];
+    var requests = urls.map(function(url) {
+        var cross_origin_url = new URL(url, location.href);
+        cross_origin_url.hostname = REMOTE_HOST;
+        return new Request(cross_origin_url.href, { mode: 'no-cors' });
+      });
</ins><span class="cx">     return promise_rejects_js(
</span><span class="cx">       test,
</span><span class="cx">       TypeError,
</span><ins>+      cache.addAll(requests),
+      'Cache.addAll should reject with TypeError if any request fails');
+  }, 'Cache.addAll with opaque-filtered 206 response');
+
+cache_test(function(cache, test) {
+    return promise_rejects_js(
+      test,
+      TypeError,
</ins><span class="cx">       cache.add('this-does-not-exist-please-dont-create-it'),
</span><span class="cx">       'Cache.add should reject if response is !ok');
</span><span class="cx">   }, 'Cache.add with request that results in a status of 404');
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragescripttestscachematchjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js      2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-match.js 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -381,6 +381,7 @@
</span><span class="cx"> cache_test(async (cache) => {
</span><span class="cx">     const url = '/dummy';
</span><span class="cx">     const original_type = 'text/html';
</span><ins>+    const override_type = 'text/plain';
</ins><span class="cx">     const init_with_headers = {
</span><span class="cx">       headers: {
</span><span class="cx">         'content-type': original_type
</span><span class="lines">@@ -394,24 +395,22 @@
</span><span class="cx">     assert_true(original_response_type.includes(original_type),
</span><span class="cx">                 'original response should include the expected mime type');
</span><span class="cx"> 
</span><del>-    // Verify overwriting the content-type header does not change the mime
-    // type.  It should be fixed at Response construction time.
</del><ins>+    // Verify overwriting the content-type header changes the mime type.
</ins><span class="cx">     const overwritten_response = new Response('hello world', init_with_headers);
</span><del>-    overwritten_response.headers.set('content-type', 'text/plain');
</del><ins>+    overwritten_response.headers.set('content-type', override_type);
</ins><span class="cx">     const overwritten_response_type = (await overwritten_response.blob()).type;
</span><del>-    assert_equals(overwritten_response_type, original_response_type,
-                  'original and overwritten response mime types should match');
</del><ins>+    assert_equals(overwritten_response_type, override_type,
+                  'mime type can be overridden');
</ins><span class="cx"> 
</span><span class="cx">     // Verify the Response read from Cache uses the original mime type
</span><span class="cx">     // computed when it was first constructed.
</span><span class="cx">     const tmp = new Response('hello world', init_with_headers);
</span><del>-    tmp.headers.set('content-type', 'text/plain');
</del><ins>+    tmp.headers.set('content-type', override_type);
</ins><span class="cx">     await cache.put(url, tmp);
</span><span class="cx">     const cache_response = await cache.match(url);
</span><span class="cx">     const cache_mime_type = (await cache_response.blob()).type;
</span><del>-    assert_equals(cache_mime_type, original_response_type,
-                  'original and cached overwritten response mime types ' +
-                  'should match');
-  }, 'MIME type should be frozen at response construction.');
</del><ins>+    assert_equals(cache_mime_type, override_type,
+                  'overwritten and cached response mime types should match');
+  }, 'MIME type should reflect Content-Type headers of response.');
</ins><span class="cx"> 
</span><span class="cx"> done();
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragescripttestscacheputjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-put.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-put.js        2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/script-tests/cache-put.js   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,10 +1,12 @@
</span><span class="cx"> if (self.importScripts) {
</span><span class="cx">     importScripts('/resources/testharness.js');
</span><ins>+    importScripts('/common/get-host-info.sub.js');
</ins><span class="cx">     importScripts('../resources/test-helpers.js');
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> var test_url = 'https://example.com/foo';
</span><span class="cx"> var test_body = 'Hello world!';
</span><ins>+const { REMOTE_HOST } = get_host_info();
</ins><span class="cx"> 
</span><span class="cx"> cache_test(function(cache) {
</span><span class="cx">     var request = new Request(test_url);
</span><span class="lines">@@ -129,6 +131,23 @@
</span><span class="cx">         });
</span><span class="cx">   }, 'Cache.put with HTTP 206 response');
</span><span class="cx"> 
</span><ins>+cache_test(function(cache, test) {
+    var test_url = new URL('../resources/fetch-status.py?status=206', location.href);
+    test_url.hostname = REMOTE_HOST;
+    var request = new Request(test_url.href, { mode: 'no-cors' });
+    var response;
+    return fetch(request)
+      .then(function(fetch_result) {
+          assert_equals(fetch_result.type, 'opaque',
+              'Test framework error: The response type should be opaque.');
+          assert_equals(fetch_result.status, 0,
+              'Test framework error: The status code should be 0 for an ' +
+              ' opaque-filtered response. This is actually HTTP 206.');
+          response = fetch_result.clone();
+          return promise_rejects_js(test, TypeError, cache.put(request, fetch_result));
+        });
+  }, 'Cache.put with opaque-filtered HTTP 206 response');
+
</ins><span class="cx"> cache_test(function(cache) {
</span><span class="cx">     var test_url = new URL('../resources/fetch-status.py?status=500', location.href).href;
</span><span class="cx">     var request = new Request(test_url);
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestorageserviceworkercacheaddhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-add.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-add.https-expected.txt       2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-add.https-expected.txt  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -9,6 +9,7 @@
</span><span class="cx"> PASS Cache.add with request with null body (not consumed)
</span><span class="cx"> PASS Cache.add with 206 response
</span><span class="cx"> PASS Cache.addAll with 206 response
</span><ins>+PASS Cache.addAll with opaque-filtered 206 response
</ins><span class="cx"> PASS Cache.add with request that results in a status of 404
</span><span class="cx"> PASS Cache.add with request that results in a status of 500
</span><span class="cx"> PASS Cache.addAll with no arguments
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestorageserviceworkercachematchhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-match.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-match.https-expected.txt     2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-match.https-expected.txt        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -23,5 +23,5 @@
</span><span class="cx"> PASS Cache produces large Responses that can be cloned and read correctly.
</span><span class="cx"> PASS cors-exposed header should be stored correctly.
</span><span class="cx"> PASS MIME type should be set from content-header correctly.
</span><del>-FAIL MIME type should be frozen at response construction. assert_equals: original and cached overwritten response mime types should match expected "text/html" but got "text/plain"
</del><ins>+FAIL MIME type should reflect Content-Type headers of response. assert_equals: mime type can be overridden expected "text/plain" but got "text/html"
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestorageserviceworkercacheputhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-put.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-put.https-expected.txt       2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-put.https-expected.txt  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -8,6 +8,7 @@
</span><span class="cx"> PASS Cache.put with an empty response body
</span><span class="cx"> PASS Cache.put with synthetic 206 response
</span><span class="cx"> PASS Cache.put with HTTP 206 response
</span><ins>+FAIL Cache.put with opaque-filtered HTTP 206 response assert_unreached: Should have rejected: undefined Reached unreachable code
</ins><span class="cx"> PASS Cache.put with HTTP 500 response
</span><span class="cx"> PASS Cache.put called twice with matching Requests and different Responses
</span><span class="cx"> PASS Cache.put called twice with request URLs that differ only by a fragment
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragewindowcacheaddhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-add.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-add.https-expected.txt      2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-add.https-expected.txt 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -8,6 +8,7 @@
</span><span class="cx"> PASS Cache.add with request with null body (not consumed)
</span><span class="cx"> PASS Cache.add with 206 response
</span><span class="cx"> PASS Cache.addAll with 206 response
</span><ins>+PASS Cache.addAll with opaque-filtered 206 response
</ins><span class="cx"> PASS Cache.add with request that results in a status of 404
</span><span class="cx"> PASS Cache.add with request that results in a status of 500
</span><span class="cx"> PASS Cache.addAll with no arguments
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragewindowcacheaddhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-add.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-add.https.html      2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-add.https.html 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -4,5 +4,6 @@
</span><span class="cx"> <meta name="timeout" content="long">
</span><span class="cx"> <script src="/resources/testharness.js"></script>
</span><span class="cx"> <script src="/resources/testharnessreport.js"></script>
</span><ins>+<script src="/common/get-host-info.sub.js"></script>
</ins><span class="cx"> <script src="../resources/test-helpers.js"></script>
</span><span class="cx"> <script src="../script-tests/cache-add.js"></script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragewindowcachematchhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-match.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-match.https-expected.txt    2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-match.https-expected.txt       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -22,5 +22,5 @@
</span><span class="cx"> PASS Cache produces large Responses that can be cloned and read correctly.
</span><span class="cx"> PASS cors-exposed header should be stored correctly.
</span><span class="cx"> PASS MIME type should be set from content-header correctly.
</span><del>-FAIL MIME type should be frozen at response construction. assert_equals: original and cached overwritten response mime types should match expected "text/html" but got "text/plain"
</del><ins>+FAIL MIME type should reflect Content-Type headers of response. assert_equals: mime type can be overridden expected "text/plain" but got "text/html"
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragewindowcacheputhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-put.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-put.https-expected.txt      2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-put.https-expected.txt 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -7,6 +7,7 @@
</span><span class="cx"> PASS Cache.put with an empty response body
</span><span class="cx"> PASS Cache.put with synthetic 206 response
</span><span class="cx"> PASS Cache.put with HTTP 206 response
</span><ins>+FAIL Cache.put with opaque-filtered HTTP 206 response assert_unreached: Should have rejected: undefined Reached unreachable code
</ins><span class="cx"> PASS Cache.put with HTTP 500 response
</span><span class="cx"> PASS Cache.put called twice with matching Requests and different Responses
</span><span class="cx"> PASS Cache.put called twice with request URLs that differ only by a fragment
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestoragewindowcacheputhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-put.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-put.https.html      2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-put.https.html 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -4,6 +4,7 @@
</span><span class="cx"> <meta name="timeout" content="long">
</span><span class="cx"> <script src="/resources/testharness.js"></script>
</span><span class="cx"> <script src="/resources/testharnessreport.js"></script>
</span><ins>+<script src="/common/get-host-info.sub.js"></script>
</ins><span class="cx"> <script src="../resources/test-helpers.js"></script>
</span><span class="cx"> <script src="../script-tests/cache-put.js"></script>
</span><span class="cx"> <script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestorageworkercacheaddhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-add.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-add.https-expected.txt      2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-add.https-expected.txt 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -8,6 +8,7 @@
</span><span class="cx"> PASS Cache.add with request with null body (not consumed)
</span><span class="cx"> PASS Cache.add with 206 response
</span><span class="cx"> PASS Cache.addAll with 206 response
</span><ins>+PASS Cache.addAll with opaque-filtered 206 response
</ins><span class="cx"> PASS Cache.add with request that results in a status of 404
</span><span class="cx"> PASS Cache.add with request that results in a status of 500
</span><span class="cx"> PASS Cache.addAll with no arguments
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestorageworkercachematchhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-match.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-match.https-expected.txt    2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-match.https-expected.txt       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -22,5 +22,5 @@
</span><span class="cx"> PASS Cache produces large Responses that can be cloned and read correctly.
</span><span class="cx"> PASS cors-exposed header should be stored correctly.
</span><span class="cx"> PASS MIME type should be set from content-header correctly.
</span><del>-FAIL MIME type should be frozen at response construction. assert_equals: original and cached overwritten response mime types should match expected "text/html" but got "text/plain"
</del><ins>+FAIL MIME type should reflect Content-Type headers of response. assert_equals: mime type can be overridden expected "text/plain" but got "text/html"
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkerscachestorageworkercacheputhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-put.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-put.https-expected.txt      2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-put.https-expected.txt 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -7,6 +7,7 @@
</span><span class="cx"> PASS Cache.put with an empty response body
</span><span class="cx"> PASS Cache.put with synthetic 206 response
</span><span class="cx"> PASS Cache.put with HTTP 206 response
</span><ins>+FAIL Cache.put with opaque-filtered HTTP 206 response assert_unreached: Should have rejected: undefined Reached unreachable code
</ins><span class="cx"> PASS Cache.put with HTTP 500 response
</span><span class="cx"> PASS Cache.put called twice with matching Requests and different Responses
</span><span class="cx"> PASS Cache.put called twice with request URLs that differ only by a fragment
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerServiceWorkerGlobalScopefetchontherightinterfacehttpsanyjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/fetch-on-the-right-interface.https.any.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/fetch-on-the-right-interface.https.any.js      2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/fetch-on-the-right-interface.https.any.js 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -6,9 +6,9 @@
</span><span class="cx">         'instance should not have "fetch" method as its property.');
</span><span class="cx">     assert_inherits(self, 'fetch', 'ServiceWorkerGlobalScope should ' +
</span><span class="cx">         'inherit "fetch" method.');
</span><del>-    assert_own_property(self.__proto__.__proto__, 'fetch',
</del><ins>+    assert_own_property(Object.getPrototypeOf(Object.getPrototypeOf(self)), 'fetch',
</ins><span class="cx">         'WorkerGlobalScope should have "fetch" propery in its prototype.');
</span><del>-    assert_equals(self.fetch, self.__proto__.__proto__.fetch,
</del><ins>+    assert_equals(self.fetch, Object.getPrototypeOf(Object.getPrototypeOf(self)).fetch,
</ins><span class="cx">         'ServiceWorkerGlobalScope.fetch should be the same as ' +
</span><span class="cx">         'WorkerGlobalScope.fetch.');
</span><span class="cx"> }, 'Fetch method on the right interface');
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkeractivationhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/activation.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/activation.https.html   2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/activation.https.html      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx">         return wait_for_state(t, registration.installing, 'installed');
</span><span class="cx">       })
</span><span class="cx">     .then(() => {
</span><del>-        return wait_for_activation_on_dummy_scope(t, self);
</del><ins>+        return wait_for_activation_on_sample_scope(t, self);
</ins><span class="cx">       })
</span><span class="cx">     .then(() => {
</span><span class="cx">         assert_not_equals(registration.waiting, null);
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx">           iframe = result.iframe;
</span><span class="cx">           // Finish the in-flight request.
</span><span class="cx">           registration.active.postMessage('go');
</span><del>-          return wait_for_activation_on_dummy_scope(t, self);
</del><ins>+          return wait_for_activation_on_sample_scope(t, self);
</ins><span class="cx">         })
</span><span class="cx">       .then(() => {
</span><span class="cx">           // The new worker is still waiting. Remove the frame and it should
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclaimfetchhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-fetch.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-fetch.https.html  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-fetch.https.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> <!doctype html>
</span><span class="cx"> <meta charset=utf-8>
</span><span class="cx"> <title></title>
</span><ins>+<meta name="timeout" content="long">
</ins><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="resources/test-helpers.sub.js"></script>
</span><span class="lines">@@ -7,39 +8,32 @@
</span><span class="cx"> <body>
</span><span class="cx"> <script>
</span><span class="cx"> 
</span><del>-async function try_fetch(fetch_func, path) {
</del><ins>+async function tryFetch(fetchFunc, path) {
</ins><span class="cx">   let response;
</span><span class="cx">   try {
</span><del>-   response = await fetch_func(path);
</del><ins>+   response = await fetchFunc(path);
</ins><span class="cx">   } catch (err) {
</span><span class="cx">     throw (`fetch() threw: ${err}`);
</span><span class="cx">   }
</span><span class="cx"> 
</span><del>-  let response_text;
</del><ins>+  let responseText;
</ins><span class="cx">   try {
</span><del>-   response_text = await response.text();
</del><ins>+   responseText = await response.text();
</ins><span class="cx">   } catch (err) {
</span><span class="cx">    throw (`text() threw: ${err}`);
</span><span class="cx">   }
</span><span class="cx"> 
</span><del>-  return response_text;
</del><ins>+  return responseText;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> promise_test(async function(t) {
</span><del>-  let frame;
</del><span class="cx">   const scope = 'resources/';
</span><span class="cx">   const script = 'resources/claim-worker.js';
</span><del>-  t.add_cleanup(async () => {
-    if (frame)
-      frame.remove();
-    return service_worker_unregister(t, scope);
-  });
-
</del><span class="cx">   const resource = 'simple.txt';
</span><span class="cx"> 
</span><span class="cx">   // Create the test frame.
</span><del>-  await service_worker_unregister(t, scope);
-  frame = await with_iframe('resources/blank.html');
</del><ins>+  const frame = await with_iframe('resources/blank.html');
+  t.add_cleanup(() => frame.remove());
</ins><span class="cx"> 
</span><span class="cx">   // Check the controller and test with fetch.
</span><span class="cx">   assert_equals(frame.contentWindow.navigator.controller, undefined,
</span><span class="lines">@@ -46,7 +40,7 @@
</span><span class="cx">                 'Should have no controller.');
</span><span class="cx">   let response;
</span><span class="cx">   try {
</span><del>-    response = await try_fetch(frame.contentWindow.fetch, resource);
</del><ins>+    response = await tryFetch(frame.contentWindow.fetch, resource);
</ins><span class="cx">   } catch (err) {
</span><span class="cx">     assert_unreached(`uncontrolled fetch failed: ${err}`);
</span><span class="cx">   }
</span><span class="lines">@@ -54,12 +48,22 @@
</span><span class="cx">                 'fetch() should not be intercepted.');
</span><span class="cx"> 
</span><span class="cx">   // Register a service worker.
</span><del>-  const registration = await navigator.serviceWorker.register(script, {scope});
</del><ins>+  const registration =
+    await service_worker_unregister_and_register(t, script, scope);
+  t.add_cleanup(() => registration.unregister());
</ins><span class="cx">   const worker = registration.installing;
</span><span class="cx">   await wait_for_state(t, worker, 'activated');
</span><span class="cx"> 
</span><ins>+  // Register a controllerchange event to wait until the controller is updated
+  // and check if the frame is controlled by a service worker.
+  const controllerChanged = new Promise((resolve) => {
+    frame.contentWindow.navigator.serviceWorker.oncontrollerchange = () => {
+      resolve(frame.contentWindow.navigator.serviceWorker.controller);
+    };
+  });
+
</ins><span class="cx">   // Tell the service worker to claim the iframe.
</span><del>-  const saw_message = new Promise((resolve) => {
</del><ins>+  const sawMessage = new Promise((resolve) => {
</ins><span class="cx">     const channel = new MessageChannel();
</span><span class="cx">     channel.port1.onmessage = t.step_func((event) => {
</span><span class="cx">       resolve(event.data);
</span><span class="lines">@@ -66,15 +70,15 @@
</span><span class="cx">     });
</span><span class="cx">     worker.postMessage({port: channel.port2}, [channel.port2]);
</span><span class="cx">   });
</span><del>-  const data = await saw_message;
</del><ins>+  const data = await sawMessage;
</ins><span class="cx">   assert_equals(data, 'PASS', 'Worker call to claim() should fulfill.');
</span><span class="cx"> 
</span><del>-  // Check the controller and test with fetch.
-  const controller = frame.contentWindow.navigator.serviceWorker.controller;
</del><ins>+  // Check if the controller is updated after claim() and test with fetch.
+  const controller = await controllerChanged;
</ins><span class="cx">   assert_true(controller instanceof frame.contentWindow.ServiceWorker,
</span><span class="cx">               'iframe should be controlled.');
</span><span class="cx">   try {
</span><del>-    response = await try_fetch(frame.contentWindow.fetch, resource);
</del><ins>+    response = await tryFetch(frame.contentWindow.fetch, resource);
</ins><span class="cx">   } catch (err) {
</span><span class="cx">     assert_unreached(`controlled fetch failed: ${err}`);
</span><span class="cx">   }
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclaimworkerfetchhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-worker-fetch.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-worker-fetch.https-expected.txt   2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-worker-fetch.https-expected.txt      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,4 +1,11 @@
</span><span class="cx"> 
</span><ins>+
+Harness Error (TIMEOUT), message = null
+
</ins><span class="cx"> PASS fetch() in Worker should be intercepted after the client is claimed.
</span><span class="cx"> FAIL fetch() in nested Worker should be intercepted after the client is claimed. assert_equals: fetch() should not be intercepted. expected "a simple text file\n" but got "Fail: undefined"
</span><ins>+PASS fetch() in blob URL Worker should be intercepted after the client is claimed.
+TIMEOUT fetch() in nested blob URL Worker created from a blob URL Worker should be intercepted after the client is claimed. Test timed out
+NOTRUN fetch() in nested Worker created from a blob URL Worker should be intercepted after the client is claimed.
+NOTRUN fetch() in nested blob URL Worker created from a Worker should be intercepted after the client is claimed.
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclaimworkerfetchhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-worker-fetch.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-worker-fetch.https.html   2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-worker-fetch.https.html      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -7,73 +7,76 @@
</span><span class="cx"> <body>
</span><span class="cx"> <script>
</span><span class="cx"> 
</span><del>-promise_test(function(t) {
</del><ins>+promise_test((t) => {
</ins><span class="cx">   return runTest(t, 'resources/claim-worker-fetch-iframe.html');
</span><span class="cx"> }, 'fetch() in Worker should be intercepted after the client is claimed.');
</span><span class="cx"> 
</span><del>-promise_test(function(t) {
</del><ins>+promise_test((t) => {
</ins><span class="cx">   return runTest(t, 'resources/claim-nested-worker-fetch-iframe.html');
</span><span class="cx"> }, 'fetch() in nested Worker should be intercepted after the client is claimed.');
</span><span class="cx"> 
</span><del>-function runTest(t, iframe_url) {
-  var resource = 'simple.txt';
</del><ins>+promise_test((t) => {
+  return runTest(t, 'resources/claim-blob-url-worker-fetch-iframe.html');
+}, 'fetch() in blob URL Worker should be intercepted after the client is claimed.');
</ins><span class="cx"> 
</span><del>-  var frame;
-  var registration;
-  var worker;
-  var scope = 'resources/';
-  var script = 'resources/claim-worker.js';
</del><ins>+promise_test((t) => {
+  return runTest(t, 'resources/nested-blob-url-workers.html');
+}, 'fetch() in nested blob URL Worker created from a blob URL Worker should be intercepted after the client is claimed.');
</ins><span class="cx"> 
</span><del>-  return Promise.resolve()
-    // Create the test iframe with a dedicated worker.
-    .then(() => with_iframe(iframe_url))
-    .then(f => {
-      t.add_cleanup(() => f.remove());
-      frame = f;
-    })
</del><ins>+promise_test((t) => {
+  return runTest(t, 'resources/nested-worker-created-from-blob-url-worker.html');
+}, 'fetch() in nested Worker created from a blob URL Worker should be intercepted after the client is claimed.');
</ins><span class="cx"> 
</span><del>-    // Check the controller and test with fetch in the worker.
-    .then(() => assert_equals(frame.contentWindow.navigator.controller,
-                              undefined,
-                              'Should have no controller.'))
-    .then(() => frame.contentWindow.fetch_in_worker(resource))
-    .then(response_text => assert_equals(response_text,
-                                         'a simple text file\n',
-                                         'fetch() should not be intercepted.'))
-    // Register a service worker.
-    .then(() => service_worker_unregister_and_register(t, script, scope))
-    .then(r => {
-      t.add_cleanup(() => r.unregister());
-      worker = r.installing;
-    })
-    .then(() => wait_for_state(t, worker, 'activated'))
</del><ins>+promise_test((t) => {
+  return runTest(t, 'resources/nested-blob-url-worker-created-from-worker.html');
+}, 'fetch() in nested blob URL Worker created from a Worker should be intercepted after the client is claimed.');
</ins><span class="cx"> 
</span><del>-    // Let the service worker claim the iframe and the worker.
-    .then(() => {
-      var channel = new MessageChannel();
-      var saw_message = new Promise(function(resolve) {
-        channel.port1.onmessage = t.step_func(function(e) {
-          assert_equals(e.data, 'PASS',
-                        'Worker call to claim() should fulfill.');
-          resolve();
-        });
-      });
-      worker.postMessage({port: channel.port2}, [channel.port2]);
-      return saw_message;
-    })
</del><ins>+async function runTest(t, iframe_url) {
+  const resource = 'simple.txt';
+  const scope = 'resources/';
+  const script = 'resources/claim-worker.js';
</ins><span class="cx"> 
</span><del>-    // Check the controller and test with fetch in the worker.
-    .then(() => frame.contentWindow.navigator.serviceWorker.getRegistration(scope))
-    .then(r => registration = r)
-    .then(() => assert_equals(frame.contentWindow.navigator.serviceWorker.controller,
-                             registration.active,
-                             'Test iframe should be claimed.'))
</del><ins>+  // Create the test iframe with a dedicated worker.
+  const frame = await with_iframe(iframe_url);
+  t.add_cleanup(_ => frame.remove());
+
+  // Check the controller and test with fetch in the worker.
+  assert_equals(frame.contentWindow.navigator.controller,
+                undefined, 'Should have no controller.');
+  {
+    const response_text = await frame.contentWindow.fetch_in_worker(resource);
+    assert_equals(response_text, 'a simple text file\n',
+                  'fetch() should not be intercepted.');
+  }
+
+  // Register a service worker.
+  const reg = await service_worker_unregister_and_register(t, script, scope);
+  t.add_cleanup(_ => reg.unregister());
+  await wait_for_state(t, reg.installing, 'activated');
+
+  // Let the service worker claim the iframe and the worker.
+  const channel = new MessageChannel();
+  const saw_message = new Promise(function(resolve) {
+    channel.port1.onmessage = t.step_func(function(e) {
+      assert_equals(e.data, 'PASS', 'Worker call to claim() should fulfill.');
+      resolve();
+    });
+  });
+  reg.active.postMessage({port: channel.port2}, [channel.port2]);
+  await saw_message;
+
+  // Check the controller and test with fetch in the worker.
+  const reg2 =
+    await frame.contentWindow.navigator.serviceWorker.getRegistration(scope);
+  assert_equals(frame.contentWindow.navigator.serviceWorker.controller,
+                reg2.active, 'Test iframe should be claimed.');
+
+  {
</ins><span class="cx">     // TODO(horo): Check the worker's navigator.seviceWorker.controller.
</span><del>-    .then(() => frame.contentWindow.fetch_in_worker(resource))
-    .then(response_text =>
-          assert_equals(response_text,
-                        'Intercepted!',
-                        'fetch() in the worker should be intercepted.'));
</del><ins>+    const response_text = await frame.contentWindow.fetch_in_worker(resource);
+    assert_equals(response_text, 'Intercepted!',
+                  'fetch() in the worker should be intercepted.');
+  }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclientnavigatehttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-navigate.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-navigate.https.html      2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-navigate.https.html 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> <!doctype html>
</span><span class="cx"> <meta charset=utf-8>
</span><ins>+<meta name="timeout" content="long">
</ins><span class="cx"> <title>Service Worker: WindowClient.navigate</title>
</span><span class="cx"> <script src=/resources/testharness.js></script>
</span><span class="cx"> <script src=/resources/testharnessreport.js></script>
</span><span class="lines">@@ -32,154 +33,75 @@
</span><span class="cx">     });
</span><span class="cx">   }
</span><span class="cx"> 
</span><ins>+  async function with_controlled_iframe_and_url(t, name, f) {
+    const SCRIPT = "resources/client-navigate-worker.js";
+    const SCOPE = "resources/client-navigate-frame.html";
+
+    // Register service worker and wait for it to become activated
+    const registration = await service_worker_unregister_and_register(t, SCRIPT, SCOPE);
+    t.add_cleanup(() => registration.unregister());
+    const worker = registration.installing;
+    await wait_for_state(t, worker, 'activated');
+
+    // Create child iframe and make sure we register a listener for the message
+    // it sends before it's created
+    const client_id_promise = wait_for_message();
+    const iframe = await with_iframe(SCOPE);
+    t.add_cleanup(() => iframe.remove());
+    const { id } = await client_id_promise;
+
+    // Run the test in the service worker and fetch it
+    const { result, url } = await run_test(worker, id, name);
+    fetch_tests_from_worker(worker);
+    assert_equals(result, name);
+
+    // Hand over the iframe and URL from the service worker to the callback
+    await f(iframe, url);
+  }
+
</ins><span class="cx">   promise_test(function(t) {
</span><del>-    var worker = "resources/client-navigate-worker.js";
-    var scope = "resources/client-navigate-frame.html";
-    var controller, frame, clientId;
-
-    return service_worker_unregister_and_register(t, worker, scope)
-      .then(reg => {
-        controller = reg.installing;
-        return wait_for_state(t, reg.installing, "activated");
-      })
-      .then(___ => with_iframe(scope))
-      .then(f => {
-        frame = f;
-        fetch_tests_from_worker(controller);
-        return wait_for_message()
-      })
-      .then(({id}) => clientId = id)
-      .then(___ => run_test(controller, clientId, "test_client_navigate_success"))
-      .then(({result, url}) => {
-        assert_equals(result, "test_client_navigate_success");
-        assert_equals(
-          url, new URL("resources/client-navigated-frame.html",
-                       location).toString());
-        assert_equals(
-          frame.contentWindow.location.href,
-          new URL("resources/client-navigated-frame.html",
-                  location).toString());
-        frame.remove();
-      })
-      .catch(unreached_rejection(t))
-      .then(___ => service_worker_unregister(t, scope));
</del><ins>+    return with_controlled_iframe_and_url(t, 'test_client_navigate_success', async (iframe, url) => {
+      assert_equals(
+        url, new URL("resources/client-navigated-frame.html",
+                      location).toString());
+      assert_equals(
+        iframe.contentWindow.location.href,
+        new URL("resources/client-navigated-frame.html",
+                location).toString());
+    });
</ins><span class="cx">   }, "Frame location should update on successful navigation");
</span><span class="cx"> 
</span><span class="cx">   promise_test(function(t) {
</span><del>-    var worker = "resources/client-navigate-worker.js";
-    var scope = "resources/client-navigate-frame.html";
-    var controller, frame, clientId;
-
-    return service_worker_unregister_and_register(t, worker, scope)
-      .then(reg => {
-        controller = reg.installing;
-        return wait_for_state(t, reg.installing, "activated");
-      })
-      .then(___ => with_iframe(scope))
-      .then(f => {
-        frame = f;
-        fetch_tests_from_worker(controller);
-        return wait_for_message()
-      })
-      .then(({id}) => clientId = id)
-      .then(___ => run_test(controller, clientId, "test_client_navigate_redirect"))
-      .then(({result, url}) => {
-        assert_equals(result, "test_client_navigate_redirect");
-        assert_equals(url, "");
-        assert_throws_dom("SecurityError", function() { return frame.contentWindow.location.href });
-        frame.remove();
-      })
-      .catch(unreached_rejection(t))
-      .then(___ => service_worker_unregister(t, scope));
</del><ins>+    return with_controlled_iframe_and_url(t, 'test_client_navigate_redirect', async (iframe, url) => {
+      assert_equals(url, "");
+      assert_throws_dom("SecurityError", function() { return iframe.contentWindow.location.href });
+    });
</ins><span class="cx">   }, "Frame location should not be accessible after redirect");
</span><span class="cx"> 
</span><span class="cx">   promise_test(function(t) {
</span><del>-    var worker = "resources/client-navigate-worker.js";
-    var scope = "resources/client-navigate-frame.html";
-    var controller, frame, clientId;
-
-    return service_worker_unregister_and_register(t, worker, scope)
-      .then(reg => {
-        controller = reg.installing;
-        return wait_for_state(t, reg.installing, "activated");
-      })
-      .then(___ => with_iframe(scope))
-      .then(f => {
-        frame = f;
-        fetch_tests_from_worker(controller);
-        return wait_for_message()
-      })
-      .then(({id}) => clientId = id)
-      .then(___ => run_test(controller, clientId, "test_client_navigate_cross_origin"))
-      .then(({result, url}) => {
-        assert_equals(result, "test_client_navigate_cross_origin");
-        assert_equals(url, "");
-        assert_throws_dom("SecurityError", function() { return frame.contentWindow.location.href });
-        frame.remove();
-      })
-      .catch(unreached_rejection(t))
-      .then(___ => service_worker_unregister(t, scope));
</del><ins>+    return with_controlled_iframe_and_url(t, 'test_client_navigate_cross_origin', async (iframe, url) => {
+      assert_equals(url, "");
+      assert_throws_dom("SecurityError", function() { return iframe.contentWindow.location.href });
+    });
</ins><span class="cx">   }, "Frame location should not be accessible after cross-origin navigation");
</span><span class="cx"> 
</span><span class="cx">   promise_test(function(t) {
</span><del>-    var worker = "resources/client-navigate-worker.js";
-    var scope = "resources/client-navigate-frame.html";
-    var controller, frame, clientId;
-
-    return service_worker_unregister_and_register(t, worker, scope)
-      .then(reg => {
-        controller = reg.installing;
-        return wait_for_state(t, reg.installing, "activated");
-      })
-      .then(___ => with_iframe(scope))
-      .then(f => {
-        frame = f;
-        fetch_tests_from_worker(controller);
-        return wait_for_message()
-      })
-      .then(({id}) => clientId = id)
-      .then(___ => run_test(controller, clientId, "test_client_navigate_about_blank"))
-      .then(({result, url}) => {
-        assert_equals(result, "test_client_navigate_about_blank");
-        assert_equals(
-          frame.contentWindow.location.href,
</del><ins>+    return with_controlled_iframe_and_url(t, 'test_client_navigate_about_blank', async (iframe, url) => {
+      assert_equals(
+          iframe.contentWindow.location.href,
</ins><span class="cx">           new URL("resources/client-navigate-frame.html",
</span><span class="cx">                   location).toString());
</span><del>-        frame.contentWindow.document.body.style = "background-color: green"
-        frame.remove();
-      })
-      .catch(unreached_rejection(t))
-      .then(___ => service_worker_unregister(t, scope));
</del><ins>+      iframe.contentWindow.document.body.style = "background-color: green"
+    });
</ins><span class="cx">   }, "Frame location should not update on failed about:blank navigation");
</span><span class="cx"> 
</span><span class="cx">   promise_test(function(t) {
</span><del>-    var worker = "resources/client-navigate-worker.js";
-    var scope = "resources/client-navigate-frame.html";
-    var controller, frame, clientId;
-
-    return service_worker_unregister_and_register(t, worker, scope)
-      .then(reg => {
-        controller = reg.installing;
-        return wait_for_state(t, reg.installing, "activated");
-      })
-      .then(___ => with_iframe(scope))
-      .then(f => {
-        frame = f;
-        fetch_tests_from_worker(controller);
-        return wait_for_message()
-      })
-      .then(({id}) => clientId = id)
-      .then(___ => run_test(controller, clientId, "test_client_navigate_mixed_content"))
-      .then(({result, url}) => {
-        assert_equals(result, "test_client_navigate_mixed_content");
-        assert_equals(
-          frame.contentWindow.location.href,
</del><ins>+    return with_controlled_iframe_and_url(t, 'test_client_navigate_mixed_content', async (iframe, url) => {
+      assert_equals(
+          iframe.contentWindow.location.href,
</ins><span class="cx">           new URL("resources/client-navigate-frame.html",
</span><span class="cx">                   location).toString());
</span><del>-        frame.contentWindow.document.body.style = "background-color: green"
-        frame.remove();
-      })
-      .catch(unreached_rejection(t))
-      .then(___ => service_worker_unregister(t, scope));
</del><ins>+      iframe.contentWindow.document.body.style = "background-color: green"
+    });
</ins><span class="cx">   }, "Frame location should not update on failed mixed-content navigation");
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclienturlofbloburlworkerhttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-url-of-blob-url-worker.https-expected.txt (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-url-of-blob-url-worker.https-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-url-of-blob-url-worker.https-expected.txt   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+FAIL Client.url of a blob URL worker should be a blob URL. assert_not_equals: worker client should exist got disallowed value "one worker client should exist"
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclienturlofbloburlworkerhttpshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-url-of-blob-url-worker.https.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-url-of-blob-url-worker.https.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-url-of-blob-url-worker.https.html   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+<!DOCTYPE html>
+<title>Service Worker: client.url of a worker created from a blob URL</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<script>
+
+const SCRIPT = 'resources/client-url-of-blob-url-worker.js';
+const SCOPE = 'resources/client-url-of-blob-url-worker.html';
+
+promise_test(async (t) => {
+  const reg = await service_worker_unregister_and_register(t, SCRIPT, SCOPE);
+  t.add_cleanup(_ => reg.unregister());
+  await wait_for_state(t, reg.installing, 'activated');
+
+  const frame = await with_iframe(SCOPE);
+  t.add_cleanup(_ => frame.remove());
+  assert_not_equals(frame.contentWindow.navigator.serviceWorker.controller,
+                    null, 'frame should be controlled');
+
+  const response = await frame.contentWindow.createAndFetchFromBlobWorker();
+
+  assert_not_equals(response.result, 'one worker client should exist',
+                    'worker client should exist');
+  assert_equals(response.result, response.expected,
+                'client.url and worker location href should be the same');
+
+}, 'Client.url of a blob URL worker should be a blob URL.');
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclientsmatchallbloburlworkerhttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-blob-url-worker.https-expected.txt (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-blob-url-worker.https-expected.txt                             (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-blob-url-worker.https-expected.txt        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+FAIL Test Clients.matchAll() with a blob URL worker client. assert_equals: expected 1 but got 0
+FAIL Test Clients.matchAll() with an uncontrolled blob URL worker client. assert_equals: expected 1 but got 0
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerclientsmatchallbloburlworkerhttpshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-blob-url-worker.https.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-blob-url-worker.https.html                             (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-blob-url-worker.https.html        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+<!DOCTYPE html>
+<title>Service Worker: Clients.matchAll with a blob URL worker client</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<script>
+const SCRIPT = 'resources/clients-matchall-worker.js';
+
+promise_test(async (t) => {
+  const scope = 'resources/clients-matchall-blob-url-worker.html';
+
+  const reg = await service_worker_unregister_and_register(t, SCRIPT, scope);
+  t.add_cleanup(_ => reg.unregister());
+  await wait_for_state(t, reg.installing, 'activated');
+
+  const frame = await with_iframe(scope);
+  t.add_cleanup(_ => frame.remove());
+
+  {
+    const message = await frame.contentWindow.waitForWorker();
+    assert_equals(message.data, 'Worker is ready.',
+                  'Worker should reply to the message.');
+  }
+
+  const channel = new MessageChannel();
+  const message = await new Promise(resolve => {
+    channel.port1.onmessage = resolve;
+    frame.contentWindow.navigator.serviceWorker.controller.postMessage(
+      {port: channel.port2, options: {type: 'worker'}}, [channel.port2]);
+  });
+
+  checkMessageEvent(message);
+
+}, 'Test Clients.matchAll() with a blob URL worker client.');
+
+promise_test(async (t) => {
+  const scope = 'resources/blank.html';
+
+  const reg = await service_worker_unregister_and_register(t, SCRIPT, scope);
+  t.add_cleanup(_ => reg.unregister());
+  await wait_for_state(t, reg.installing, 'activated');
+
+  const workerScript = `
+    self.onmessage = (e) => {
+      self.postMessage("Worker is ready.");
+    };
+  `;
+  const blob = new Blob([workerScript], { type: 'text/javascript' });
+  const blobUrl = URL.createObjectURL(blob);
+  const worker = new Worker(blobUrl);
+
+  {
+    const message = await new Promise(resolve => {
+      worker.onmessage = resolve;
+      worker.postMessage("Ping to worker.");
+    });
+    assert_equals(message.data, 'Worker is ready.',
+                  'Worker should reply to the message.');
+  }
+
+  const channel = new MessageChannel();
+  const message = await new Promise(resolve => {
+    channel.port1.onmessage = resolve;
+    reg.active.postMessage(
+      {port: channel.port2,
+       options: {includeUncontrolled: true, type: 'worker'}},
+      [channel.port2]
+    );
+  });
+
+  checkMessageEvent(message);
+
+}, 'Test Clients.matchAll() with an uncontrolled blob URL worker client.');
+
+function checkMessageEvent(e) {
+  assert_equals(e.data.length, 1);
+
+  const workerClient = e.data[0];
+  assert_equals(workerClient[0], undefined); // visibilityState
+  assert_equals(workerClient[1], undefined); // focused
+  assert_true(workerClient[2].includes('blob:')); // url
+  assert_equals(workerClient[3], 'worker'); // type
+  assert_equals(workerClient[4], 'none'); // frameType
+}
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkercredentialshttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/credentials.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/credentials.https-expected.txt  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/credentials.https-expected.txt     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -2,4 +2,6 @@
</span><span class="cx"> PASS Set cookies as initialization
</span><span class="cx"> PASS Main script should have credentials
</span><span class="cx"> FAIL Imported script should have credentials promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'worker.postMessage')"
</span><ins>+FAIL Module with an imported statement should not have credentials promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'worker.postMessage')"
+FAIL Script with service worker served as modules should not have credentials assert_equals: new module worker should not have credentials expected (undefined) undefined but got (string) "1"
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkercredentialshttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/credentials.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/credentials.https.html  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/credentials.https.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -61,5 +61,40 @@
</span><span class="cx">   assert_equals(updated_cookies[COOKIE_NAME], '1',
</span><span class="cx">                 'updated worker has credentials');
</span><span class="cx"> }, 'Imported script should have credentials');
</span><ins>+
+promise_test(async t => {
+  const key = token();
+  const registration = await service_worker_unregister_and_register(
+      t, `resources/import-echo-cookie-worker-module.py?key=${key}`, SCOPE, {type: 'module'});
+  t.add_cleanup(() => registration.unregister());
+  const worker = registration.installing;
+
+  const cookies = await get_cookies(worker);
+  assert_equals(cookies[COOKIE_NAME], undefined, 'new module worker should not have credentials');
+
+  await registration.update();
+  const updated_worker = registration.installing;
+  const updated_cookies = await get_cookies(updated_worker);
+  assert_equals(updated_cookies[COOKIE_NAME], undefined,
+                'updated worker should not have credentials');
+}, 'Module with an imported statement should not have credentials');
+
+promise_test(async t => {
+  const key = token();
+  const registration = await service_worker_unregister_and_register(
+t, `resources/echo-cookie-worker.py?key=${key}`, SCOPE, {type: 'module'});
+  t.add_cleanup(() => registration.unregister());
+  const worker = registration.installing;
+
+  const cookies = await get_cookies(worker);
+  assert_equals(cookies[COOKIE_NAME], undefined, 'new module worker should not have credentials');
+
+  await registration.update();
+  const updated_worker = registration.installing;
+  const updated_cookies = await get_cookies(updated_worker);
+  assert_equals(updated_cookies[COOKIE_NAME], undefined,
+                'updated worker should not have credentials');
+}, 'Script with service worker served as modules should not have credentials');
+
</ins><span class="cx"> </script>
</span><span class="cx"> </body>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerdatatransferfileshttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/data-transfer-files.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/data-transfer-files.https-expected.txt  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/data-transfer-files.https-expected.txt     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS Posting a File in a navigation handled by a service worker
</del><ins>+FAIL Posting a File in a navigation handled by a service worker assert_equals: expected "foobar" but got "FieldStorage('testinput', 'name', 'foobar')"
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerdatatransferfileshttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/data-transfer-files.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/data-transfer-files.https.html  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/data-transfer-files.https.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx">       resolve(e.data);
</span><span class="cx">     };
</span><span class="cx">   });
</span><del>-  assert_equals(data, "FieldStorage('testinput', 'name', 'foobar')");
</del><ins>+  assert_equals(data, "foobar");
</ins><span class="cx"> }, 'Posting a File in a navigation handled by a service worker');
</span><span class="cx"> </script>
</span><span class="cx"> </body>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerdetachedcontexthttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/detached-context.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/detached-context.https.html     2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/detached-context.https.html        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx">           // resolve on a detached registration.  We can't check for
</span><span class="cx">           // an explicit rejection, though, because not all browsers
</span><span class="cx">           // fire rejection callbacks on detached promises.  Instead
</span><del>-          // we wait for a dummy scope to install, activate, and
</del><ins>+          // we wait for a sample scope to install, activate, and
</ins><span class="cx">           // unregister before declaring that the promises did not
</span><span class="cx">           // resolve.
</span><span class="cx">           r.unregister().then(() => resolvedCount += 1,
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">                               () => {});
</span><span class="cx">           r.update().then(() => resolvedCount += 1,
</span><span class="cx">                           () => {});
</span><del>-          return wait_for_activation_on_dummy_scope(t, window);
</del><ins>+          return wait_for_activation_on_sample_scope(t, window);
</ins><span class="cx">         })
</span><span class="cx">       .then(() => {
</span><span class="cx">           assert_equals(resolvedCount, 0,
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchcsphttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-csp.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-csp.https.html    2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-csp.https.html       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">           return assert_resolves(
</span><span class="cx">               frame.contentWindow.load_image(
</span><span class="cx">                   // The request for IMAGE_URL will be fetched in SW.
</span><del>-                  './dummy?url=' + encodeURIComponent(IMAGE_URL)),
</del><ins>+                  './sample?url=' + encodeURIComponent(IMAGE_URL)),
</ins><span class="cx">               'Allowed scope image resource which was fetched via SW should ' +
</span><span class="cx">               'be loaded.');
</span><span class="cx">         })
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx">           return assert_rejects(
</span><span class="cx">               frame.contentWindow.load_image(
</span><span class="cx">                   // The request for REMOTE_IMAGE_URL will be fetched in SW.
</span><del>-                  './dummy?mode=no-cors&url=' +
</del><ins>+                  './sample?mode=no-cors&url=' +
</ins><span class="cx">                   encodeURIComponent(REMOTE_IMAGE_URL)),
</span><span class="cx">               'Disallowed scope image resource which was fetched via SW ' +
</span><span class="cx">               'should not be loaded.');
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventhandledhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-handled.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-handled.https.html  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-handled.https.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">     ' navigation request');
</span><span class="cx"> 
</span><span class="cx"> promise_test(async (t) => {
</span><del>-  frame.contentWindow.fetch('dummy.txt?respondWith-not-called');
</del><ins>+  frame.contentWindow.fetch('sample.txt?respondWith-not-called');
</ins><span class="cx">   const message = await wait_for_message_from_worker();
</span><span class="cx">   assert_equals(message, 'RESOLVED');
</span><span class="cx"> }, 'FetchEvent.handled should resolve when respondWith() is not called for a' +
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> 
</span><span class="cx"> promise_test(async (t) => {
</span><span class="cx">   frame.contentWindow.fetch(
</span><del>-      'dummy.txt?respondWith-not-called-and-event-canceled').catch((e) => {});
</del><ins>+      'sample.txt?respondWith-not-called-and-event-canceled').catch((e) => {});
</ins><span class="cx">   const message = await wait_for_message_from_worker();
</span><span class="cx">   assert_equals(message, 'REJECTED');
</span><span class="cx"> }, 'FetchEvent.handled should reject when respondWith() is not called and the' +
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx"> 
</span><span class="cx"> promise_test(async (t) => {
</span><span class="cx">   frame.contentWindow.fetch(
</span><del>-      'dummy.txt?respondWith-called-and-promise-resolved');
</del><ins>+      'sample.txt?respondWith-called-and-promise-resolved');
</ins><span class="cx">   const message = await wait_for_message_from_worker();
</span><span class="cx">   assert_equals(message, 'RESOLVED');
</span><span class="cx"> }, 'FetchEvent.handled should resolve when the promise provided' +
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> 
</span><span class="cx"> promise_test(async (t) => {
</span><span class="cx">   frame.contentWindow.fetch(
</span><del>-      'dummy.txt?respondWith-called-and-promise-resolved-to-invalid-response')
</del><ins>+      'sample.txt?respondWith-called-and-promise-resolved-to-invalid-response')
</ins><span class="cx">       .catch((e) => {});
</span><span class="cx">   const message = await wait_for_message_from_worker();
</span><span class="cx">   assert_equals(message, 'REJECTED');
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx"> 
</span><span class="cx"> promise_test(async (t) => {
</span><span class="cx">   frame.contentWindow.fetch(
</span><del>-      'dummy.txt?respondWith-called-and-promise-rejected').catch((e) => {});
</del><ins>+      'sample.txt?respondWith-called-and-promise-rejected').catch((e) => {});
</ins><span class="cx">   const message = await wait_for_message_from_worker();
</span><span class="cx">   assert_equals(message, 'REJECTED');
</span><span class="cx"> }, 'FetchEvent.handled should reject when the promise provided to' +
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventishistorybackwardnavigationmanualhttpshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-backward-navigation-manual.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-backward-navigation-manual.https.html    2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-backward-navigation-manual.https.html       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,8 +0,0 @@
</span><del>-<!DOCTYPE html>
-<body>
-<p>Click <a href="resources/install-worker.html?isHistoryNavigation&amp;script=fetch-event-test-worker.js">this link</a>.
-   Once you see &quot;method = GET,...&quot; in the page, go to another page, and then go back to the page using the Backward button.
-   You should see &quot;method = GET, isHistoryNavigation = true&quot;.
-</p>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventishistoryforwardnavigationmanualhttpshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-forward-navigation-manual.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-forward-navigation-manual.https.html     2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-forward-navigation-manual.https.html        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,8 +0,0 @@
</span><del>-<!DOCTYPE html>
-<body>
-<p>Click <a href="resources/install-worker.html?isHistoryNavigation&amp;script=fetch-event-test-worker.js">this link</a>.
-   Once you see &quot;method = GET,...&quot; in the page, go back to this page using the Backward button, and then go to the second page using the Forward button.
-   You should see &quot;method = GET, isHistoryNavigation = true&quot;.
-</p>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventisreloadiframenavigationmanualhttpsexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-iframe-navigation-manual.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-iframe-navigation-manual.https-expected.txt       2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-iframe-navigation-manual.https-expected.txt  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,4 +0,0 @@
</span><del>-
-
-FAIL FetchEvent#request.isReloadNavigation is true for manual reload. assert_equals: expected "method = GET, isReloadNavigation = false" but got "method = GET, isReloadNavigation = undefined"
-
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventisreloadiframenavigationmanualhttpshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-iframe-navigation-manual.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-iframe-navigation-manual.https.html       2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-iframe-navigation-manual.https.html  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,31 +0,0 @@
</span><del>-<!DOCTYPE html>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/common/get-host-info.sub.js"></script>
-<script src="resources/test-helpers.sub.js"></script>
-<body>
-<script>
-const worker = 'resources/fetch-event-test-worker.js';
-
-promise_test(async (t) => {
-  const scope = 'resources/simple.html?isReloadNavigation';
-
-  const reg = await service_worker_unregister_and_register(t, worker, scope);
-  await wait_for_state(t, reg.installing, 'activated');
-  const frame = await with_iframe(scope);
-  assert_equals(frame.contentDocument.body.textContent,
-                'method = GET, isReloadNavigation = false');
-  await new Promise((resolve) => {
-    frame.addEventListener('load', resolve);
-    frame.contentDocument.body.innerText =
-      'Reload this frame manually!';
-  });
-  assert_equals(frame.contentDocument.body.textContent,
-      'method = GET, isReloadNavigation = true');
-  frame.remove();
-  await reg.unregister();
-}, 'FetchEvent#request.isReloadNavigation is true for manual reload.');
-
-</script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventisreloadnavigationmanualhttpshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-navigation-manual.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-navigation-manual.https.html      2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-navigation-manual.https.html 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,8 +0,0 @@
</span><del>-<!DOCTYPE html>
-<body>
-<p>Click <a href="resources/install-worker.html?isReloadNavigation&script=fetch-event-test-worker.js">this link</a>.
-   Once you see &quot;method = GET,...&quot; in the page, reload the page.
-   You will see &quot;method = GET, isReloadNavigation = true&quot;.
-</p>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventreferrerpolicyhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-referrer-policy.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-referrer-policy.https-expected.txt  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-referrer-policy.https-expected.txt     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> FAIL Service Worker responds to fetch event with the referrer policy promise_test: Unhandled rejection with value: object "TypeError: Not allowed to request resource"
</span><del>-PASS Service Worker should respond to fetch with the default referrer policy
-PASS Service Worker should respond to fetch with the referrer URL when a member of RequestInit is present - Default Referrer
</del><ins>+FAIL Service Worker should respond to fetch with the default referrer policy assert_equals: expected "ReferrerPolicy: strict-origin-when-cross-origin" but got "ReferrerPolicy: no-referrer-when-downgrade"
+FAIL Service Worker should respond to fetch with the referrer URL when a member of RequestInit is present - Default Referrer assert_equals: expected "Referrer: https://localhost:9443/service-workers/service-worker/resources/simple.html?referrerPolicy\nReferrerPolicy: strict-origin-when-cross-origin" but got "Referrer: https://localhost:9443/service-workers/service-worker/resources/simple.html?referrerPolicy\nReferrerPolicy: no-referrer-when-downgrade"
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventreferrerpolicyhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-referrer-policy.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-referrer-policy.https.html  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-referrer-policy.https.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx">           do_test(referrer,
</span><span class="cx">             response_text,
</span><span class="cx">             'Referrer: ' + href + '\n' +
</span><del>-            'ReferrerPolicy: no-referrer-when-downgrade',
</del><ins>+            'ReferrerPolicy: strict-origin-when-cross-origin',
</ins><span class="cx">             'Service Worker should respond to fetch with the referrer URL when a member of RequestInit is present');
</span><span class="cx">           var http_url = get_host_info()['HTTP_ORIGIN'] + base_path() +
</span><span class="cx">                          '/resources/simple.html?referrerFull';
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">           do_test(referrer,
</span><span class="cx">             response_text,
</span><span class="cx">             'Referrer: \n' +
</span><del>-            'ReferrerPolicy: no-referrer-when-downgrade',
</del><ins>+            'ReferrerPolicy: strict-origin-when-cross-origin',
</ins><span class="cx">             'Service Worker should respond to fetch with no referrer when a member of RequestInit is present with an HTTP request');
</span><span class="cx">           return frame.contentWindow.fetch('resources/simple.html?referrerFull',
</span><span class="cx">                                            {referrerPolicy: "", referrer: referrer});
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx">           do_test(referrer,
</span><span class="cx">             response_text,
</span><span class="cx">             'Referrer: ' + href + '\n' +
</span><del>-            'ReferrerPolicy: no-referrer-when-downgrade',
</del><ins>+            'ReferrerPolicy: strict-origin-when-cross-origin',
</ins><span class="cx">             'Service Worker should respond to fetch with the referrer with ""');
</span><span class="cx">           var http_url = get_host_info()['HTTP_ORIGIN'] + base_path() +
</span><span class="cx">                          '/resources/simple.html?referrerFull';
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">           do_test(referrer,
</span><span class="cx">             response_text,
</span><span class="cx">             'Referrer: \n' +
</span><del>-            'ReferrerPolicy: no-referrer-when-downgrade',
</del><ins>+            'ReferrerPolicy: strict-origin-when-cross-origin',
</ins><span class="cx">             'Service Worker should respond to fetch with no referrer with ""');
</span><span class="cx">           return frame.contentWindow.fetch('resources/simple.html?referrerFull',
</span><span class="cx">                                            {referrerPolicy: "origin", referrer: referrer});
</span><span class="lines">@@ -253,7 +253,7 @@
</span><span class="cx">       .then(function(f) {
</span><span class="cx">           frame = f;
</span><span class="cx">           test(() => {
</span><del>-            assert_equals(frame.contentDocument.body.textContent, 'ReferrerPolicy: no-referrer-when-downgrade');
</del><ins>+            assert_equals(frame.contentDocument.body.textContent, 'ReferrerPolicy: strict-origin-when-cross-origin');
</ins><span class="cx">           }, 'Service Worker should respond to fetch with the default referrer policy');
</span><span class="cx">           // First, run the referrer policy tests without passing a referrer in RequestInit.
</span><span class="cx">           return run_referrer_policy_tests(frame, undefined, frame.contentDocument.location.href,
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventwithinswhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html        2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -28,12 +28,12 @@
</span><span class="cx"> 
</span><span class="cx">   const iframe = await registerSwAndOpenFrame(t);
</span><span class="cx">   const fetchText =
</span><del>-      await iframe.contentWindow.fetch('dummy.txt').then(r => r.text());
</del><ins>+      await iframe.contentWindow.fetch('sample.txt').then(r => r.text());
</ins><span class="cx"> 
</span><span class="cx">   const cache = await iframe.contentWindow.caches.open('test');
</span><del>-  await cache.add('dummy.txt');
</del><ins>+  await cache.add('sample.txt');
</ins><span class="cx"> 
</span><del>-  const response = await cache.match('dummy.txt');
</del><ins>+  const response = await cache.match('sample.txt');
</ins><span class="cx">   const cacheText = await (response ? response.text() : 'cache match failed');
</span><span class="cx">   assert_equals(fetchText, 'intercepted', 'fetch intercepted');
</span><span class="cx">   assert_equals(cacheText, 'intercepted', 'cache.add intercepted');
</span><span class="lines">@@ -42,8 +42,8 @@
</span><span class="cx"> promise_test(async t => {
</span><span class="cx">   const iframe = await registerSwAndOpenFrame(t);
</span><span class="cx">   const [fetchText, cacheText] = await Promise.all([
</span><del>-    iframe.contentWindow.fetch('dummy.txt-inner-fetch').then(r => r.text()),
-    iframe.contentWindow.fetch('dummy.txt-inner-cache').then(r => r.text())
</del><ins>+    iframe.contentWindow.fetch('sample.txt-inner-fetch').then(r => r.text()),
+    iframe.contentWindow.fetch('sample.txt-inner-cache').then(r => r.text())
</ins><span class="cx">   ]);
</span><span class="cx">   assert_equals(fetchText, 'Hello world\n', 'fetch within SW not intercepted');
</span><span class="cx">   assert_equals(cacheText, 'Hello world\n',
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event.https-expected.txt  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event.https-expected.txt     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -21,6 +21,16 @@
</span><span class="cx"> PASS FetchEvent#body is a string
</span><span class="cx"> FAIL FetchEvent#body is a ReadableStream promise_test: Unhandled rejection with value: object "NotSupportedError: ReadableStream uploading is not supported"
</span><span class="cx"> PASS FetchEvent#body is a string and is passed to network fallback
</span><ins>+FAIL FetchEvent#body is a ReadableStream and is passed to network fallback promise_test: Unhandled rejection with value: object "NotSupportedError: ReadableStream uploading is not supported"
+FAIL FetchEvent#body is a none Uint8Array ReadableStream and is passed to a service worker promise_rejects_js: function "function () { throw e }" threw object "NotSupportedError: ReadableStream uploading is not supported" ("NotSupportedError") expected instance of function "function TypeError() {
+    [native code]
+}" ("TypeError")
+PASS FetchEvent#body is a string, used and passed to network fallback
+FAIL FetchEvent#body is a ReadableStream, used and passed to network fallback promise_rejects_js: function "function () { throw e }" threw object "NotSupportedError: ReadableStream uploading is not supported" ("NotSupportedError") expected instance of function "function TypeError() {
+    [native code]
+}" ("TypeError")
+PASS FetchEvent#body is a string, cloned and passed to network fallback
+PASS FetchEvent#body is a ReadableStream, cloned and passed to network fallback
</ins><span class="cx"> PASS FetchEvent#body is a blob
</span><span class="cx"> PASS FetchEvent#body is a blob and is passed to network fallback
</span><span class="cx"> PASS Service Worker responds to fetch event with the correct keepalive value
</span><span class="lines">@@ -35,5 +45,8 @@
</span><span class="cx"> FAIL FetchEvent#request.isHistoryNavigation is true (with history.go(-2)) assert_equals: expected "method = GET, isHistoryNavigation = false" but got "method = GET, isHistoryNavigation = undefined"
</span><span class="cx"> FAIL FetchEvent#request.isHistoryNavigation is true (with history.go(2)) assert_equals: expected "method = GET, isHistoryNavigation = false" but got "method = GET, isHistoryNavigation = undefined"
</span><span class="cx"> FAIL FetchEvent#request.isHistoryNavigation is true (POST + history.go(-1)) assert_equals: expected "method = GET, isHistoryNavigation = false" but got "method = GET, isHistoryNavigation = undefined"
</span><ins>+PASS XHR upload progress events for response coming from SW
+PASS XHR upload progress events for network fallback
+PASS Fetch with POST with text on sw 421 response should not be retried.
</ins><span class="cx"> PASS restore global state
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetcheventhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event.https.html  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event.https.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -17,6 +17,8 @@
</span><span class="cx">     const registration =
</span><span class="cx">         await service_worker_unregister_and_register(t, worker, scope);
</span><span class="cx">     await wait_for_state(t, registration.installing, 'activated');
</span><ins>+
+    // This will happen after all other tests
</ins><span class="cx">     promise_test(t => {
</span><span class="cx">         return registration.unregister();
</span><span class="cx">       }, 'restore global state');
</span><span class="lines">@@ -480,6 +482,164 @@
</span><span class="cx">         });
</span><span class="cx">   }, 'FetchEvent#body is a string and is passed to network fallback');
</span><span class="cx"> 
</span><ins>+// Test that the request body is sent to network upon network fallback,
+// for a ReadableStream body.
+promise_test(async t => {
+    const rs = new ReadableStream({start(c) {
+      c.enqueue('i a');
+      c.enqueue('m the request');
+      t.step_timeout(t.step_func(() => {
+        c.enqueue(' body');
+        c.close();
+      }, 10));
+    }});
+    // Set page_url to "?ignore" so the service worker falls back to network
+    // for the main resource request, and add a suffix to avoid colliding
+    // with other tests.
+    const page_url = 'resources/?ignore-for-request-body-fallback-string';
+    const frame = await with_iframe(page_url);
+    t.add_cleanup(() => { frame.remove(); });
+    // Add "?ignore" so the service worker falls back to echo-content.py.
+    const echo_url = '/fetch/api/resources/echo-content.py?ignore';
+    const response = await frame.contentWindow.fetch(echo_url, {
+        method: 'POST',
+        body: rs.pipeThrough(new TextEncoderStream())
+    });
+    const text = await response.text();
+    assert_equals(text,
+        'i am the request body',
+        'the network fallback request should include the request body');
+  }, 'FetchEvent#body is a ReadableStream and is passed to network fallback');
+
+  // Test that the request body is sent to network upon network fallback,
+// for a ReadableStream body.
+promise_test(async t => {
+    const rs = new ReadableStream({start(c) {
+      c.enqueue('i a');
+      c.enqueue('m the request');
+      t.step_timeout(t.step_func(() => {
+        c.enqueue(' body');
+        c.close();
+      }, 10));
+    }});
+    // Set page_url to "?ignore" so the service worker falls back to network
+    // for the main resource request, and add a suffix to avoid colliding
+    // with other tests.
+    const page_url = 'resources/?ignore-for-request-body-fallback-string';
+    const frame = await with_iframe(page_url);
+    t.add_cleanup(() => { frame.remove(); });
+    // Add "?ignore" so the service worker falls back to echo-content.py.
+    const echo_url = '/fetch/api/resources/echo-content.py?ignore';
+    const w = frame.contentWindow;
+    await promise_rejects_js(t, w.TypeError,  w.fetch(echo_url, {
+        method: 'POST',
+        body: rs
+    }));
+  }, 'FetchEvent#body is a none Uint8Array ReadableStream and is passed to a service worker');
+
+// Test that the request body is sent to network upon network fallback even when
+// the request body is used in the service worker, for a string body.
+promise_test(async t => {
+    // Set page_url to "?ignore" so the service worker falls back to network
+    // for the main resource request, and add a suffix to avoid colliding
+    // with other tests.
+    const page_url = 'resources/?ignore-for-request-body-fallback-string';
+
+    const frame = await with_iframe(page_url);
+    t.add_cleanup(() => { frame.remove(); });
+    // Add "?use-and-ignore" so the service worker falls back to echo-content.py.
+    const echo_url = '/fetch/api/resources/echo-content.py?use-and-ignore';
+    const response = await frame.contentWindow.fetch(echo_url, {
+        method: 'POST',
+        body: 'i am the request body'
+    });
+    const text = await response.text();
+    assert_equals(
+        text,
+        'i am the request body',
+        'the network fallback request should include the request body');
+  }, 'FetchEvent#body is a string, used and passed to network fallback');
+
+// When the streaming body is used in the service worker, network fallback
+// fails.
+promise_test(async t => {
+    const rs = new ReadableStream({start(c) {
+      c.enqueue('i a');
+      c.enqueue('m the request');
+      t.step_timeout(t.step_func(() => {
+        c.enqueue(' body');
+        c.close();
+      }, 10));
+    }});
+    // Set page_url to "?ignore" so the service worker falls back to network
+    // for the main resource request, and add a suffix to avoid colliding
+    // with other tests.
+    const page_url = 'resources/?ignore-for-request-body-fallback-string';
+    const frame = await with_iframe(page_url);
+    t.add_cleanup(() => { frame.remove(); });
+    const echo_url = '/fetch/api/resources/echo-content.py?use-and-ignore';
+    const w = frame.contentWindow;
+    await promise_rejects_js(t, w.TypeError, w.fetch(echo_url, {
+        method: 'POST',
+        body: rs.pipeThrough(new TextEncoderStream())
+    }));
+  }, 'FetchEvent#body is a ReadableStream, used and passed to network fallback');
+
+// Test that the request body is sent to network upon network fallback even when
+// the request body is used by clone() in the service worker, for a string body.
+promise_test(async t => {
+    // Set page_url to "?ignore" so the service worker falls back to network
+    // for the main resource request, and add a suffix to avoid colliding
+    // with other tests.
+    const page_url = 'resources/?ignore-for-request-body-fallback-string';
+
+    const frame = await with_iframe(page_url);
+    t.add_cleanup(() => { frame.remove(); });
+    // Add "?clone-and-ignore" so the service worker falls back to
+    // echo-content.py.
+    const echo_url = '/fetch/api/resources/echo-content.py?clone-and-ignore';
+    const response = await frame.contentWindow.fetch(echo_url, {
+        method: 'POST',
+        body: 'i am the request body'
+    });
+    const text = await response.text();
+    assert_equals(
+        text,
+        'i am the request body',
+        'the network fallback request should include the request body');
+  }, 'FetchEvent#body is a string, cloned and passed to network fallback');
+
+// When the streaming body is used by clone() in the service worker, network
+// fallback fails.
+promise_test(async t => {
+    const rs = new ReadableStream({start(c) {
+      c.enqueue('i a');
+      c.enqueue('m the request');
+      t.step_timeout(t.step_func(() => {
+        c.enqueue(' body');
+        c.close();
+      }, 10));
+    }});
+    // Set page_url to "?ignore" so the service worker falls back to network
+    // for the main resource request, and add a suffix to avoid colliding
+    // with other tests.
+    const page_url = 'resources/?ignore-for-request-body-fallback-string';
+    const frame = await with_iframe(page_url);
+    t.add_cleanup(() => { frame.remove(); });
+    // Add "?clone-and-ignore" so the service worker falls back to
+    // echo-content.py.
+    const echo_url = '/fetch/api/resources/echo-content.py?clone-and-ignore';
+    const response = await frame.contentWindow.fetch(echo_url, {
+        method: 'POST',
+        body: 'i am the request body'
+    });
+    const text = await response.text();
+    assert_equals(
+        text,
+        'i am the request body',
+        'the network fallback request should include the request body');
+  }, 'FetchEvent#body is a ReadableStream, cloned and passed to network fallback');
+
</ins><span class="cx"> // Test that the service worker can read FetchEvent#body when it is a blob.
</span><span class="cx"> // It responds with request body it read.
</span><span class="cx"> promise_test(t => {
</span><span class="lines">@@ -851,5 +1011,74 @@
</span><span class="cx">     assert_equals(frame.contentDocument.body.textContent,
</span><span class="cx">                   'method = POST, isHistoryNavigation = true');
</span><span class="cx">   }, 'FetchEvent#request.isHistoryNavigation is true (POST + history.go(-1))');
</span><ins>+
+// When service worker responds with a Response, no XHR upload progress
+// events are delivered.
+promise_test(async t => {
+    const page_url = 'resources/simple.html?ignore-for-request-body-string';
+    const frame = await with_iframe(page_url);
+    t.add_cleanup(() => { frame.remove(); });
+
+    const xhr = new frame.contentWindow.XMLHttpRequest();
+    xhr.open('POST', 'simple.html?request-body');
+    xhr.upload.addEventListener('progress', t.unreached_func('progress'));
+    xhr.upload.addEventListener('error', t.unreached_func('error'));
+    xhr.upload.addEventListener('abort', t.unreached_func('abort'));
+    xhr.upload.addEventListener('timeout', t.unreached_func('timeout'));
+    xhr.upload.addEventListener('load', t.unreached_func('load'));
+    xhr.upload.addEventListener('loadend', t.unreached_func('loadend'));
+    xhr.send('i am the request body');
+
+    await new Promise((resolve) => xhr.addEventListener('load', resolve));
+  }, 'XHR upload progress events for response coming from SW');
+
+// Upload progress events should be delivered for the network fallback case.
+promise_test(async t => {
+    const page_url = 'resources/simple.html?ignore-for-request-body-string';
+    const frame = await with_iframe(page_url);
+    t.add_cleanup(() => { frame.remove(); });
+
+    let progress = false;
+    let load = false;
+    let loadend = false;
+
+    const xhr = new frame.contentWindow.XMLHttpRequest();
+    xhr.open('POST', '/fetch/api/resources/echo-content.py?ignore');
+    xhr.upload.addEventListener('progress', () => progress = true);
+    xhr.upload.addEventListener('error', t.unreached_func('error'));
+    xhr.upload.addEventListener('abort', t.unreached_func('abort'));
+    xhr.upload.addEventListener('timeout', t.unreached_func('timeout'));
+    xhr.upload.addEventListener('load', () => load = true);
+    xhr.upload.addEventListener('loadend', () => loadend = true);
+    xhr.send('i am the request body');
+
+    await new Promise((resolve) => xhr.addEventListener('load', resolve));
+    assert_true(progress, 'progress');
+    assert_true(load, 'load');
+    assert_true(loadend, 'loadend');
+  }, 'XHR upload progress events for network fallback');
+
+promise_test(async t => {
+    // Set page_url to "?ignore" so the service worker falls back to network
+    // for the main resource request, and add a suffix to avoid colliding
+    // with other tests.
+    const page_url = 'resources/?ignore-for-request-body-fallback-string';
+
+    const frame = await with_iframe(page_url);
+    t.add_cleanup(() => { frame.remove(); });
+    // Add "?clone-and-ignore" so the service worker falls back to
+    // echo-content.py.
+    const echo_url = '/fetch/api/resources/echo-content.py?status=421';
+    const response = await frame.contentWindow.fetch(echo_url, {
+        method: 'POST',
+        body: 'text body'
+    });
+    assert_equals(response.status, 421);
+    const text = await response.text();
+    assert_equals(
+        text,
+        'text body. Request was sent 1 times.',
+        'the network fallback request should include the request body');
+  }, 'Fetch with POST with text on sw 421 response should not be retried.');
</ins><span class="cx"> </script>
</span><span class="cx"> </body>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestcssbaseurlhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-base-url.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-base-url.https.html   2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-base-url.https.html      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -70,13 +70,13 @@
</span><span class="cx"> 
</span><span class="cx"> base_url_test({
</span><span class="cx">   framePath: SCOPE + '?fetch',
</span><del>-  expectImageRequestPath: 'resources/dummy.png',
</del><ins>+  expectImageRequestPath: 'resources/sample.png',
</ins><span class="cx">   expectImageRequestReferrer: `resources/${cssFile}?fetch`,
</span><span class="cx">   description: 'base URL when service worker does respondWith(fetch(responseUrl)).'});
</span><span class="cx"> 
</span><span class="cx"> base_url_test({
</span><span class="cx">   framePath: SCOPE + '?newResponse',
</span><del>-  expectImageRequestPath: 'resources/request-url-path/dummy.png',
</del><ins>+  expectImageRequestPath: 'resources/request-url-path/sample.png',
</ins><span class="cx">   expectImageRequestReferrer: `resources/request-url-path/${cssFile}?newResponse`,
</span><span class="cx">   description: 'base URL when service worker does respondWith(new Response()).'});
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestcssimageshttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-images.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-images.https.html     2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-images.https.html        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -9,9 +9,9 @@
</span><span class="cx"> var SCRIPT = 'resources/fetch-request-resources-worker.js';
</span><span class="cx"> var host_info = get_host_info();
</span><span class="cx"> var LOCAL_URL =
</span><del>-  host_info['HTTPS_ORIGIN'] + base_path() + 'resources/dummy?test';
</del><ins>+  host_info['HTTPS_ORIGIN'] + base_path() + 'resources/sample?test';
</ins><span class="cx"> var REMOTE_URL =
</span><del>-  host_info['HTTPS_REMOTE_ORIGIN'] + base_path() + 'resources/dummy?test';
</del><ins>+  host_info['HTTPS_REMOTE_ORIGIN'] + base_path() + 'resources/sample?test';
</ins><span class="cx"> 
</span><span class="cx"> function css_image_test(expected_results, frame, url, type,
</span><span class="cx">                         expected_mode, expected_credentials) {
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestredirecthttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-redirect.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-redirect.https.html       2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-redirect.https.html  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx">     var IMAGE_URL = base_path() + 'resources/square.png';
</span><span class="cx">     var AUDIO_URL = getAudioURI("/media/sound_5");
</span><span class="cx">     var XHR_URL = base_path() + 'resources/simple.txt';
</span><del>-    var HTML_URL = base_path() + 'resources/dummy.html';
</del><ins>+    var HTML_URL = base_path() + 'resources/sample.html';
</ins><span class="cx"> 
</span><span class="cx">     var REDIRECT_TO_IMAGE_URL = REDIRECT_URL + encodeURIComponent(IMAGE_URL);
</span><span class="cx">     var REDIRECT_TO_AUDIO_URL = REDIRECT_URL + encodeURIComponent(AUDIO_URL);
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestresourceshttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-resources.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-resources.https-expected.txt      2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-resources.https-expected.txt 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,65 +1,65 @@
</span><span class="cx"> 
</span><span class="cx"> PASS Verify FetchEvent for resources.
</span><del>-PASS Image load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test1 cross_origin:)
-PASS Image load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test2 cross_origin:)
-PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test3 cross_origin:)
-PASS CSS load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test4 cross_origin:)
-PASS Image load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test5 cross_origin:anonymous)
-PASS Image load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test6 cross_origin:use-credentials)
-PASS Image load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test7 cross_origin:)
-PASS Image load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test8 cross_origin:anonymous)
-PASS Image load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test9 cross_origin:use-credentials)
-PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test10 cross_origin:)
-PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test11 cross_origin:anonymous)
-PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test12 cross_origin:use-credentials)
-PASS Script load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test13 cross_origin:)
-PASS Script load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test14 cross_origin:anonymous)
-PASS Script load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test15 cross_origin:use-credentials)
-PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test16 cross_origin:)
-PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test17 cross_origin:anonymous)
-PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test18 cross_origin:use-credentials)
-PASS CSS load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test19 cross_origin:)
-PASS CSS load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test20 cross_origin:anonymous)
-PASS CSS load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test21 cross_origin:use-credentials)
-FAIL FontFace load (url: https://localhost:9443/service-workers/service-worker/resources/dummy?test22) assert_equals: mode of must be cors. expected "cors" but got "no-cors"
-FAIL FontFace load (url: https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test23) assert_equals: mode of must be cors. expected "cors" but got "no-cors"
-PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test24)
-PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test25)
-PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test26)
-PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test27)
-PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test28)
-PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test29)
-PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test30)
-PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test31)
-PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test32)
-PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test33)
-PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test34)
-PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test35)
-FAIL fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test36 mode:same-origin credentials:omit) assert_equals: destination of fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test36 mode:same-origin credentials:omit) must be empty. expected "empty" but got ""
-FAIL fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test37 mode:same-origin credentials:same-origin) assert_equals: destination of fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test37 mode:same-origin credentials:same-origin) must be empty. expected "empty" but got ""
-FAIL fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test38 mode:same-origin credentials:include) assert_equals: destination of fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test38 mode:same-origin credentials:include) must be empty. expected "empty" but got ""
-FAIL fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test39 mode:no-cors credentials:omit) assert_equals: destination of fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test39 mode:no-cors credentials:omit) must be empty. expected "empty" but got ""
-FAIL fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test40 mode:no-cors credentials:same-origin) assert_equals: destination of fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test40 mode:no-cors credentials:same-origin) must be empty. expected "empty" but got ""
-FAIL fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test41 mode:no-cors credentials:include) assert_equals: destination of fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test41 mode:no-cors credentials:include) must be empty. expected "empty" but got ""
-FAIL fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test42 mode:cors credentials:omit) assert_equals: destination of fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test42 mode:cors credentials:omit) must be empty. expected "empty" but got ""
-FAIL fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test43 mode:cors credentials:same-origin) assert_equals: destination of fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test43 mode:cors credentials:same-origin) must be empty. expected "empty" but got ""
-FAIL fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test44 mode:cors credentials:include) assert_equals: destination of fetch (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test44 mode:cors credentials:include) must be empty. expected "empty" but got ""
-FAIL fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test45 mode:no-cors credentials:omit) assert_equals: destination of fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test45 mode:no-cors credentials:omit) must be empty. expected "empty" but got ""
-FAIL fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test46 mode:no-cors credentials:same-origin) assert_equals: destination of fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test46 mode:no-cors credentials:same-origin) must be empty. expected "empty" but got ""
-FAIL fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test47 mode:no-cors credentials:include) assert_equals: destination of fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test47 mode:no-cors credentials:include) must be empty. expected "empty" but got ""
-FAIL fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test48 mode:cors credentials:omit) assert_equals: destination of fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test48 mode:cors credentials:omit) must be empty. expected "empty" but got ""
-FAIL fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test49 mode:cors credentials:same-origin) assert_equals: destination of fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test49 mode:cors credentials:same-origin) must be empty. expected "empty" but got ""
-FAIL fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test50 mode:cors credentials:include) assert_equals: destination of fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test50 mode:cors credentials:include) must be empty. expected "empty" but got ""
-PASS Audio load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test51 cross_origin:)
-PASS Audio load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test52 cross_origin:anonymous)
-PASS Audio load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test53 cross_origin:use-credentials)
-PASS Audio load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test54 cross_origin:)
-PASS Audio load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test55 cross_origin:anonymous)
-PASS Audio load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test56 cross_origin:use-credentials)
-PASS Video load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test57 cross_origin:)
-PASS Video load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test58 cross_origin:anonymous)
-PASS Video load (url:https://localhost:9443/service-workers/service-worker/resources/dummy?test59 cross_origin:use-credentials)
-PASS Video load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test60 cross_origin:)
-PASS Video load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test61 cross_origin:anonymous)
-PASS Video load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/dummy?test62 cross_origin:use-credentials)
</del><ins>+PASS Image load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test1 cross_origin:)
+PASS Image load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test2 cross_origin:)
+PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test3 cross_origin:)
+PASS CSS load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test4 cross_origin:)
+PASS Image load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test5 cross_origin:anonymous)
+PASS Image load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test6 cross_origin:use-credentials)
+PASS Image load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test7 cross_origin:)
+PASS Image load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test8 cross_origin:anonymous)
+PASS Image load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test9 cross_origin:use-credentials)
+PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test10 cross_origin:)
+PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test11 cross_origin:anonymous)
+PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test12 cross_origin:use-credentials)
+PASS Script load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test13 cross_origin:)
+PASS Script load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test14 cross_origin:anonymous)
+PASS Script load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test15 cross_origin:use-credentials)
+PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test16 cross_origin:)
+PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test17 cross_origin:anonymous)
+PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test18 cross_origin:use-credentials)
+PASS CSS load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test19 cross_origin:)
+PASS CSS load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test20 cross_origin:anonymous)
+PASS CSS load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test21 cross_origin:use-credentials)
+FAIL FontFace load (url: https://localhost:9443/service-workers/service-worker/resources/sample?test22) assert_equals: mode of must be cors. expected "cors" but got "no-cors"
+FAIL FontFace load (url: https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test23) assert_equals: mode of must be cors. expected "cors" but got "no-cors"
+PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test24)
+PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test25)
+PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test26)
+PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test27)
+PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test28)
+PASS Script load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test29)
+PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test30)
+PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test31)
+PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test32)
+PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test33)
+PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test34)
+PASS CSS load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test35)
+PASS fetch (url:https://localhost:9443/service-workers/service-worker/resources/sample?test36 mode:same-origin credentials:omit)
+PASS fetch (url:https://localhost:9443/service-workers/service-worker/resources/sample?test37 mode:same-origin credentials:same-origin)
+PASS fetch (url:https://localhost:9443/service-workers/service-worker/resources/sample?test38 mode:same-origin credentials:include)
+PASS fetch (url:https://localhost:9443/service-workers/service-worker/resources/sample?test39 mode:no-cors credentials:omit)
+PASS fetch (url:https://localhost:9443/service-workers/service-worker/resources/sample?test40 mode:no-cors credentials:same-origin)
+PASS fetch (url:https://localhost:9443/service-workers/service-worker/resources/sample?test41 mode:no-cors credentials:include)
+PASS fetch (url:https://localhost:9443/service-workers/service-worker/resources/sample?test42 mode:cors credentials:omit)
+PASS fetch (url:https://localhost:9443/service-workers/service-worker/resources/sample?test43 mode:cors credentials:same-origin)
+PASS fetch (url:https://localhost:9443/service-workers/service-worker/resources/sample?test44 mode:cors credentials:include)
+PASS fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test45 mode:no-cors credentials:omit)
+PASS fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test46 mode:no-cors credentials:same-origin)
+PASS fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test47 mode:no-cors credentials:include)
+PASS fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test48 mode:cors credentials:omit)
+PASS fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test49 mode:cors credentials:same-origin)
+PASS fetch (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test50 mode:cors credentials:include)
+PASS Audio load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test51 cross_origin:)
+PASS Audio load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test52 cross_origin:anonymous)
+PASS Audio load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test53 cross_origin:use-credentials)
+PASS Audio load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test54 cross_origin:)
+PASS Audio load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test55 cross_origin:anonymous)
+PASS Audio load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test56 cross_origin:use-credentials)
+PASS Video load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test57 cross_origin:)
+PASS Video load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test58 cross_origin:anonymous)
+PASS Video load (url:https://localhost:9443/service-workers/service-worker/resources/sample?test59 cross_origin:use-credentials)
+PASS Video load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test60 cross_origin:)
+PASS Video load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test61 cross_origin:anonymous)
+PASS Video load (url:https://127.0.0.1:9443/service-workers/service-worker/resources/sample?test62 cross_origin:use-credentials)
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestresourceshttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-resources.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-resources.https.html      2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-resources.https.html 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">       credentials: expected_credentials,
</span><span class="cx">       redirect: 'follow',
</span><span class="cx">       integrity: '',
</span><del>-      destination: 'empty',
</del><ins>+      destination: '',
</ins><span class="cx">       message: `fetch (url:${actual_url} mode:${mode} ` +
</span><span class="cx">                `credentials:${credentials})`
</span><span class="cx">     };
</span><span class="lines">@@ -162,9 +162,9 @@
</span><span class="cx">   const SCRIPT = 'resources/fetch-request-resources-worker.js';
</span><span class="cx">   const host_info = get_host_info();
</span><span class="cx">   const LOCAL_URL =
</span><del>-      host_info['HTTPS_ORIGIN'] + base_path() + 'resources/dummy?test';
</del><ins>+      host_info['HTTPS_ORIGIN'] + base_path() + 'resources/sample?test';
</ins><span class="cx">   const REMOTE_URL =
</span><del>-      host_info['HTTPS_REMOTE_ORIGIN'] + base_path() + 'resources/dummy?test';
</del><ins>+      host_info['HTTPS_REMOTE_ORIGIN'] + base_path() + 'resources/sample?test';
</ins><span class="cx"> 
</span><span class="cx">   const registration =
</span><span class="cx">       await service_worker_unregister_and_register(t, SCRIPT, SCOPE);
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestxhrsyncerrorhttpswindowexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-error.https.window-expected.txt (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-error.https.window-expected.txt                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-error.https.window-expected.txt     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+FAIL Verify synchronous XMLHttpRequest always throws a NetworkError for ReadableStream errors assert_throws_dom: function "() => frame.contentWindow.performSyncXHR("non-existent-stream-1.txt")" did not throw
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestxhrsyncerrorhttpswindowhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-error.https.window.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-error.https.window.html                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-error.https.window.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+<!-- This file is required for WebKit test infrastructure to run the templated test -->
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerfetchrequestxhrsyncerrorhttpswindowjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-error.https.window.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-error.https.window.js                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-error.https.window.js       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+// META: script=resources/test-helpers.sub.js
+
+"use strict";
+
+promise_test(async t => {
+  const url = "resources/fetch-request-xhr-sync-error-worker.js";
+  const scope = "resources/fetch-request-xhr-sync-iframe.html";
+
+  const registration = await service_worker_unregister_and_register(t, url, scope);
+  t.add_cleanup(() => registration.unregister());
+
+  await wait_for_state(t, registration.installing, 'activated');
+  const frame = await with_iframe(scope);
+  t.add_cleanup(() => frame.remove());
+
+  assert_throws_dom("NetworkError", frame.contentWindow.DOMException, () => frame.contentWindow.performSyncXHR("non-existent-stream-1.txt"));
+  assert_throws_dom("NetworkError", frame.contentWindow.DOMException, () => frame.contentWindow.performSyncXHR("non-existent-stream-2.txt"));
+  assert_throws_dom("NetworkError", frame.contentWindow.DOMException, () => frame.contentWindow.performSyncXHR("non-existent-stream-3.txt"));
+}, "Verify synchronous XMLHttpRequest always throws a NetworkError for ReadableStream errors");
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerhistoricalhttpsanyjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/historical.https.any.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/historical.https.any.js                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/historical.https.any.js    2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+// META: global=serviceworker
+
+test((t) => {
+  assert_false('targetClientId' in FetchEvent.prototype)
+}, 'targetClientId should not be on FetchEvent');
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerhistoricalhttpsanyserviceworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/historical.https.any.serviceworker-expected.txt (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/historical.https.any.serviceworker-expected.txt                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/historical.https.any.serviceworker-expected.txt    2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+FAIL targetClientId should not be on FetchEvent assert_false: expected false got true
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerhistoricalhttpsanyserviceworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/historical.https.any.serviceworker.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/historical.https.any.serviceworker.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/historical.https.any.serviceworker.html    2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+<!-- This file is required for WebKit test infrastructure to run the templated test -->
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerimportmodulescriptshttpsexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-module-scripts.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-module-scripts.https-expected.txt        2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-module-scripts.https-expected.txt   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,9 +0,0 @@
</span><del>-
-PASS Static import.
-PASS Nested static import.
-FAIL Static import and then dynamic import. assert_array_equals: value is "Failed to do dynamic import: TypeError: Dynamic-import is not available in Worklets or ServiceWorkers", expected array
-FAIL Dynamic import. assert_array_equals: value is "Failed to do dynamic import: TypeError: Dynamic-import is not available in Worklets or ServiceWorkers", expected array
-FAIL Nested dynamic import. assert_array_equals: value is "Failed to do dynamic import: TypeError: Dynamic-import is not available in Worklets or ServiceWorkers", expected array
-FAIL Dynamic import and then static import. assert_array_equals: value is "Failed to do dynamic import: TypeError: Dynamic-import is not available in Worklets or ServiceWorkers", expected array
-FAIL eval(import()). assert_array_equals: value is "Failed to do dynamic import: TypeError: Dynamic-import is not available in Worklets or ServiceWorkers", expected array
-
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerimportmodulescriptshttpshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-module-scripts.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-module-scripts.https.html        2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-module-scripts.https.html   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,29 +0,0 @@
</span><del>-<!DOCTYPE html>
-<meta charset="utf-8">
-<title>Tests for module import: ServiceWorker</title>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="resources/test-helpers.sub.js"></script>
-<script src="/workers/modules/resources/import-test-cases.js"></script>
-<body>
-<script>
-function import_test(testCase) {
-  promise_test(async t => {
-    const msgPromise = new Promise(resolve => {
-      navigator.serviceWorker.onmessage = resolve;
-    });
-    await service_worker_unregister(t, testCase.scriptURL);
-    t.add_cleanup(() => service_worker_unregister(t, testCase.scriptURL));
-    const registration = await navigator.serviceWorker.register(
-      testCase.scriptURL,
-      { scope: testCase.scriptURL, type: 'module' });
-    registration.installing.postMessage(
-      'Send message for tests from main script.');
-    const msgEvent = await msgPromise;
-    assert_array_equals(msgEvent.data, testCase.expectation);
-  }, testCase.description);
-}
-
-testCases.forEach(import_test);
-</script>
-</body>
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerimportscriptscrossoriginhttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-cross-origin.https-expected.txt (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-cross-origin.https-expected.txt                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-cross-origin.https-expected.txt     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+FAIL importScripts() supports cross-origin requests promise_test: Unhandled rejection with value: object "TypeError: NetworkError: A server with the specified hostname could not be found."
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerimportscriptscrossoriginhttpshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-cross-origin.https.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-cross-origin.https.html                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-cross-origin.https.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Tests for importScripts: cross-origin</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<body>
+<script>
+promise_test(async t => {
+    const scope = 'resources/import-scripts-cross-origin';
+    await service_worker_unregister(t, scope);
+    let reg = await navigator.serviceWorker.register(
+      'resources/import-scripts-cross-origin-worker.sub.js', { scope: scope });
+    t.add_cleanup(_ => reg.unregister());
+    assert_not_equals(reg.installing, null, 'worker is installing');
+  }, 'importScripts() supports cross-origin requests');
+</script>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernavigationpreloadresourceschunkedencodingscopepy"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-preload/resources/chunked-encoding-scope.py (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-preload/resources/chunked-encoding-scope.py  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-preload/resources/chunked-encoding-scope.py     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -14,7 +14,6 @@
</span><span class="cx">             response.writer.write(u"%s\n%s\n" % (len(str(idx)), idx))
</span><span class="cx">         else:
</span><span class="cx">             response.writer.write(u"%s\r\n%s\r\n" % (len(str(idx)), idx))
</span><del>-        response.writer.flush()
</del><span class="cx">         time.sleep(0.001)
</span><span class="cx"> 
</span><span class="cx">     response.writer.write(u"0\r\n\r\n")
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernavigationredirectresolutionhttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect-resolution.https-expected.txt (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect-resolution.https-expected.txt                               (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect-resolution.https-expected.txt  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+
+PASS test relative opaqueredirect
+PASS test relative opaqueredirect with CacheStorage
+PASS test relative opaqueredirect with clone
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernavigationredirectresolutionhttpshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect-resolution.https.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect-resolution.https.html                               (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect-resolution.https.html  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+<!DOCTYPE html>
+<title>Service Worker: Navigation Redirect Resolution</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<body>
+<script>
+
+function make_absolute(url) {
+  return new URL(url, location).toString();
+}
+
+const script = 'resources/fetch-rewrite-worker.js';
+
+function redirect_result_test(scope, expected_url, description) {
+  promise_test(async t => {
+    const registration = await service_worker_unregister_and_register(
+          t, script, scope);
+      t.add_cleanup(() => {
+        return service_worker_unregister(t, scope);
+      })
+      await wait_for_state(t, registration.installing, 'activated');
+
+      // The navigation to |scope| will be resolved by a fetch to |redirect_url|
+      // which returns a relative Location header. If it is resolved relative to
+      // |scope|, the result will be navigate-redirect-resolution/blank.html. If
+      // relative to |redirect_url|, it will be resources/blank.html. The latter
+      // is correct.
+      const iframe = await with_iframe(scope);
+      t.add_cleanup(() => { iframe.remove(); });
+      assert_equals(iframe.contentWindow.location.href,
+                    make_absolute(expected_url));
+  }, description);
+}
+
+// |redirect_url| serves a relative redirect to resources/blank.html.
+const redirect_url = 'resources/redirect.py?Redirect=blank.html';
+
+// |scope_base| does not exist but will be replaced with a fetch of
+// |redirect_url| by fetch-rewrite-worker.js.
+const scope_base = 'resources/subdir/navigation-redirect-resolution?' +
+    'redirect-mode=manual&url=' +
+    encodeURIComponent(make_absolute(redirect_url));
+
+// When the Service Worker forwards the result of |redirect_url| as an
+// opaqueredirect response, the redirect uses the response's URL list as the
+// base URL, not the request.
+redirect_result_test(scope_base, 'resources/blank.html',
+                     'test relative opaqueredirect');
+
+// The response's base URL should be preserved across CacheStorage and clone.
+redirect_result_test(scope_base + '&cache=1', 'resources/blank.html',
+                     'test relative opaqueredirect with CacheStorage');
+redirect_result_test(scope_base + '&clone=1', 'resources/blank.html',
+                     'test relative opaqueredirect with clone');
+
+</script>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernavigationtiminghttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-timing.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-timing.https-expected.txt    2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-timing.https-expected.txt       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> 
</span><del>-FAIL Service worker controlled navigation timing assert_unreached: unexpected rejection: assert_greater_than: expected a number greater than 0 but got 0 Reached unreachable code
</del><ins>+FAIL Service worker controlled navigation timing assert_greater_than: expected a number greater than 0 but got 0
</ins><span class="cx"> PASS Service worker controlled navigation timing network fallback
</span><span class="cx"> PASS Service worker controlled navigation timing redirect
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernavigationtiminghttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-timing.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-timing.https.html    2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-timing.https.html       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -32,81 +32,45 @@
</span><span class="cx"> 
</span><span class="cx"> const worker_url = 'resources/navigation-timing-worker.js';
</span><span class="cx"> 
</span><del>-promise_test(t => {
</del><ins>+promise_test(async (t) => {
</ins><span class="cx">     const scope = 'resources/empty.html';
</span><del>-    let frame;
</del><ins>+    const registration = await service_worker_unregister_and_register(t, worker_url, scope);
+    t.add_cleanup(() => registration.unregister());
+    await wait_for_state(t, registration.installing, 'activated');
+    const frame = await with_iframe(scope);
+    t.add_cleanup(() => frame.remove());
</ins><span class="cx"> 
</span><del>-    return service_worker_unregister_and_register(t, worker_url, scope)
-      .then(r => {
-        return wait_for_state(t, r.installing, 'activated');
-      })
-      .then(() => with_iframe(scope))
-      .then(f => {
-        frame = f;
-        return navigate_in_frame(frame, 'resources/empty.html');
-      })
-      .then(timing => {
-        assert_greater_than(timing.workerStart, 0);
-        verify(timing);
-      })
-      .catch(unreached_rejection(t))
-      .then(() => {
-        if (frame)
-            frame.remove();
-        return service_worker_unregister(t, scope);
-      });
</del><ins>+    const timing = await navigate_in_frame(frame, scope);
+    assert_greater_than(timing.workerStart, 0);
+    verify(timing);
</ins><span class="cx"> }, 'Service worker controlled navigation timing');
</span><span class="cx"> 
</span><del>-promise_test(t => {
</del><ins>+promise_test(async (t) => {
</ins><span class="cx">     const scope = 'resources/empty.html?network-fallback';
</span><del>-    let frame;
</del><ins>+    const registration = await service_worker_unregister_and_register(t, worker_url, scope);
+    t.add_cleanup(() => registration.unregister());
+    await wait_for_state(t, registration.installing, 'activated');
+    const frame = await with_iframe(scope);
+    t.add_cleanup(() => frame.remove());
</ins><span class="cx"> 
</span><del>-    return service_worker_unregister_and_register(t, worker_url, scope)
-      .then(r => {
-        return wait_for_state(t, r.installing, 'activated');
-      })
-      .then(() => with_iframe(scope))
-      .then(f => {
-        frame = f;
-        return navigate_in_frame(frame, 'resources/empty.html?network-fallback');
-      })
-      .then(timing => {
-        verify(timing);
-      })
-      .catch(unreached_rejection(t))
-      .then(() => {
-        if (frame)
-            frame.remove();
-        return service_worker_unregister(t, scope);
-      });
</del><ins>+    const timing = await navigate_in_frame(frame, scope);
+    verify(timing);
</ins><span class="cx"> }, 'Service worker controlled navigation timing network fallback');
</span><span class="cx"> 
</span><del>-promise_test(t => {
</del><ins>+promise_test(async (t) => {
</ins><span class="cx">     const scope = 'resources/redirect.py?Redirect=empty.html';
</span><del>-    let frame;
</del><ins>+    const registration = await service_worker_unregister_and_register(t, worker_url, scope);
+    t.add_cleanup(() => registration.unregister());
+    await wait_for_state(t, registration.installing, 'activated');
+    const frame = await with_iframe(scope);
+    t.add_cleanup(() => frame.remove());
</ins><span class="cx"> 
</span><del>-    return service_worker_unregister_and_register(t, worker_url, scope)
-      .then(r => {
-        return wait_for_state(t, r.installing, 'activated');
-      })
-      .then(() => with_iframe(scope))
-      .then(f => {
-        frame = f;
-        return navigate_in_frame(frame, 'resources/redirect.py?Redirect=empty.html');
-      })
-      .then(timing => {
-        verify(timing);
-        // Additional checks for redirected navigation.
-        assert_true(timing.redirectStart <= timing.redirectEnd,
-            'Expected redirectStart <= redirectEnd');
-        assert_true(timing.redirectEnd <= timing.fetchStart,
-            'Expected redirectEnd <= fetchStart');
-      })
-      .catch(unreached_rejection(t))
-      .then(() => {
-        if (frame)
-            frame.remove();
-        return service_worker_unregister(t, scope);
-      });
</del><ins>+    const timing = await navigate_in_frame(frame, scope);
+    verify(timing);
+    // Additional checks for redirected navigation.
+    assert_true(timing.redirectStart <= timing.redirectEnd,
+        'Expected redirectStart <= redirectEnd');
+    assert_true(timing.redirectEnd <= timing.fetchStart,
+        'Expected redirectEnd <= fetchStart');
</ins><span class="cx"> }, 'Service worker controlled navigation timing redirect');
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernestedbloburlworkershttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/nested-blob-url-workers.https-expected.txt (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/nested-blob-url-workers.https-expected.txt                              (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/nested-blob-url-workers.https-expected.txt 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT Nested blob URL workers should be intercepted by a service worker. Test timed out
+NOTRUN Nested worker created from a blob URL worker should be intercepted by a service worker.
+NOTRUN Nested blob URL worker created from a worker should be intercepted by a service worker.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernestedbloburlworkershttpshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/nested-blob-url-workers.https.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/nested-blob-url-workers.https.html                              (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/nested-blob-url-workers.https.html 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+<!doctype html>
+<meta charset=utf-8>
+<title>Service Worker: nested blob URL worker clients</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<body>
+<script>
+
+const SCRIPT = 'resources/simple-intercept-worker.js';
+const SCOPE = 'resources/';
+const RESOURCE = 'resources/simple.txt';
+
+promise_test((t) => {
+  return runTest(t, 'resources/nested-blob-url-workers.html');
+}, 'Nested blob URL workers should be intercepted by a service worker.');
+
+promise_test((t) => {
+  return runTest(t, 'resources/nested-worker-created-from-blob-url-worker.html');
+}, 'Nested worker created from a blob URL worker should be intercepted by a service worker.');
+
+promise_test((t) => {
+  return runTest(t, 'resources/nested-blob-url-worker-created-from-worker.html');
+}, 'Nested blob URL worker created from a worker should be intercepted by a service worker.');
+
+async function runTest(t, iframe_url) {
+  const reg = await service_worker_unregister_and_register(t, SCRIPT, SCOPE);
+  t.add_cleanup(_ => reg.unregister());
+  await wait_for_state(t, reg.installing, 'activated');
+
+  const frame = await with_iframe(iframe_url);
+  t.add_cleanup(_ => frame.remove());
+  assert_not_equals(frame.contentWindow.navigator.serviceWorker.controller,
+                    null, 'frame should be controlled');
+
+  const response_text = await frame.contentWindow.fetch_in_worker(RESOURCE);
+  assert_equals(response_text, 'intercepted by service worker',
+                'fetch() should be intercepted.');
+}
+
+</script>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernodynamicimportanyjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/no-dynamic-import.any.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/no-dynamic-import.any.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/no-dynamic-import.any.js   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+// META: global=serviceworker
+
+importScripts('resources/no-dynamic-import.js');
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernodynamicimportanyserviceworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/no-dynamic-import.any.serviceworker-expected.txt (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/no-dynamic-import.any.serviceworker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/no-dynamic-import.any.serviceworker-expected.txt   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+
+PASS Module URL
+PASS Another module URL
+PASS Module data: URL
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkernodynamicimportanyserviceworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/no-dynamic-import.any.serviceworker.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/no-dynamic-import.any.serviceworker.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/no-dynamic-import.any.serviceworker.html   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+<!-- This file is required for WebKit test infrastructure to run the templated test -->
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerperformancetimelinehttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/performance-timeline.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/performance-timeline.https.html 2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/performance-timeline.https.html    2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -12,7 +12,7 @@
</span><span class="cx"> // is included in the Performance API's timing information.
</span><span class="cx"> promise_test(t => {
</span><span class="cx">   let script = 'resources/empty-but-slow-worker.js';
</span><del>-  let scope = 'resources/dummy.txt?slow-sw-timing';
</del><ins>+  let scope = 'resources/sample.txt?slow-sw-timing';
</ins><span class="cx">   let url = new URL(scope, window.location).href;
</span><span class="cx">   let slowURL = url + '&slow';
</span><span class="cx">   let frame;
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerredirectedresponsehttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/redirected-response.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/redirected-response.https-expected.txt  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/redirected-response.https-expected.txt     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -14,6 +14,12 @@
</span><span class="cx"> PASS mode: "follow", generated redirect response
</span><span class="cx"> PASS mode: "error", generated redirect response
</span><span class="cx"> PASS mode: "manual", generated redirect response
</span><ins>+PASS mode: "follow", manually-generated redirect response
+PASS mode: "error", manually-generated redirect response
+PASS mode: "manual", manually-generated redirect response
+PASS mode: "follow", generated relative redirect response
+PASS mode: "error", generated relative redirect response
+FAIL mode: "manual", generated relative redirect response promise_test: Unhandled rejection with value: object "TypeError: The URL can’t be shown"
</ins><span class="cx"> PASS Fetch should follow the redirect response 20 times
</span><span class="cx"> PASS Fetch should not follow the redirect response 21 times.
</span><span class="cx"> PASS The URL for the service worker redirected request should be propagated to response.
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerredirectedresponsehttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/redirected-response.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/redirected-response.https.html  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/redirected-response.https.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -267,7 +267,7 @@
</span><span class="cx"> promise_test(t => setup_and_clean()
</span><span class="cx">     .then(() => {
</span><span class="cx">       const url = host_info['HTTPS_ORIGIN'] + base_path() +
</span><del>-                  'dummy?url=' + encodeURIComponent(TARGET_URL) +
</del><ins>+                  'sample?url=' + encodeURIComponent(TARGET_URL) +
</ins><span class="cx">                   '&original-redirect-mode=follow&sw=gen';
</span><span class="cx">       return redirected_test({url: url,
</span><span class="cx">                               fetch_option: {redirect: 'follow'},
</span><span class="lines">@@ -281,7 +281,7 @@
</span><span class="cx"> promise_test(t => setup_and_clean()
</span><span class="cx">     .then(() => {
</span><span class="cx">       const url = host_info['HTTPS_ORIGIN'] + base_path() +
</span><del>-                  'dummy?url=' + encodeURIComponent(TARGET_URL) +
</del><ins>+                  'sample?url=' + encodeURIComponent(TARGET_URL) +
</ins><span class="cx">                   '&original-redirect-mode=error&sw=gen';
</span><span class="cx">       return promise_rejects_js(
</span><span class="cx">           t, frame.contentWindow.TypeError,
</span><span class="lines">@@ -296,8 +296,8 @@
</span><span class="cx"> promise_test(t => setup_and_clean()
</span><span class="cx">     .then(() => {
</span><span class="cx">       const url = host_info['HTTPS_ORIGIN'] + base_path() +
</span><del>-                  'dummy?url=' + encodeURIComponent(TARGET_URL) +
-                  '&original-redirect-mode=follow&sw=gen';
</del><ins>+                  'sample?url=' + encodeURIComponent(TARGET_URL) +
+                  '&original-redirect-mode=manual&sw=gen';
</ins><span class="cx">       return redirected_test({url: url,
</span><span class="cx">                               fetch_option: {redirect: 'manual'},
</span><span class="cx">                               fetch_method: frame.contentWindow.fetch,
</span><span class="lines">@@ -309,6 +309,102 @@
</span><span class="cx"> 
</span><span class="cx"> // =======================================================
</span><span class="cx"> // Tests for requests that are in-scope of the service worker. The service
</span><ins>+// worker returns a generated redirect response manually with the Response
+// constructor.
+// =======================================================
+promise_test(t => setup_and_clean()
+    .then(() => {
+      const url = host_info['HTTPS_ORIGIN'] + base_path() +
+                  'sample?url=' + encodeURIComponent(TARGET_URL) +
+                  '&original-redirect-mode=follow&sw=gen-manual';
+      return redirected_test({url: url,
+                              fetch_option: {redirect: 'follow'},
+                              fetch_method: frame.contentWindow.fetch,
+                              expected_type: 'basic',
+                              expected_redirected: true,
+                              expected_intercepted_urls: [url, TARGET_URL]})
+    }),
+  'mode: "follow", manually-generated redirect response');
+
+promise_test(t => setup_and_clean()
+    .then(() => {
+      const url = host_info['HTTPS_ORIGIN'] + base_path() +
+                  'sample?url=' + encodeURIComponent(TARGET_URL) +
+                  '&original-redirect-mode=error&sw=gen-manual';
+      return promise_rejects_js(
+          t, frame.contentWindow.TypeError,
+          frame.contentWindow.fetch(url, {redirect: 'error'}),
+          'The generated redirect response from the service worker should ' +
+          'be treated as an error when the redirect flag of request was' +
+          ' \'error\'.')
+        .then(() => check_intercepted_urls([url]));
+    }),
+  'mode: "error", manually-generated redirect response');
+
+promise_test(t => setup_and_clean()
+    .then(() => {
+      const url = host_info['HTTPS_ORIGIN'] + base_path() +
+                  'sample?url=' + encodeURIComponent(TARGET_URL) +
+                  '&original-redirect-mode=manual&sw=gen-manual';
+      return redirected_test({url: url,
+                              fetch_option: {redirect: 'manual'},
+                              fetch_method: frame.contentWindow.fetch,
+                              expected_type: 'opaqueredirect',
+                              expected_redirected: false,
+                              expected_intercepted_urls: [url]})
+    }),
+  'mode: "manual", manually-generated redirect response');
+
+// =======================================================
+// Tests for requests that are in-scope of the service worker. The service
+// worker returns a generated redirect response with a relative location header.
+// Generated responses do not have URLs, so this should fail to resolve.
+// =======================================================
+promise_test(t => setup_and_clean()
+    .then(() => {
+      const url = host_info['HTTPS_ORIGIN'] + base_path() +
+                  'sample?url=blank.html' +
+                  '&original-redirect-mode=follow&sw=gen-manual';
+      return promise_rejects_js(
+          t, frame.contentWindow.TypeError,
+          frame.contentWindow.fetch(url, {redirect: 'follow'}),
+          'Following the generated redirect response from the service worker '+
+          'should result fail.')
+        .then(() => check_intercepted_urls([url]));
+    }),
+  'mode: "follow", generated relative redirect response');
+
+promise_test(t => setup_and_clean()
+    .then(() => {
+      const url = host_info['HTTPS_ORIGIN'] + base_path() +
+                  'sample?url=blank.html' +
+                  '&original-redirect-mode=error&sw=gen-manual';
+      return promise_rejects_js(
+          t, frame.contentWindow.TypeError,
+          frame.contentWindow.fetch(url, {redirect: 'error'}),
+          'The generated redirect response from the service worker should ' +
+          'be treated as an error when the redirect flag of request was' +
+          ' \'error\'.')
+        .then(() => check_intercepted_urls([url]));
+    }),
+  'mode: "error", generated relative redirect response');
+
+promise_test(t => setup_and_clean()
+    .then(() => {
+      const url = host_info['HTTPS_ORIGIN'] + base_path() +
+                  'sample?url=blank.html' +
+                  '&original-redirect-mode=manual&sw=gen-manual';
+      return redirected_test({url: url,
+                              fetch_option: {redirect: 'manual'},
+                              fetch_method: frame.contentWindow.fetch,
+                              expected_type: 'opaqueredirect',
+                              expected_redirected: false,
+                              expected_intercepted_urls: [url]})
+    }),
+  'mode: "manual", generated relative redirect response');
+
+// =======================================================
+// Tests for requests that are in-scope of the service worker. The service
</ins><span class="cx"> // worker returns a generated redirect response. And the fetch follows the
</span><span class="cx"> // redirection multiple times.
</span><span class="cx"> // =======================================================
</span><span class="lines">@@ -319,7 +415,7 @@
</span><span class="cx">       // So fetch can follow the redirect response 20 times.
</span><span class="cx">       let urls = [TARGET_URL];
</span><span class="cx">       for (let i = 0; i < 20; ++i) {
</span><del>-        urls.unshift(host_info['HTTPS_ORIGIN'] + '/dummy?sw=gen&url=' +
</del><ins>+        urls.unshift(host_info['HTTPS_ORIGIN'] + '/sample?sw=gen&url=' +
</ins><span class="cx">                     encodeURIComponent(urls[0]));
</span><span class="cx"> 
</span><span class="cx">       }
</span><span class="lines">@@ -339,7 +435,7 @@
</span><span class="cx">       // network error." https://fetch.spec.whatwg.org/#http-redirect-fetch
</span><span class="cx">       // So fetch can't follow the redirect response 21 times.
</span><span class="cx">       for (let i = 0; i < 21; ++i) {
</span><del>-        urls.unshift(host_info['HTTPS_ORIGIN'] + '/dummy?sw=gen&url=' +
</del><ins>+        urls.unshift(host_info['HTTPS_ORIGIN'] + '/sample?sw=gen&url=' +
</ins><span class="cx">                     encodeURIComponent(urls[0]));
</span><span class="cx"> 
</span><span class="cx">       }
</span><span class="lines">@@ -360,7 +456,7 @@
</span><span class="cx"> // =======================================================
</span><span class="cx"> promise_test(t => setup_and_clean()
</span><span class="cx">     .then(() => {
</span><del>-      const url = host_info['HTTPS_ORIGIN'] + base_path() + 'dummy?url=' +
</del><ins>+      const url = host_info['HTTPS_ORIGIN'] + base_path() + 'sample?url=' +
</ins><span class="cx">                   encodeURIComponent(TARGET_URL) +'&sw=fetch-url';
</span><span class="cx">       return redirected_test({url: url,
</span><span class="cx">                               fetch_option: {},
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerreferrerpolicyheaderhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-policy-header.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-policy-header.https-expected.txt       2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-policy-header.https-expected.txt  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,6 +1,5 @@
</span><span class="cx"> 
</span><del>-PASS Initialize global state (service worker registration)
</del><span class="cx"> PASS Referrer for a main resource redirected with referrer-policy (origin) should only have origin.
</span><ins>+PASS Referrer for a main resource redirected with a module script with referrer-policy (origin) should only have origin.
</ins><span class="cx"> PASS Referrer for fetch requests initiated from a service worker with referrer-policy (origin) should only have origin.
</span><del>-PASS Remove registration as a cleanup
</del><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerreferrerpolicyheaderhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-policy-header.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-policy-header.https.html       2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-policy-header.https.html  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -13,11 +13,9 @@
</span><span class="cx">     const registration =
</span><span class="cx">         await service_worker_unregister_and_register(t, SCRIPT, SCOPE);
</span><span class="cx">     await wait_for_state(t, registration.installing, 'activated');
</span><del>-    promise_test(() => registration.unregister(),
</del><ins>+    t.add_cleanup(() => registration.unregister(),
</ins><span class="cx">                  'Remove registration as a cleanup');
</span><del>-}, 'Initialize global state (service worker registration)');
</del><span class="cx"> 
</span><del>-promise_test(async t => {
</del><span class="cx">     const full_scope_url = new URL(SCOPE, location.href);
</span><span class="cx">     const redirect_to = `${full_scope_url.href}?ignore=true`;
</span><span class="cx">     const frame = await with_iframe(
</span><span class="lines">@@ -30,6 +28,30 @@
</span><span class="cx">    'should only have origin.');
</span><span class="cx"> 
</span><span class="cx"> promise_test(async t => {
</span><ins>+    const registration =
+        await service_worker_unregister_and_register(t, SCRIPT, SCOPE, `{type: 'module'}`);
+    await wait_for_state(t, registration.installing, 'activated');
+    t.add_cleanup(() => registration.unregister(),
+                 'Remove registration as a cleanup');
+
+    const full_scope_url = new URL(SCOPE, location.href);
+    const redirect_to = `${full_scope_url.href}?ignore=true`;
+    const frame = await with_iframe(
+        `${SCOPE}?pipe=status(302)|header(Location,${redirect_to})|` +
+        'header(Referrer-Policy,origin)');
+    assert_equals(frame.contentDocument.referrer,
+                  full_scope_url.origin + '/');
+    t.add_cleanup(() => frame.remove());
+}, 'Referrer for a main resource redirected with a module script with referrer-policy (origin) ' +
+   'should only have origin.');
+
+promise_test(async t => {
+    const registration =
+        await service_worker_unregister_and_register(t, SCRIPT, SCOPE);
+    await wait_for_state(t, registration.installing, 'activated');
+    t.add_cleanup(() => registration.unregister(),
+                 'Remove registration as a cleanup');
+
</ins><span class="cx">     const host_info = get_host_info();
</span><span class="cx">     const frame = await with_iframe(SCOPE);
</span><span class="cx">     const channel = new MessageChannel();
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerreferrertoplevelscriptfetchhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-toplevel-script-fetch.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-toplevel-script-fetch.https-expected.txt       2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-toplevel-script-fetch.https-expected.txt  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,3 +1,4 @@
</span><span class="cx"> 
</span><span class="cx"> PASS Referrer of the top-level script fetch should be the document URL
</span><ins>+PASS Referrer of the module script fetch should be the document URL
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerreferrertoplevelscriptfetchhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-toplevel-script-fetch.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-toplevel-script-fetch.https.html       2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-toplevel-script-fetch.https.html  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -39,4 +39,26 @@
</span><span class="cx">   assert_equals(update_headers["referer"], expected_referrer, "referrer of update()");
</span><span class="cx"> }, "Referrer of the top-level script fetch should be the document URL");
</span><span class="cx"> 
</span><ins>+promise_test(async (t) => {
+  const script = "resources/test-request-headers-worker.py";
+  const scope = "resources/blank.html";
+  const host_info = get_host_info();
+
+  const registration = await service_worker_unregister_and_register(
+    t, script, scope, {type: 'module'});
+  t.add_cleanup(() => service_worker_unregister(t, scope));
+  await wait_for_state(t, registration.installing, "activated");
+
+  const expected_referrer = host_info["HTTPS_ORIGIN"] + location.pathname;
+
+  // Check referrer for register().
+  const register_headers = await get_toplevel_script_headers(registration.active);
+  assert_equals(register_headers["referer"], expected_referrer, "referrer of register()");
+
+  // Check referrer for update().
+  await registration.update();
+  await wait_for_state(t, registration.installing, "installed");
+  const update_headers = await get_toplevel_script_headers(registration.waiting);
+  assert_equals(update_headers["referer"], expected_referrer, "referrer of update()");
+}, "Referrer of the module script fetch should be the document URL");
</ins><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationbasichttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-basic.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-basic.https.html   2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-basic.https.html      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -3,7 +3,37 @@
</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="resources/test-helpers.sub.js"></script>
</span><del>-<script src="resources/registration-tests-basic.js"></script>
</del><span class="cx"> <script>
</span><del>-registration_tests_basic((script, options) => navigator.serviceWorker.register(script, options), true);
</del><ins>+const script = 'resources/registration-worker.js';
+
+promise_test(async (t) => {
+  const scope = 'resources/registration/normal';
+  const registration = await navigator.serviceWorker.register(script, {scope});
+  t.add_cleanup(() => registration.unregister());
+  assert_true(
+    registration instanceof ServiceWorkerRegistration,
+    'Successfully registered.');
+}, 'Registering normal scope');
+
+promise_test(async (t) => {
+  const scope = 'resources/registration/scope-with-fragment#ref';
+  const registration = await navigator.serviceWorker.register(script, {scope});
+  t.add_cleanup(() => registration.unregister());
+  assert_true(
+    registration instanceof ServiceWorkerRegistration,
+    'Successfully registered.');
+  assert_equals(
+    registration.scope,
+    normalizeURL('resources/registration/scope-with-fragment'),
+    'A fragment should be removed from scope');
+}, 'Registering scope with fragment');
+
+promise_test(async (t) => {
+  const scope = 'resources/';
+  const registration = await navigator.serviceWorker.register(script, {scope})
+  t.add_cleanup(() => registration.unregister());
+  assert_true(
+    registration instanceof ServiceWorkerRegistration,
+    'Successfully registered.');
+}, 'Registering same scope as the script directory');
</ins><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationschedulejobhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-schedule-job.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-schedule-job.https-expected.txt    2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-schedule-job.https-expected.txt       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,4 +1,5 @@
</span><span class="cx"> 
</span><del>-FAIL different scriptURL and updateViaCache promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'registration.installing.scriptURL')"
-FAIL different type assert_equals: expected (string) "classic" but got (undefined) undefined
</del><ins>+PASS different scriptURL
+PASS different updateViaCache
+PASS different type
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationschedulejobhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-schedule-job.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-schedule-job.https.html    2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-schedule-job.https.html       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,9 +1,11 @@
</span><span class="cx"> <!DOCTYPE html>
</span><span class="cx"> <meta charset="utf-8">
</span><ins>+<meta name=timeout content=long>
</ins><span class="cx"> <title>Service Worker: Schedule Job algorithm</title>
</span><span class="cx"> <script src="/resources/testharness.js"></script>
</span><span class="cx"> <script src="resources/testharness-helpers.js"></script>
</span><span class="cx"> <script src="/resources/testharnessreport.js"></script>
</span><ins>+<script src="resources/test-helpers.sub.js"></script>
</ins><span class="cx"> <script>
</span><span class="cx"> // Tests for https://w3c.github.io/ServiceWorker/#schedule-job-algorithm
</span><span class="cx"> // Non-equivalent register jobs should not be coalesced.
</span><span class="lines">@@ -21,47 +23,85 @@
</span><span class="cx">   return new URL(url, self.location).toString();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// Test scriptURL and updateViaCache.
</del><ins>+// Test that a change to `script` starts a new register job.
</ins><span class="cx"> promise_test(async t => {
</span><span class="cx">   await cleanup();
</span><span class="cx">   t.add_cleanup(cleanup);
</span><span class="cx"> 
</span><ins>+  // Make a registration.
+  const registration = await
+      navigator.serviceWorker.register(script1, {scope});
+
+  // Schedule two more register jobs.
+  navigator.serviceWorker.register(script1, {scope});
+  await navigator.serviceWorker.register(script2, {scope});
+
+  // The jobs should not have been coalesced.
+  const worker = get_newest_worker(registration);
+  assert_equals(worker.scriptURL, absolute_url(script2));
+}, 'different scriptURL');
+
+// Test that a change to `updateViaCache` starts a new register job.
+promise_test(async t => {
+  await cleanup();
+  t.add_cleanup(cleanup);
+
</ins><span class="cx">   // Check defaults.
</span><span class="cx">   const registration = await
</span><span class="cx">       navigator.serviceWorker.register(script1, {scope});
</span><span class="cx">   assert_equals(registration.updateViaCache, 'imports');
</span><span class="cx"> 
</span><del>-  // Schedule several register jobs.
</del><ins>+  // Schedule two more register jobs.
</ins><span class="cx">   navigator.serviceWorker.register(script1, {scope});
</span><del>-  navigator.serviceWorker.register(script2, {scope});
-  await navigator.serviceWorker.register(script2,
-                                         {scope, updateViaCache: 'none'});
</del><ins>+  await navigator.serviceWorker.register(script1, {scope,
+      updateViaCache: 'none'});
</ins><span class="cx"> 
</span><del>-  // None of the changes should have been coalesced.
-  assert_equals(registration.installing.scriptURL, absolute_url(script2));
</del><ins>+  // The jobs should not have been coalesced.
</ins><span class="cx">   assert_equals(registration.updateViaCache, 'none');
</span><del>-}, 'different scriptURL and updateViaCache');
</del><ins>+}, 'different updateViaCache');
</ins><span class="cx"> 
</span><del>-// Test |type| in another test case because most browsers don't support it.
</del><ins>+// Test that a change to `type` starts a new register job.
</ins><span class="cx"> promise_test(async t => {
</span><del>-  const script1 = 'resources/empty.js';
-  const script2 = 'resources/empty.js?change';
-
</del><span class="cx">   await cleanup();
</span><span class="cx">   t.add_cleanup(cleanup);
</span><span class="cx"> 
</span><ins>+  const scriptForTypeCheck = 'resources/type-check-worker.js';
</ins><span class="cx">   // Check defaults.
</span><span class="cx">   const registration = await
</span><del>-      navigator.serviceWorker.register(script1, {scope});
-  assert_equals(registration.installing.type, 'classic');
</del><ins>+      navigator.serviceWorker.register(scriptForTypeCheck, {scope});
</ins><span class="cx"> 
</span><del>-  // Schedule several register jobs.
-  navigator.serviceWorker.register(script1, {scope});
-  navigator.serviceWorker.register(script2, {scope});
-  await navigator.serviceWorker.register(script2, {scope, type: 'module'});
</del><ins>+  let worker_type = await new Promise((resolve) => {
+    navigator.serviceWorker.onmessage = (event) => {
+      resolve(event.data);
+    };
+    // The jobs should not have been coalesced. get_newest_worker() helps the
+    // test fail with stable output on browers that incorrectly coalesce
+    // register jobs, since then sometimes registration is not a new worker as
+    // expected.
+    const worker = get_newest_worker(registration);
+    // The argument of postMessage doesn't matter for this case.
+    worker.postMessage('');
+  });
</ins><span class="cx"> 
</span><del>-  // None of the changes should have been coalesced.
-  assert_equals(registration.installing.scriptURL, absolute_url(script2));
-  assert_equals(registration.installing.type, 'module');
</del><ins>+  assert_equals(worker_type, 'classic');
+
+  // Schedule two more register jobs.
+  navigator.serviceWorker.register(scriptForTypeCheck, {scope});
+  await navigator.serviceWorker.register(scriptForTypeCheck, {scope, type: 'module'});
+
+  worker_type = await new Promise((resolve) => {
+    navigator.serviceWorker.onmessage = (event) => {
+      resolve(event.data);
+    };
+    // The jobs should not have been coalesced. get_newest_worker() helps the
+    // test fail with stable output on browers that incorrectly coalesce
+    // register jobs, since then sometimes registration is not a new worker as
+    // expected.
+    const worker = get_newest_worker(registration);
+    // The argument of postMessage doesn't matter for this case.
+    worker.postMessage('');
+  });
+
+  assert_equals(worker_type, 'module');
</ins><span class="cx"> }, 'different type');
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationscopemodulestaticimporthttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-scope-module-static-import.https-expected.txt (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-scope-module-static-import.https-expected.txt                              (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-scope-module-static-import.https-expected.txt 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+
+PASS imported-module-script.js works when used as top-level
+PASS static imports to outside path restriction should be allowed
+PASS static imports redirecting to outside path restriction should be allowed
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationscopemodulestaticimporthttpshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-scope-module-static-import.https.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-scope-module-static-import.https.html                              (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-scope-module-static-import.https.html 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+<!DOCTYPE html>
+<title>Service Worker: Static imports from module top-level scripts shouldn't be affected by the service worker script path restriction</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<script>
+// https://w3c.github.io/ServiceWorker/#path-restriction
+// is applied to top-level scripts in
+// https://w3c.github.io/ServiceWorker/#update-algorithm
+// but not to submodules imported from top-level scripts.
+async function runTest(t, script, scope) {
+  const script_url = new URL(script, location.href);
+  await service_worker_unregister(t, scope);
+  const registration = await
+      navigator.serviceWorker.register(script, {type: 'module'});
+  t.add_cleanup(_ => registration.unregister());
+  const msg = await new Promise(resolve => {
+    registration.installing.postMessage('ping');
+    navigator.serviceWorker.onmessage = resolve;
+  });
+  assert_equals(msg.data, 'pong');
+}
+
+promise_test(async t => {
+    await runTest(t,
+        'resources/scope2/imported-module-script.js',
+        'resources/scope2/');
+  }, 'imported-module-script.js works when used as top-level');
+
+promise_test(async t => {
+    await runTest(t,
+        'resources/scope1/module-worker-importing-scope2.js',
+        'resources/scope1/');
+  }, 'static imports to outside path restriction should be allowed');
+
+promise_test(async t => {
+    await runTest(t,
+       'resources/scope1/module-worker-importing-redirect-to-scope2.js',
+       'resources/scope1/');
+  }, 'static imports redirecting to outside path restriction should be allowed');
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationscriptmodulehttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script-module.https-expected.txt (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script-module.https-expected.txt                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script-module.https-expected.txt      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+
+PASS Registering invalid chunked encoding script
+PASS Registering invalid chunked encoding script with flush
+PASS Registering script including parse error
+PASS Registering script including undefined error
+PASS Registering script including uncaught exception
+FAIL Registering script with top-level await assert_unreached: Should have rejected: Registration of script with top-level await should fail. Reached unreachable code
+PASS Registering script with module instantiation error
+PASS Registering script with module instantiation error and top-level await
+PASS Registering non-existent script
+PASS Registering script including caught exception
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationscriptmodulehttpshtmlfromrev279388trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationscripthttpshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script-module.https.html (from rev 279388, trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script.https.html) (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script-module.https.html                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script-module.https.html      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+<!DOCTYPE html>
+<title>Service Worker: Registration (module script)</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<script src="resources/registration-tests-script.js"></script>
+<script>
+registration_tests_script(
+    (script, options) => navigator.serviceWorker.register(
+        script,
+        Object.assign({type: 'module'}, options)),
+    'module');
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationscripthttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script.https.html  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script.https.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -5,5 +5,8 @@
</span><span class="cx"> <script src="resources/test-helpers.sub.js"></script>
</span><span class="cx"> <script src="resources/registration-tests-script.js"></script>
</span><span class="cx"> <script>
</span><del>-registration_tests_script((script, options) => navigator.serviceWorker.register(script, options));
</del><ins>+registration_tests_script(
+    (script, options) => navigator.serviceWorker.register(script, options),
+    'classic'
+);
</ins><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerregistrationupdateviacachehttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-updateviacache.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-updateviacache.https.html  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-updateviacache.https.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -145,7 +145,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // Wait for all registration related tasks on |frame| to complete.
</span><del>-        await wait_for_activation_on_dummy_scope(t, frame.contentWindow);
</del><ins>+        await wait_for_activation_on_sample_scope(t, frame.contentWindow);
</ins><span class="cx">         // The updateViaCache change should have been propagated to all
</span><span class="cx">         // corresponding JS registration objects.
</span><span class="cx">         assert_equals(reg_in_frame.updateViaCache, expected_updateViaCache, "reg_in_frame.updateViaCache updated");
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcetimingsubhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resource-timing.sub.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resource-timing.sub.https.html  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resource-timing.sub.https.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -4,138 +4,147 @@
</span><span class="cx"> <script src="resources/test-helpers.sub.js"></script>
</span><span class="cx"> <script>
</span><span class="cx"> function resourceUrl(path) {
</span><del>-    return "https://{{host}}:{{ports[https][0]}}" + base_path() + path;
</del><ins>+  return "https://{{host}}:{{ports[https][0]}}" + base_path() + path;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function crossOriginUrl(path) {
</span><del>-    return "https://{{hosts[alt][]}}:{{ports[https][0]}}" + base_path() + path;
</del><ins>+  return "https://{{hosts[alt][]}}:{{ports[https][0]}}" + base_path() + path;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// Verify existance of a PerformanceEntry and the order between the timings.
+//
+// |options| has these properties:
+// performance: Performance interface to verify existance of the entry.
+// resource: the path to the resource.
+// mode: 'cross-origin' to load the resource from third-party origin.
+// description: the description passed to each assertion.
+// should_no_performance_entry: no entry is expected to be recorded when it's
+//                              true.
</ins><span class="cx"> function verify(options) {
</span><del>-    const url = options.mode === 'cross-origin' ? crossOriginUrl(options.resource)
-                                      : resourceUrl(options.resource);
-    const entryList = options.performance.getEntriesByName(url, 'resource');
-    if (options.should_no_performance_entry) {
-        // The performance timeline may not have an entry for a resource
-        // which failed to load.
-        assert_equals(entryList.length, 0, options.description);
-        return;
-    }
-    assert_equals(entryList.length, 1, options.description);
-    const entry = entryList[0];
-    assert_equals(entry.entryType, 'resource', options.description);
-    assert_greater_than(entry.workerStart, 0, options.description);
-    assert_greater_than_equal(entry.workerStart, entry.startTime, options.description);
-    assert_less_than_equal(entry.workerStart, entry.fetchStart, options.description);
-    if (options.mode === 'cross-origin') {
-      assert_equals(entry.responseStart, 0, options.description);
-      assert_greater_than_equal(entry.responseEnd, entry.fetchStart, options.description);
-    } else {
-      assert_greater_than_equal(entry.responseStart, entry.fetchStart, options.description);
-      assert_greater_than_equal(entry.responseEnd, entry.responseStart, options.description);
-    }
-    assert_greater_than(entry.responseEnd, entry.fetchStart, options.description);
-    assert_greater_than(entry.duration, 0, options.description);
-    if (options.resource.indexOf('redirect.py') != -1) {
-        assert_less_than_equal(entry.workerStart, entry.redirectStart,
-                               options.description);
-    } else {
-        assert_equals(entry.redirectStart, 0, options.description);
-    }
</del><ins>+  const url = options.mode === 'cross-origin' ? crossOriginUrl(options.resource)
+    : resourceUrl(options.resource);
+  const entryList = options.performance.getEntriesByName(url, 'resource');
+  if (options.should_no_performance_entry) {
+    // The performance timeline may not have an entry for a resource
+    // which failed to load.
+    assert_equals(entryList.length, 0, options.description);
+    return;
+  }
+
+  assert_equals(entryList.length, 1, options.description);
+  const entry = entryList[0];
+  assert_equals(entry.entryType, 'resource', options.description);
+
+  // workerStart is recorded between startTime and fetchStart.
+  assert_greater_than(entry.workerStart, 0, options.description);
+  assert_greater_than_equal(entry.workerStart, entry.startTime, options.description);
+  assert_less_than_equal(entry.workerStart, entry.fetchStart, options.description);
+
+  if (options.mode === 'cross-origin') {
+    assert_equals(entry.responseStart, 0, options.description);
+    assert_greater_than_equal(entry.responseEnd, entry.fetchStart, options.description);
+  } else {
+    assert_greater_than_equal(entry.responseStart, entry.fetchStart, options.description);
+    assert_greater_than_equal(entry.responseEnd, entry.responseStart, options.description);
+  }
+
+  // responseEnd follows fetchStart.
+  assert_greater_than(entry.responseEnd, entry.fetchStart, options.description);
+  // duration always has some value.
+  assert_greater_than(entry.duration, 0, options.description);
+
+  if (options.resource.indexOf('redirect.py') != -1) {
+    assert_less_than_equal(entry.workerStart, entry.redirectStart,
+      options.description);
+  } else {
+    assert_equals(entry.redirectStart, 0, options.description);
+  }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-promise_test(function(t) {
-    const worker_url = 'resources/resource-timing-worker.js';
-    const scope = 'resources/resource-timing-iframe.sub.html';
-    let registration;
</del><ins>+promise_test(async (t) => {
+  const worker_url = 'resources/resource-timing-worker.js';
+  const scope = 'resources/resource-timing-iframe.sub.html';
</ins><span class="cx"> 
</span><del>-    return service_worker_unregister_and_register(t, worker_url, scope)
-      .then(function(r) {
-          registration = r;
-          return wait_for_state(t, r.installing, 'activated');
-        })
-      .then(function() {
-          return with_iframe(scope);
-        })
-      .then(function(frame) {
-          const performance = frame.contentWindow.performance;
-          verify({
-              performance: performance,
-              resource: 'resources/dummy.js',
-              mode: 'same-origin',
-              description: 'Generated response',
-          });
-          verify({
-              performance: performance,
-              resource: 'resources/empty.js',
-              mode: 'same-origin',
-              description: 'Network fallback',
-          });
-          verify({
-              performance: performance,
-              resource: 'resources/redirect.py?Redirect=empty.js',
-              mode: 'same-origin',
-              description: 'Redirect',
-          });
-          verify({
-              performance: performance,
-              resource: 'resources/square.png',
-              mode: 'same-origin',
-              description: 'Network fallback image',
-          });
-          // Test that worker start is available on cross-origin no-cors
-          // subresources.
-          verify({
-              performance: performance,
-              resource: 'resources/square.png',
-              mode: 'cross-origin',
-              description: 'Network fallback cross-origin image',
-          });
</del><ins>+  const registration = await service_worker_unregister_and_register(t, worker_url, scope);
+  t.add_cleanup(() => registration.unregister());
+  await wait_for_state(t, registration.installing, 'activated');
+  const frame = await with_iframe(scope);
+  t.add_cleanup(() => frame.remove());
</ins><span class="cx"> 
</span><del>-          // Tests for resouces which failed to load.
-          verify({
-              performance: performance,
-              resource: 'resources/missing.jpg',
-              mode: 'same-origin',
-              description: 'Network fallback load failure',
-          });
-          verify({
-              performance: performance,
-              resource: 'resources/missing.jpg',
-              mode: 'cross-origin',
-              description: 'Network fallback cross-origin load failure',
-          });
-          // Tests for respondWith(fetch()).
-          verify({
-              performance: performance,
-              resource: 'resources/missing.jpg?SWRespondsWithFetch',
-              mode: 'same-origin',
-              description: 'Resource in iframe, nonexistent but responded with fetch to another.',
-          });
-          verify({
-              performance: performance,
-              resource: 'resources/dummy.txt?SWFetched',
-              mode: 'same-origin',
-              description: 'Resource fetched as response from missing.jpg?SWRespondsWithFetch.',
-              should_no_performance_entry: true,
-          });
-          // Test for a normal resource that is unaffected by the Service Worker.
-          verify({
-              performance: performance,
-              resource: 'resources/empty-worker.js',
-              mode: 'same-origin',
-              description: 'Resource untouched by the Service Worker.',
-          });
</del><ins>+  const performance = frame.contentWindow.performance;
+  verify({
+    performance: performance,
+    resource: 'resources/sample.js',
+    mode: 'same-origin',
+    description: 'Generated response',
+  });
+  verify({
+    performance: performance,
+    resource: 'resources/empty.js',
+    mode: 'same-origin',
+    description: 'Network fallback',
+  });
+  verify({
+    performance: performance,
+    resource: 'resources/redirect.py?Redirect=empty.js',
+    mode: 'same-origin',
+    description: 'Redirect',
+  });
+  verify({
+    performance: performance,
+    resource: 'resources/square.png',
+    mode: 'same-origin',
+    description: 'Network fallback image',
+  });
+  // Test that worker start is available on cross-origin no-cors
+  // subresources.
+  verify({
+    performance: performance,
+    resource: 'resources/square.png',
+    mode: 'cross-origin',
+    description: 'Network fallback cross-origin image',
+  });
</ins><span class="cx"> 
</span><del>-          frame.remove();
-          return registration.unregister();
-      });
</del><ins>+  // Tests for resouces which failed to load.
+  verify({
+    performance: performance,
+    resource: 'resources/missing.jpg',
+    mode: 'same-origin',
+    description: 'Network fallback load failure',
+  });
+  verify({
+    performance: performance,
+    resource: 'resources/missing.jpg',
+    mode: 'cross-origin',
+    description: 'Network fallback cross-origin load failure',
+  });
+  // Tests for respondWith(fetch()).
+  verify({
+    performance: performance,
+    resource: 'resources/missing.jpg?SWRespondsWithFetch',
+    mode: 'same-origin',
+    description: 'Resource in iframe, nonexistent but responded with fetch to another.',
+  });
+  verify({
+    performance: performance,
+    resource: 'resources/sample.txt?SWFetched',
+    mode: 'same-origin',
+    description: 'Resource fetched as response from missing.jpg?SWRespondsWithFetch.',
+    should_no_performance_entry: true,
+  });
+  // Test for a normal resource that is unaffected by the Service Worker.
+  verify({
+    performance: performance,
+    resource: 'resources/empty-worker.js',
+    mode: 'same-origin',
+    description: 'Resource untouched by the Service Worker.',
+  });
</ins><span class="cx"> }, 'Controlled resource loads');
</span><span class="cx"> 
</span><span class="cx"> test(() => {
</span><del>-    const url = resourceUrl('resources/test-helpers.sub.js');
-    const entry = window.performance.getEntriesByName(url, 'resource')[0];
-    assert_equals(entry.workerStart, 0, 'Non-controlled');
</del><ins>+  const url = resourceUrl('resources/test-helpers.sub.js');
+  const entry = window.performance.getEntriesByName(url, 'resource')[0];
+  assert_equals(entry.workerStart, 0, 'Non-controlled');
</ins><span class="cx"> }, 'Non-controlled resource loads');
</span><span class="cx"> 
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesbasicmodule2js"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/basic-module-2.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/basic-module-2.js                             (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/basic-module-2.js        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+export default 'hello again!';
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesbasicmodulejs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/basic-module.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/basic-module.js                               (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/basic-module.js  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+export default 'hello!';
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesclaimbloburlworkerfetchiframehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/claim-blob-url-worker-fetch-iframe.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/claim-blob-url-worker-fetch-iframe.html                               (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/claim-blob-url-worker-fetch-iframe.html  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+<!doctype html>
+<script>
+const baseLocation = window.location;
+const workerScript =
+  `self.onmessage = async (e) => {
+    const url = new URL(e.data, '${baseLocation}').href;
+    const response = await fetch(url);
+    const text = await response.text();
+    self.postMessage(text);
+  };`;
+const blob = new Blob([workerScript], { type: 'text/javascript' });
+const blobUrl = URL.createObjectURL(blob);
+const worker = new Worker(blobUrl);
+
+function fetch_in_worker(url) {
+  return new Promise((resolve) => {
+    worker.onmessage = (e) => resolve(e.data);
+    worker.postMessage(url);
+  });
+}
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesclientnavigateworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-navigate-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-navigate-worker.js     2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-navigate-worker.js        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -3,6 +3,8 @@
</span><span class="cx"> importScripts("/common/get-host-info.sub.js")
</span><span class="cx"> importScripts("testharness-helpers.js")
</span><span class="cx"> 
</span><ins>+setup({ explicit_done: true });
+
</ins><span class="cx"> self.onfetch = function(e) {
</span><span class="cx">   if (e.request.url.indexOf("client-navigate-frame.html") >= 0) {
</span><span class="cx">     return;
</span><span class="lines">@@ -35,6 +37,7 @@
</span><span class="cx">                  })
</span><span class="cx">                  .catch(unreached_rejection(t));
</span><span class="cx">     }, "Return value should be instance of WindowClient");
</span><ins>+    done();
</ins><span class="cx">   } else if (test === "test_client_navigate_cross_origin") {
</span><span class="cx">     promise_test(function(t) {
</span><span class="cx">       this.add_cleanup(() => port.postMessage(pass(test, clientUrl)));
</span><span class="lines">@@ -49,6 +52,7 @@
</span><span class="cx">                  })
</span><span class="cx">                  .catch(unreached_rejection(t));
</span><span class="cx">     }, "Navigating to different origin should resolve with null");
</span><ins>+    done();
</ins><span class="cx">   } else if (test === "test_client_navigate_about_blank") {
</span><span class="cx">     promise_test(function(t) {
</span><span class="cx">       this.add_cleanup(function() { port.postMessage(pass(test, "")); });
</span><span class="lines">@@ -56,6 +60,7 @@
</span><span class="cx">                  .then(client => promise_rejects_js(t, TypeError, client.navigate("about:blank")))
</span><span class="cx">                  .catch(unreached_rejection(t));
</span><span class="cx">     }, "Navigating to about:blank should reject with TypeError");
</span><ins>+    done();
</ins><span class="cx">   } else if (test === "test_client_navigate_mixed_content") {
</span><span class="cx">     promise_test(function(t) {
</span><span class="cx">       this.add_cleanup(function() { port.postMessage(pass(test, "")); });
</span><span class="lines">@@ -67,6 +72,7 @@
</span><span class="cx">                  .then(client => promise_rejects_js(t, TypeError, client.navigate(url)))
</span><span class="cx">                  .catch(unreached_rejection(t));
</span><span class="cx">     }, "Navigating to mixed-content iframe should reject with TypeError");
</span><ins>+    done();
</ins><span class="cx">   } else if (test === "test_client_navigate_redirect") {
</span><span class="cx">     var host_info = get_host_info();
</span><span class="cx">     var url = new URL(host_info['HTTPS_REMOTE_ORIGIN']).toString() +
</span><span class="lines">@@ -77,9 +83,10 @@
</span><span class="cx">                  .then(client => client.navigate("redirect.py?Redirect=" + url))
</span><span class="cx">                  .then(client => {
</span><span class="cx">                    clientUrl = (client && client.url) || ""
</span><del>-                   assert_true(client === null);
</del><ins>+                   assert_equals(client, null);
</ins><span class="cx">                  })
</span><span class="cx">                  .catch(unreached_rejection(t));
</span><span class="cx">     }, "Redirecting to another origin should resolve with null");
</span><ins>+    done();
</ins><span class="cx">   }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesclienturlofbloburlworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-url-of-blob-url-worker.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-url-of-blob-url-worker.html                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-url-of-blob-url-worker.html       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<script>
+
+// Return a URL of a client when it's successful.
+function createAndFetchFromBlobWorker() {
+  const fetchURL = new URL('get-worker-client-url.txt', window.location).href;
+  const workerScript =
+    `self.onmessage = async (e) => {
+      const response = await fetch(e.data.url);
+      const text = await response.text();
+      self.postMessage({"result": text, "expected": self.location.href});
+    };`;
+  const blob = new Blob([workerScript], { type: 'text/javascript' });
+  const blobUrl = URL.createObjectURL(blob);
+
+  const worker = new Worker(blobUrl);
+  return new Promise((resolve, reject) => {
+    worker.onmessage = e => resolve(e.data);
+    worker.onerror = e => reject(e.message);
+    worker.postMessage({"url": fetchURL});
+  });
+}
+
+</script>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesclienturlofbloburlworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-url-of-blob-url-worker.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-url-of-blob-url-worker.js                              (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-url-of-blob-url-worker.js 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+addEventListener('fetch', e => {
+  if (e.request.url.includes('get-worker-client-url')) {
+    e.respondWith((async () => {
+      const clients = await self.clients.matchAll({type: 'worker'});
+      if (clients.length != 1)
+        return new Response('one worker client should exist');
+      return new Response(clients[0].url);
+    })());
+  }
+});
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesclientsmatchallbloburlworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-matchall-blob-url-worker.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-matchall-blob-url-worker.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-matchall-blob-url-worker.html    2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<script>
+const workerScript = `
+  self.onmessage = (e) => {
+    self.postMessage("Worker is ready.");
+  };
+`;
+const blob = new Blob([workerScript], { type: 'text/javascript' });
+const blobUrl = URL.createObjectURL(blob);
+const worker = new Worker(blobUrl);
+
+function waitForWorker() {
+  return new Promise(resolve => {
+    worker.onmessage = resolve;
+    worker.postMessage("Ping to worker.");
+  });
+}
+</script>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcescreatebloburlworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/create-blob-url-worker.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/create-blob-url-worker.js                             (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/create-blob-url-worker.js        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+const childWorkerScript = `
+  self.onmessage = async (e) => {
+    const response = await fetch(e.data);
+    const text = await response.text();
+    self.postMessage(text);
+  };
+`;
+const blob = new Blob([childWorkerScript], { type: 'text/javascript' });
+const blobUrl = URL.createObjectURL(blob);
+const childWorker = new Worker(blobUrl);
+
+// When a message comes from the parent frame, sends a resource url to the child
+// worker.
+self.onmessage = (e) => {
+  childWorker.postMessage(e.data);
+};
+
+// When a message comes from the child worker, sends a content of fetch() to the
+// parent frame.
+childWorker.onmessage = (e) => {
+  self.postMessage(e.data);
+};
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcescreateoutofscopeworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/create-out-of-scope-worker.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/create-out-of-scope-worker.html                               (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/create-out-of-scope-worker.html  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+<!doctype html>
+<script>
+const workerUrl = '../out-of-scope/sample-synthesized-worker.js?dedicated';
+const worker = new Worker(workerUrl);
+const workerPromise = new Promise(resolve => {
+  worker.onmessage = e => {
+    // `e.data` is 'worker loading intercepted by service worker' when a worker
+    // is intercepted by a service worker.
+    resolve(e.data);
+  }
+  worker.onerror = _ => {
+    resolve('worker loading was not intercepted by service worker');
+  }
+});
+
+function getWorkerPromise() {
+  return workerPromise;
+}
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesdummyworkerinterceptorjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy-worker-interceptor.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy-worker-interceptor.js   2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy-worker-interceptor.js      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,46 +0,0 @@
</span><del>-importScripts('/common/get-host-info.sub.js');
-
-const text = 'worker loading intercepted by service worker';
-const dedicated_worker_script = `postMessage('${text}');`;
-const shared_worker_script =
-    `onconnect = evt => evt.ports[0].postMessage('${text}');`;
-
-self.onfetch = event => {
-  const url = event.request.url;
-  const destination = event.request.destination;
-
-  // Request handler for a synthesized response.
-  if (url.indexOf('synthesized') != -1) {
-    let script_headers = new Headers({ "Content-Type": "text/javascript" });
-    if (destination === 'worker')
-      event.respondWith(new Response(dedicated_worker_script, { 'headers': script_headers }));
-    else if (destination === 'sharedworker')
-      event.respondWith(new Response(shared_worker_script, { 'headers': script_headers }));
-    else
-      event.respondWith(new Response('Unexpected request! ' + destination));
-    return;
-  }
-
-  // Request handler for a same-origin response.
-  if (url.indexOf('same-origin') != -1) {
-    event.respondWith(fetch('postmessage-on-load-worker.js'));
-    return;
-  }
-
-  // Request handler for a cross-origin response.
-  if (url.indexOf('cors') != -1) {
-    const filename = 'postmessage-on-load-worker.js';
-    const path = (new URL(filename, self.location)).pathname;
-    let new_url = get_host_info()['HTTPS_REMOTE_ORIGIN'] + path;
-    let mode;
-    if (url.indexOf('no-cors') != -1) {
-      // Test no-cors mode.
-      mode = 'no-cors';
-    } else {
-      // Test cors mode.
-      new_url += '?pipe=header(Access-Control-Allow-Origin,*)';
-      mode = 'cors';
-    }
-    event.respondWith(fetch(new_url, { mode: mode }));
-  }
-};
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesdummyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy.html    2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy.html       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,2 +0,0 @@
</span><del>-<!DOCTYPE html>
-<body>Hello world
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesdummytxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy.txt     2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy.txt        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-Hello world
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetcheventtestworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-event-test-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-event-test-worker.js    2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-event-test-worker.js       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -155,6 +155,29 @@
</span><span class="cx">   event.respondWith(new Response(body));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function handleUseAndIgnore(event) {
+  const request = event.request;
+  request.text();
+  return;
+}
+
+function handleCloneAndIgnore(event) {
+  const request = event.request;
+  request.clone().text();
+  return;
+}
+
+var handle_status_count = 0;
+function handleStatus(event) {
+  handle_status_count++;
+  event.respondWith(async function() {
+    const res = await fetch(event.request);
+    const text = await res.text();
+    return new Response(`${text}. Request was sent ${handle_status_count} times.`,
+      {"status": new URL(event.request.url).searchParams.get("status")});
+  }());
+}
+
</ins><span class="cx"> self.addEventListener('fetch', function(event) {
</span><span class="cx">     var url = event.request.url;
</span><span class="cx">     var handlers = [
</span><span class="lines">@@ -180,6 +203,9 @@
</span><span class="cx">       { pattern: '?keepalive', fn: handleKeepalive },
</span><span class="cx">       { pattern: '?isReloadNavigation', fn: handleIsReloadNavigation },
</span><span class="cx">       { pattern: '?isHistoryNavigation', fn: handleIsHistoryNavigation },
</span><ins>+      { pattern: '?use-and-ignore', fn: handleUseAndIgnore },
+      { pattern: '?clone-and-ignore', fn: handleCloneAndIgnore },
+      { pattern: '?status', fn: handleStatus },
</ins><span class="cx">     ];
</span><span class="cx"> 
</span><span class="cx">     var handler = null;
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetcheventwithinswworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-event-within-sw-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-event-within-sw-worker.js       2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-event-within-sw-worker.js  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -5,20 +5,20 @@
</span><span class="cx"> 
</span><span class="cx">   if (url.origin != location.origin) return;
</span><span class="cx"> 
</span><del>-  if (url.pathname.endsWith('/dummy.txt')) {
</del><ins>+  if (url.pathname.endsWith('/sample.txt')) {
</ins><span class="cx">     event.respondWith(new Response('intercepted'));
</span><span class="cx">     return;
</span><span class="cx">   }
</span><span class="cx"> 
</span><del>-  if (url.pathname.endsWith('/dummy.txt-inner-fetch')) {
-    event.respondWith(fetch('dummy.txt'));
</del><ins>+  if (url.pathname.endsWith('/sample.txt-inner-fetch')) {
+    event.respondWith(fetch('sample.txt'));
</ins><span class="cx">     return;
</span><span class="cx">   }
</span><span class="cx"> 
</span><del>-  if (url.pathname.endsWith('/dummy.txt-inner-cache')) {
</del><ins>+  if (url.pathname.endsWith('/sample.txt-inner-cache')) {
</ins><span class="cx">     event.respondWith(
</span><span class="cx">       caches.open('test-inner-cache').then(cache =>
</span><del>-        cache.add('dummy.txt').then(() => cache.match('dummy.txt'))
</del><ins>+        cache.add('sample.txt').then(() => cache.match('sample.txt'))
</ins><span class="cx">       )
</span><span class="cx">     );
</span><span class="cx">     return;
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchmixedcontentiframeinscopetoinscopehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-mixed-content-iframe-inscope-to-inscope.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-mixed-content-iframe-inscope-to-inscope.html    2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-mixed-content-iframe-inscope-to-inscope.html       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx">     results += 'FAIL(1)';
</span><span class="cx">     test2();
</span><span class="cx">   };
</span><del>-  img.src = './dummy?url=' +
</del><ins>+  img.src = './sample?url=' +
</ins><span class="cx">             encodeURIComponent(host_info['HTTPS_ORIGIN'] + image_path);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx">     results += 'FAIL(2)';
</span><span class="cx">     test3();
</span><span class="cx">   };
</span><del>-  img.src = './dummy?mode=no-cors&url=' +
</del><ins>+  img.src = './sample?mode=no-cors&url=' +
</ins><span class="cx">             encodeURIComponent(host_info['HTTPS_REMOTE_ORIGIN'] + image_path);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">   img.onerror = function() {
</span><span class="cx">     test4();
</span><span class="cx">   };
</span><del>-  img.src = './dummy?mode=no-cors&url=' +
</del><ins>+  img.src = './sample?mode=no-cors&url=' +
</ins><span class="cx">             encodeURIComponent(host_info['HTTP_ORIGIN'] + image_path);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx">   img.onerror = function() {
</span><span class="cx">     finish();
</span><span class="cx">   };
</span><del>-  img.src = './dummy?mode=no-cors&url=' +
</del><ins>+  img.src = './sample?mode=no-cors&url=' +
</ins><span class="cx">             encodeURIComponent(host_info['HTTP_REMOTE_ORIGIN'] + image_path);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchmixedcontentiframeinscopetooutscopehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-mixed-content-iframe-inscope-to-outscope.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-mixed-content-iframe-inscope-to-outscope.html   2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-mixed-content-iframe-inscope-to-outscope.html      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx">     results += 'FAIL(5)';
</span><span class="cx">     finish();
</span><span class="cx">   };
</span><del>-  img.src = './dummy?generate-png';
</del><ins>+  img.src = './sample?generate-png';
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function finish() {
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequestcssbaseurlstylecss"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-css-base-url-style.css (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-css-base-url-style.css  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-css-base-url-style.css     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1 +1 @@
</span><del>-body { background-image: url("./dummy.png");}
</del><ins>+body { background-image: url("./sample.png");}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequestcssbaseurlworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-css-base-url-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-css-base-url-worker.js  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-css-base-url-worker.js     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx">     }
</span><span class="cx">     // Respond with new Response().
</span><span class="cx">     else if (url.search == '?newResponse') {
</span><del>-      const styleString = 'body { background-image: url("./dummy.png");}';
</del><ins>+      const styleString = 'body { background-image: url("./sample.png");}';
</ins><span class="cx">       const headers = {'content-type': 'text/css'};
</span><span class="cx">       event.respondWith(new Response(styleString, headers));
</span><span class="cx">     }
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> 
</span><span class="cx">   // The image request indicates what the base URL of the CSS was. Message the
</span><span class="cx">   // result back to the test page.
</span><del>-  else if (url.pathname.indexOf('dummy.png') != -1) {
</del><ins>+  else if (url.pathname.indexOf('sample.png') != -1) {
</ins><span class="cx">     // For some reason |source| is undefined here when running the test manually
</span><span class="cx">     // in Firefox. The test author experimented with both using Client
</span><span class="cx">     // (event.source) and MessagePort to try to get the test to pass, but
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequesthtmlimportsiframehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-html-imports-iframe.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-html-imports-iframe.html        2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-html-imports-iframe.html   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -8,6 +8,6 @@
</span><span class="cx">       link.href = url;
</span><span class="cx">       document.documentElement.appendChild(link);
</span><span class="cx">     };
</span><del>-  makeLink('same', hostInfo.HTTPS_ORIGIN + '/dummy-dir/same.html');
-  makeLink('other', hostInfo.HTTPS_REMOTE_ORIGIN + '/dummy-dir/other.html');
</del><ins>+  makeLink('same', hostInfo.HTTPS_ORIGIN + '/sample-dir/same.html');
+  makeLink('other', hostInfo.HTTPS_REMOTE_ORIGIN + '/sample-dir/other.html');
</ins><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequesthtmlimportsworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-html-imports-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-html-imports-worker.js  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-html-imports-worker.js     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -3,27 +3,27 @@
</span><span class="cx"> 
</span><span class="cx"> self.addEventListener('fetch', function(event) {
</span><span class="cx">     var url = event.request.url;
</span><del>-    if (url.indexOf('dummy-dir') == -1) {
</del><ins>+    if (url.indexOf('sample-dir') == -1) {
</ins><span class="cx">       return;
</span><span class="cx">     }
</span><span class="cx">     var result = 'mode=' + event.request.mode +
</span><span class="cx">       ' credentials=' + event.request.credentials;
</span><del>-    if (url == host_info.HTTPS_ORIGIN + '/dummy-dir/same.html') {
</del><ins>+    if (url == host_info.HTTPS_ORIGIN + '/sample-dir/same.html') {
</ins><span class="cx">       event.respondWith(new Response(
</span><span class="cx">         result +
</span><span class="cx">         '<link id="same-same" rel="import" ' +
</span><del>-        'href="' + host_info.HTTPS_ORIGIN + '/dummy-dir/same-same.html">' +
</del><ins>+        'href="' + host_info.HTTPS_ORIGIN + '/sample-dir/same-same.html">' +
</ins><span class="cx">         '<link id="same-other" rel="import" ' +
</span><span class="cx">         ' href="' + host_info.HTTPS_REMOTE_ORIGIN +
</span><del>-        '/dummy-dir/same-other.html">'));
-    } else if (url == host_info.HTTPS_REMOTE_ORIGIN + '/dummy-dir/other.html') {
</del><ins>+        '/sample-dir/same-other.html">'));
+    } else if (url == host_info.HTTPS_REMOTE_ORIGIN + '/sample-dir/other.html') {
</ins><span class="cx">       event.respondWith(new Response(
</span><span class="cx">         result +
</span><span class="cx">         '<link id="other-same" rel="import" ' +
</span><del>-        ' href="' + host_info.HTTPS_ORIGIN + '/dummy-dir/other-same.html">' +
</del><ins>+        ' href="' + host_info.HTTPS_ORIGIN + '/sample-dir/other-same.html">' +
</ins><span class="cx">         '<link id="other-other" rel="import" ' +
</span><span class="cx">         ' href="' + host_info.HTTPS_REMOTE_ORIGIN +
</span><del>-        '/dummy-dir/other-other.html">'));
</del><ins>+        '/sample-dir/other-other.html">'));
</ins><span class="cx">     } else {
</span><span class="cx">       event.respondWith(new Response(result));
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequestresourcesiframehttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-resources-iframe.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-resources-iframe.https.html     2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-resources-iframe.https.html        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -44,7 +44,10 @@
</span><span class="cx"> function load_css_image_set(url, type) {
</span><span class="cx">   const div = document.createElement('div');
</span><span class="cx">   document.body.appendChild(div);
</span><del>-  div.style[type] = '-webkit-image-set(url(' + url + ') 1x)';
</del><ins>+  div.style[type] = 'image-set(url(' + url + ') 1x)';
+  if (!div.style[type]) {
+    div.style[type] = '-webkit-image-set(url(' + url + ') 1x)';
+  }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function load_script_with_integrity(url, integrity) {
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequestresourcesworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-resources-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-resources-worker.js     2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-resources-worker.js        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -11,7 +11,7 @@
</span><span class="cx"> 
</span><span class="cx"> self.addEventListener('fetch', e => {
</span><span class="cx">   const url = e.request.url;
</span><del>-  if (!url.includes('dummy?test')) {
</del><ins>+  if (!url.includes('sample?test')) {
</ins><span class="cx">     return;
</span><span class="cx">   }
</span><span class="cx">   port.postMessage({
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequestxhriframehttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-iframe.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-iframe.https.html   2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-iframe.https.html      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">       if (with_credentials) {
</span><span class="cx">         xhr.withCredentials = true;
</span><span class="cx">       }
</span><del>-      xhr.open(method, url_base + '/dummy?test', true);
</del><ins>+      xhr.open(method, url_base + '/sample?test', true);
</ins><span class="cx">       xhr.send(data);
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx">           '\r\n' +
</span><span class="cx">           'file content\r\n' +
</span><span class="cx">           '--' + boundary + '--\r\n';
</span><del>-        assert_true(response.body === expected_body, "form data response content is as expected");
</del><ins>+        assert_equals(response.body, expected_body, "form data response content is as expected");
</ins><span class="cx">       });
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequestxhrsyncerrorworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-sync-error-worker.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-sync-error-worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-sync-error-worker.js   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+"use strict";
+
+self.onfetch = event => {
+  if (event.request.url.endsWith("non-existent-stream-1.txt")) {
+    const rs1 = new ReadableStream();
+    event.respondWith(new Response(rs1));
+    rs1.cancel(1);
+  } else if (event.request.url.endsWith("non-existent-stream-2.txt")) {
+    const rs2 = new ReadableStream({
+      start(controller) { controller.error(1) }
+    });
+    event.respondWith(new Response(rs2));
+  } else if (event.request.url.endsWith("non-existent-stream-3.txt")) {
+    const rs3 = new ReadableStream({
+      pull(controller) { controller.error(1) }
+    });
+    event.respondWith(new Response(rs3));
+  }
+};
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrequestxhrworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-worker.js   2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-worker.js      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> self.addEventListener('fetch', function(event) {
</span><span class="cx">     var url = event.request.url;
</span><del>-    if (url.indexOf('dummy?test') == -1) {
</del><ins>+    if (url.indexOf('sample?test') == -1) {
</ins><span class="cx">       return;
</span><span class="cx">     }
</span><span class="cx">     event.respondWith(new Promise(function(resolve) {
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchresponsexhriframehttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-response-xhr-iframe.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-response-xhr-iframe.https.html  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-response-xhr-iframe.https.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx">         reject('XHR should succeed.');
</span><span class="cx">       };
</span><span class="cx">       xhr.responseType = 'text';
</span><del>-      xhr.open(method, './dummy?test', true);
</del><ins>+      xhr.open(method, './sample?test', true);
</ins><span class="cx">       xhr.send(data);
</span><span class="cx">     });
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchresponsexhrworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-response-xhr-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-response-xhr-worker.js  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-response-xhr-worker.js     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> self.addEventListener('fetch', function(event) {
</span><span class="cx">     var url = event.request.url;
</span><del>-    if (url.indexOf('dummy?test') == -1) {
</del><ins>+    if (url.indexOf('sample?test') == -1) {
</ins><span class="cx">       return;
</span><span class="cx">     }
</span><span class="cx">     event.respondWith(new Promise(function(resolve) {
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesfetchrewriteworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-rewrite-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-rewrite-worker.js       2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-rewrite-worker.js  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -133,6 +133,10 @@
</span><span class="cx">             }
</span><span class="cx">           }
</span><span class="cx"> 
</span><ins>+          if (params['clone']) {
+            response = response.clone();
+          }
+
</ins><span class="cx">           // |cache| means to bounce responses through Cache Storage and back.
</span><span class="cx">           if (params['cache']) {
</span><span class="cx">             var cacheName = "cached-fetches-" + performance.now() + "-" +
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesimmutableprototypeserviceworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/immutable-prototype-serviceworker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/immutable-prototype-serviceworker.js  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/immutable-prototype-serviceworker.js     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -2,9 +2,9 @@
</span><span class="cx">   let result = [];
</span><span class="cx">   while (global !== null) {
</span><span class="cx">     let thrown = false;
</span><del>-    let next = global.__proto__;
</del><ins>+    let next = Object.getPrototypeOf(global);
</ins><span class="cx">     try {
</span><del>-      global.__proto__ = {};
</del><ins>+      Object.setPrototypeOf(global, {});
</ins><span class="cx">       result.push('mutable');
</span><span class="cx">     } catch (e) {
</span><span class="cx">       result.push('immutable');
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesimportechocookieworkermodulepy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-echo-cookie-worker-module.py (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-echo-cookie-worker-module.py                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-echo-cookie-worker-module.py      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+def main(request, response):
+  # This script generates a worker script for static imports from module
+  # service workers.
+  headers = [(b'Content-Type', b'text/javascript')]
+  body = b"import './echo-cookie-worker.py?key=%s'" % request.GET[b'key']
+  return headers, body
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesimportscriptscrossoriginworkersubjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-scripts-cross-origin-worker.sub.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-scripts-cross-origin-worker.sub.js                             (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-scripts-cross-origin-worker.sub.js        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+importScripts('https://{{domains[www1]}}:{{ports[https][0]}}/service-workers/service-worker/resources/import-scripts-version.py');
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesinvalidblobtypeiframehttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-blobtype-iframe.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-blobtype-iframe.https.html    2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-blobtype-iframe.https.html       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -14,7 +14,7 @@
</span><span class="cx">         reject('XHR must succeed.');
</span><span class="cx">       };
</span><span class="cx">       xhr.responseType = 'text';
</span><del>-      xhr.open(method, './dummy?test', true);
</del><ins>+      xhr.open(method, './sample?test', true);
</ins><span class="cx">       xhr.send(data);
</span><span class="cx">     });
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesinvalidblobtypeworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-blobtype-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-blobtype-worker.js    2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-blobtype-worker.js       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> self.addEventListener('fetch', function(event) {
</span><span class="cx">     var url = event.request.url;
</span><del>-    if (url.indexOf('dummy?test') == -1) {
</del><ins>+    if (url.indexOf('sample?test') == -1) {
</ins><span class="cx">       return;
</span><span class="cx">     }
</span><span class="cx">     event.respondWith(new Promise(function(resolve) {
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesinvalidheaderiframehttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-header-iframe.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-header-iframe.https.html      2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-header-iframe.https.html 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -11,7 +11,7 @@
</span><span class="cx">         resolve();
</span><span class="cx">       };
</span><span class="cx">       xhr.responseType = 'text';
</span><del>-      xhr.open(method, './dummy?test', true);
</del><ins>+      xhr.open(method, './sample?test', true);
</ins><span class="cx">       xhr.send(data);
</span><span class="cx">     });
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesinvalidheaderworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-header-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-header-worker.js      2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/invalid-header-worker.js 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> self.addEventListener('fetch', function(event) {
</span><span class="cx">     var url = event.request.url;
</span><del>-    if (url.indexOf('dummy?test') == -1) {
</del><ins>+    if (url.indexOf('sample?test') == -1) {
</ins><span class="cx">       return;
</span><span class="cx">     }
</span><span class="cx">     event.respondWith(new Promise(function(resolve) {
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesisolatin1headeriframehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/iso-latin1-header-iframe.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/iso-latin1-header-iframe.html 2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/iso-latin1-header-iframe.html    2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx">         reject('XHR must succeed.');
</span><span class="cx">       };
</span><span class="cx">       xhr.responseType = 'text';
</span><del>-      xhr.open(method, './dummy?test', true);
</del><ins>+      xhr.open(method, './sample?test', true);
</ins><span class="cx">       xhr.send(data);
</span><span class="cx">     });
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesisolatin1headerworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/iso-latin1-header-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/iso-latin1-header-worker.js   2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/iso-latin1-header-worker.js      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> self.addEventListener('fetch', function(event) {
</span><span class="cx">     var url = event.request.url;
</span><del>-    if (url.indexOf('dummy?test') == -1) {
</del><ins>+    if (url.indexOf('sample?test') == -1) {
</ins><span class="cx">       return;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourceslocalurlinheritcontrollerframehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/local-url-inherit-controller-frame.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/local-url-inherit-controller-frame.html       2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/local-url-inherit-controller-frame.html  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <script>
</span><span class="cx"> 
</span><del>-const fetchURL = new URL('dummy.txt', window.location).href;
</del><ins>+const fetchURL = new URL('sample.txt', window.location).href;
</ins><span class="cx"> 
</span><span class="cx"> const frameControllerText =
</span><span class="cx"> `<script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourceslocalurlinheritcontrollerworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/local-url-inherit-controller-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/local-url-inherit-controller-worker.js        2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/local-url-inherit-controller-worker.js   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> addEventListener('fetch', evt => {
</span><del>-  if (evt.request.url.includes('dummy')) {
</del><ins>+  if (evt.request.url.includes('sample')) {
</ins><span class="cx">     evt.respondWith(new Response('intercepted'));
</span><span class="cx">   }
</span><span class="cx"> });
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesnestedbloburlworkercreatedfromworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-blob-url-worker-created-from-worker.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-blob-url-worker-created-from-worker.html                               (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-blob-url-worker-created-from-worker.html  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+<!doctype html>
+<script>
+const baseLocation = window.location;
+const workerUrl = new URL('create-blob-url-worker.js', baseLocation).href;
+const worker = new Worker(workerUrl);
+
+function fetch_in_worker(url) {
+  const resourceUrl = new URL(url, baseLocation).href;
+  return new Promise((resolve) => {
+    worker.onmessage = (event) => {
+      resolve(event.data);
+    };
+    worker.postMessage(resourceUrl);
+  });
+}
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesnestedbloburlworkershtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-blob-url-workers.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-blob-url-workers.html                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-blob-url-workers.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+<!doctype html>
+<script>
+const baseLocation = window.location;
+const parentWorkerScript = `
+  const childWorkerScript = 'self.onmessage = async (e) => {' +
+    '  const response = await fetch(e.data);' +
+    '  const text = await response.text();' +
+    '  self.postMessage(text);' +
+    '};';
+  const blob = new Blob([childWorkerScript], { type: 'text/javascript' });
+  const blobUrl = URL.createObjectURL(blob);
+  const childWorker = new Worker(blobUrl);
+
+  // When a message comes from the parent frame, sends a resource url to the
+  // child worker.
+  self.onmessage = (e) => {
+    childWorker.postMessage(e.data);
+  };
+  // When a message comes from the child worker, sends a content of fetch() to
+  // the parent frame.
+  childWorker.onmessage = (e) => {
+    self.postMessage(e.data);
+  };
+`;
+const blob = new Blob([parentWorkerScript], { type: 'text/javascript' });
+const blobUrl = URL.createObjectURL(blob);
+const worker = new Worker(blobUrl);
+
+function fetch_in_worker(url) {
+  const resourceUrl = new URL(url, baseLocation).href;
+  return new Promise((resolve) => {
+    worker.onmessage = (event) => {
+      resolve(event.data);
+    };
+    worker.postMessage(resourceUrl);
+  });
+}
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesnestedworkercreatedfrombloburlworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-worker-created-from-blob-url-worker.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-worker-created-from-blob-url-worker.html                               (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-worker-created-from-blob-url-worker.html  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+<!doctype html>
+<script>
+const baseLocation = window.location;
+const parentWorkerScript = `
+  const workerUrl =
+    new URL('postmessage-fetched-text.js', '${baseLocation}').href;
+  const childWorker = new Worker(workerUrl);
+
+  // When a message comes from the parent frame, sends a resource url to the
+  // child worker.
+  self.onmessage = (e) => {
+    childWorker.postMessage(e.data);
+  };
+  // When a message comes from the child worker, sends a content of fetch() to
+  // the parent frame.
+  childWorker.onmessage = (e) => {
+    self.postMessage(e.data);
+  };
+`;
+const blob = new Blob([parentWorkerScript], { type: 'text/javascript' });
+const blobUrl = URL.createObjectURL(blob);
+const worker = new Worker(blobUrl);
+
+function fetch_in_worker(url) {
+  const resourceUrl = new URL(url, baseLocation).href;
+  return new Promise((resolve) => {
+    worker.onmessage = (event) => {
+      resolve(event.data);
+    };
+    worker.postMessage(resourceUrl);
+  });
+}
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesnodynamicimportjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/no-dynamic-import.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/no-dynamic-import.js                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/no-dynamic-import.js     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+/** @type {[name: string, url: string][]} */
+const importUrlTests = [
+  ["Module URL", "./basic-module.js"],
+  // In no-dynamic-import-in-module.any.js, this module is also statically imported
+  ["Another module URL", "./basic-module-2.js"],
+  [
+    "Module data: URL",
+    "data:text/javascript;charset=utf-8," +
+      encodeURIComponent(`export default 'hello!';`),
+  ],
+];
+
+for (const [name, url] of importUrlTests) {
+  promise_test(
+    (t) => promise_rejects_js(t, TypeError, import(url), "Import must reject"),
+    name
+  );
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesperformancetimelineworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/performance-timeline-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/performance-timeline-worker.js        2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/performance-timeline-worker.js   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -30,12 +30,12 @@
</span><span class="cx">   }, 'User Timing');
</span><span class="cx"> 
</span><span class="cx"> promise_test(function(test) {
</span><del>-    return fetch('dummy.txt')
</del><ins>+    return fetch('sample.txt')
</ins><span class="cx">       .then(function(resp) {
</span><span class="cx">           return resp.text();
</span><span class="cx">         })
</span><span class="cx">       .then(function(text) {
</span><del>-          var expectedResources = ['testharness.js', 'dummy.txt'];
</del><ins>+          var expectedResources = ['testharness.js', 'sample.txt'];
</ins><span class="cx">           assert_equals(performance.getEntriesByType('resource').length, expectedResources.length);
</span><span class="cx">           for (var i = 0; i < expectedResources.length; i++) {
</span><span class="cx">               var entry = performance.getEntriesByType('resource')[i];
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">                 resolve('bufferfull');
</span><span class="cx">               }
</span><span class="cx">               performance.setResourceTimingBufferSize(expectedResources.length);
</span><del>-              fetch('dummy.txt');
</del><ins>+              fetch('sample.txt');
</ins><span class="cx">           });
</span><span class="cx">         })
</span><span class="cx">       .then(function(result) {
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcespostmessagefetchedtextjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/postmessage-fetched-text.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/postmessage-fetched-text.js                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/postmessage-fetched-text.js      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+self.onmessage = async (e) => {
+  const response = await fetch(e.data);
+  const text = await response.text();
+  self.postMessage(text);
+};
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesredirectworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/redirect-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/redirect-worker.js    2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/redirect-worker.js       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -117,6 +117,13 @@
</span><span class="cx">     event.respondWith(waitUntilPromise.then(async () => {
</span><span class="cx">       if (params['sw'] == 'gen') {
</span><span class="cx">         return Response.redirect(params['url']);
</span><ins>+      } else if (params['sw'] == 'gen-manual') {
+        // Note this differs from Response.redirect() in that relative URLs are
+        // preserved.
+        return new Response("", {
+          status: 301,
+          headers: {location: params['url']},
+        });
</ins><span class="cx">       } else if (params['sw'] == 'fetch') {
</span><span class="cx">         return fetch(event.request);
</span><span class="cx">       } else if (params['sw'] == 'fetch-url') {
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesregistrationtestsbasicjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-basic.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-basic.js   2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-basic.js      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,44 +0,0 @@
</span><del>-// Basic registration tests that succeed. We don't want too many successful
-// registration tests in the same file since starting a service worker can be
-// slow.
-function registration_tests_basic(register_method, check_error_types) {
-  promise_test(function(t) {
-      var script = 'resources/registration-worker.js';
-      var scope = 'resources/registration/normal';
-      return register_method(script, {scope: scope})
-        .then(function(registration) {
-            assert_true(
-              registration instanceof ServiceWorkerRegistration,
-              'Successfully registered.');
-            return registration.unregister();
-          });
-    }, 'Registering normal scope');
-
-  promise_test(function(t) {
-      var script = 'resources/registration-worker.js';
-      var scope = 'resources/registration/scope-with-fragment#ref';
-      return register_method(script, {scope: scope})
-        .then(function(registration) {
-            assert_true(
-              registration instanceof ServiceWorkerRegistration,
-              'Successfully registered.');
-            assert_equals(
-              registration.scope,
-              normalizeURL('resources/registration/scope-with-fragment'),
-              'A fragment should be removed from scope')
-            return registration.unregister();
-          });
-    }, 'Registering scope with fragment');
-
-  promise_test(function(t) {
-      var script = 'resources/registration-worker.js';
-      var scope = 'resources/';
-      return register_method(script, {scope: scope})
-        .then(function(registration) {
-            assert_true(
-              registration instanceof ServiceWorkerRegistration,
-              'Successfully registered.');
-            return registration.unregister();
-          });
-    }, 'Registering same scope as the script directory');
-}
</del></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesregistrationtestsscriptjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-script.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-script.js  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-script.js     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> // Registration tests that mostly exercise the service worker script contents or
</span><span class="cx"> // response.
</span><del>-function registration_tests_script(register_method) {
</del><ins>+function registration_tests_script(register_method, type) {
</ins><span class="cx">   promise_test(function(t) {
</span><span class="cx">       var script = 'resources/invalid-chunked-encoding.py';
</span><span class="cx">       var scope = 'resources/scope/invalid-chunked-encoding/';
</span><span class="lines">@@ -46,15 +46,46 @@
</span><span class="cx">           'Registration of script including uncaught exception should fail.');
</span><span class="cx">     }, 'Registering script including uncaught exception');
</span><span class="cx"> 
</span><del>-  promise_test(function(t) {
-      var script = 'resources/malformed-worker.py?import-malformed-script';
-      var scope = 'resources/scope/import-malformed-script';
-      return promise_rejects_js(t,
-          TypeError,
-          register_method(script, {scope: scope}),
-          'Registration of script importing malformed script should fail.');
-    }, 'Registering script importing malformed script');
</del><ins>+  if (type === 'classic') {
+    promise_test(function(t) {
+        var script = 'resources/malformed-worker.py?import-malformed-script';
+        var scope = 'resources/scope/import-malformed-script';
+        return promise_rejects_js(t,
+            TypeError,
+            register_method(script, {scope: scope}),
+            'Registration of script importing malformed script should fail.');
+      }, 'Registering script importing malformed script');
+  }
</ins><span class="cx"> 
</span><ins>+  if (type === 'module') {
+    promise_test(function(t) {
+        var script = 'resources/malformed-worker.py?top-level-await';
+        var scope = 'resources/scope/top-level-await';
+        return promise_rejects_js(t,
+            TypeError,
+            register_method(script, {scope: scope}),
+            'Registration of script with top-level await should fail.');
+      }, 'Registering script with top-level await');
+
+    promise_test(function(t) {
+        var script = 'resources/malformed-worker.py?instantiation-error';
+        var scope = 'resources/scope/instantiation-error';
+        return promise_rejects_js(t,
+            TypeError,
+            register_method(script, {scope: scope}),
+            'Registration of script with module instantiation error should fail.');
+      }, 'Registering script with module instantiation error');
+
+    promise_test(function(t) {
+        var script = 'resources/malformed-worker.py?instantiation-error-and-top-level-await';
+        var scope = 'resources/scope/instantiation-error-and-top-level-await';
+        return promise_rejects_js(t,
+            TypeError,
+            register_method(script, {scope: scope}),
+            'Registration of script with module instantiation error and top-level await should fail.');
+      }, 'Registering script with module instantiation error and top-level await');
+  }
+
</ins><span class="cx">   promise_test(function(t) {
</span><span class="cx">       var script = 'resources/no-such-worker.js';
</span><span class="cx">       var scope = 'resources/scope/no-such-worker';
</span><span class="lines">@@ -64,14 +95,16 @@
</span><span class="cx">           'Registration of non-existent script should fail.');
</span><span class="cx">     }, 'Registering non-existent script');
</span><span class="cx"> 
</span><del>-  promise_test(function(t) {
-      var script = 'resources/malformed-worker.py?import-no-such-script';
-      var scope = 'resources/scope/import-no-such-script';
-      return promise_rejects_js(t,
-          TypeError,
-          register_method(script, {scope: scope}),
-          'Registration of script importing non-existent script should fail.');
-    }, 'Registering script importing non-existent script');
</del><ins>+  if (type === 'classic') {
+    promise_test(function(t) {
+        var script = 'resources/malformed-worker.py?import-no-such-script';
+        var scope = 'resources/scope/import-no-such-script';
+        return promise_rejects_js(t,
+            TypeError,
+            register_method(script, {scope: scope}),
+            'Registration of script importing non-existent script should fail.');
+      }, 'Registering script importing non-existent script');
+  }
</ins><span class="cx"> 
</span><span class="cx">   promise_test(function(t) {
</span><span class="cx">       var script = 'resources/malformed-worker.py?caught-exception';
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesresourcetimingiframesubhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/resource-timing-iframe.sub.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/resource-timing-iframe.sub.html       2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/resource-timing-iframe.sub.html  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> <!DOCTYPE html>
</span><span class="cx"> <script src="empty.js"></script>
</span><del>-<script src="dummy.js"></script>
</del><ins>+<script src="sample.js"></script>
</ins><span class="cx"> <script src="redirect.py?Redirect=empty.js"></script>
</span><span class="cx"> <img src="square.png">
</span><span class="cx"> <img src="https://{{hosts[alt][]}}:{{ports[https][0]}}/service-workers/service-worker/resources/square.png">
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesresourcetimingworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/resource-timing-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/resource-timing-worker.js     2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/resource-timing-worker.js        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> self.addEventListener('fetch', function(event) {
</span><del>-  if (event.request.url.indexOf('dummy.js') != -1) {
</del><ins>+  if (event.request.url.indexOf('sample.js') != -1) {
</ins><span class="cx">     event.respondWith(new Promise(resolve => {
</span><span class="cx">       // Slightly delay the response so we ensure we get a non-zero
</span><span class="cx">       // duration.
</span><span class="lines">@@ -7,6 +7,6 @@
</span><span class="cx">     }));
</span><span class="cx">   }
</span><span class="cx">   else if (event.request.url.indexOf('missing.jpg?SWRespondsWithFetch') != -1) {
</span><del>-    event.respondWith(fetch('dummy.txt?SWFetched'));
</del><ins>+    event.respondWith(fetch('sample.txt?SWFetched'));
</ins><span class="cx">   }
</span><span class="cx"> });
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcessampleworkerinterceptorjsfromrev279388trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesdummyworkerinterceptorjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample-worker-interceptor.js (from rev 279388, trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy-worker-interceptor.js) (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample-worker-interceptor.js                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample-worker-interceptor.js     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+importScripts('/common/get-host-info.sub.js');
+
+const text = 'worker loading intercepted by service worker';
+const dedicated_worker_script = `postMessage('${text}');`;
+const shared_worker_script =
+    `onconnect = evt => evt.ports[0].postMessage('${text}');`;
+
+self.onfetch = event => {
+  const url = event.request.url;
+  const destination = event.request.destination;
+
+  // Request handler for a synthesized response.
+  if (url.indexOf('synthesized') != -1) {
+    let script_headers = new Headers({ "Content-Type": "text/javascript" });
+    if (destination === 'worker')
+      event.respondWith(new Response(dedicated_worker_script, { 'headers': script_headers }));
+    else if (destination === 'sharedworker')
+      event.respondWith(new Response(shared_worker_script, { 'headers': script_headers }));
+    else
+      event.respondWith(new Response('Unexpected request! ' + destination));
+    return;
+  }
+
+  // Request handler for a same-origin response.
+  if (url.indexOf('same-origin') != -1) {
+    event.respondWith(fetch('postmessage-on-load-worker.js'));
+    return;
+  }
+
+  // Request handler for a cross-origin response.
+  if (url.indexOf('cors') != -1) {
+    const filename = 'postmessage-on-load-worker.js';
+    const path = (new URL(filename, self.location)).pathname;
+    let new_url = get_host_info()['HTTPS_REMOTE_ORIGIN'] + path;
+    let mode;
+    if (url.indexOf('no-cors') != -1) {
+      // Test no-cors mode.
+      mode = 'no-cors';
+    } else {
+      // Test cors mode.
+      new_url += '?pipe=header(Access-Control-Allow-Origin,*)';
+      mode = 'cors';
+    }
+    event.respondWith(fetch(new_url, { mode: mode }));
+  }
+};
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcessamplehtmlfromrev279388trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesdummyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample.html (from rev 279388, trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy.html) (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample.html                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample.html      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+<!DOCTYPE html>
+<body>Hello world
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcessampletxtfromrev279388trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesdummytxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample.txt (from rev 279388, trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy.txt) (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample.txt                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample.txt       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Hello world
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesscope1moduleworkerimportingredirecttoscope2js"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/module-worker-importing-redirect-to-scope2.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/module-worker-importing-redirect-to-scope2.js                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/module-worker-importing-redirect-to-scope2.js     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+import * as module from './redirect.py?Redirect=/service-workers/service-worker/resources/scope2/imported-module-script.js';
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesscope1moduleworkerimportingscope2js"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/module-worker-importing-scope2.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/module-worker-importing-scope2.js                              (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/module-worker-importing-scope2.js 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+import * as module from '../scope2/imported-module-script.js';
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesscope1w3cimportlog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/w3c-import.log (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/w3c-import.log 2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/w3c-import.log    2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -14,4 +14,6 @@
</span><span class="cx"> None
</span><span class="cx"> ------------------------------------------------------------------------
</span><span class="cx"> List of files:
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/module-worker-importing-redirect-to-scope2.js
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/module-worker-importing-scope2.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/redirect.py
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesscope2importedmodulescriptjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope2/imported-module-script.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope2/imported-module-script.js                              (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope2/imported-module-script.js 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+export const imported = 'A module script.';
+onmessage = msg => {
+    msg.source.postMessage('pong');
+};
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesscope2w3cimportlog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope2/w3c-import.log (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope2/w3c-import.log 2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope2/w3c-import.log    2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -14,4 +14,5 @@
</span><span class="cx"> None
</span><span class="cx"> ------------------------------------------------------------------------
</span><span class="cx"> List of files:
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope2/imported-module-script.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope2/worker_interception_redirect_webworker.py
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcessubdirblankhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/subdir/blank.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/subdir/blank.html                             (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/subdir/blank.html        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+<!DOCTYPE html>
+<title>Empty doc</title>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcessubdirw3cimportlogfromrev279388trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesscope1w3cimportlog"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/subdir/w3c-import.log (from rev 279388, trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/scope1/w3c-import.log) (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/subdir/w3c-import.log                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/subdir/w3c-import.log    2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+       https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/subdir/blank.html
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcestesthelperssubjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-helpers.sub.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-helpers.sub.js   2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-helpers.sub.js      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -92,56 +92,66 @@
</span><span class="cx">     }));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function wait_for_state(test, worker, state) {
-  if (!worker || worker.state == undefined) {
-    return Promise.reject(new Error(
-      'wait_for_state must be passed a ServiceWorker'));
-  }
-  if (worker.state === state)
-    return Promise.resolve(state);
-
-  if (state === 'installing') {
-    switch (worker.state) {
</del><ins>+// Return true if |state_a| is more advanced than |state_b|.
+function is_state_advanced(state_a, state_b) {
+  if (state_b === 'installing') {
+    switch (state_a) {
</ins><span class="cx">       case 'installed':
</span><span class="cx">       case 'activating':
</span><span class="cx">       case 'activated':
</span><span class="cx">       case 'redundant':
</span><del>-        return Promise.reject(new Error(
-          'worker is ' + worker.state + ' but waiting for ' + state));
</del><ins>+        return true;
</ins><span class="cx">     }
</span><span class="cx">   }
</span><span class="cx"> 
</span><del>-  if (state === 'installed') {
-    switch (worker.state) {
</del><ins>+  if (state_b === 'installed') {
+    switch (state_a) {
</ins><span class="cx">       case 'activating':
</span><span class="cx">       case 'activated':
</span><span class="cx">       case 'redundant':
</span><del>-        return Promise.reject(new Error(
-          'worker is ' + worker.state + ' but waiting for ' + state));
</del><ins>+        return true;
</ins><span class="cx">     }
</span><span class="cx">   }
</span><span class="cx"> 
</span><del>-  if (state === 'activating') {
-    switch (worker.state) {
</del><ins>+  if (state_b === 'activating') {
+    switch (state_a) {
</ins><span class="cx">       case 'activated':
</span><span class="cx">       case 'redundant':
</span><del>-        return Promise.reject(new Error(
-          'worker is ' + worker.state + ' but waiting for ' + state));
</del><ins>+        return true;
</ins><span class="cx">     }
</span><span class="cx">   }
</span><span class="cx"> 
</span><del>-  if (state === 'activated') {
-    switch (worker.state) {
</del><ins>+  if (state_b === 'activated') {
+    switch (state_a) {
</ins><span class="cx">       case 'redundant':
</span><del>-        return Promise.reject(new Error(
-          'worker is ' + worker.state + ' but waiting for ' + state));
</del><ins>+        return true;
</ins><span class="cx">     }
</span><span class="cx">   }
</span><ins>+  return false;
+}
</ins><span class="cx"> 
</span><del>-  return new Promise(test.step_func(function(resolve) {
</del><ins>+function wait_for_state(test, worker, state) {
+  if (!worker || worker.state == undefined) {
+    return Promise.reject(new Error(
+      'wait_for_state needs a ServiceWorker object to be passed.'));
+  }
+  if (worker.state === state)
+    return Promise.resolve(state);
+
+  if (is_state_advanced(worker.state, state)) {
+    return Promise.reject(new Error(
+      `Waiting for ${state} but the worker is already ${worker.state}.`));
+  }
+  return new Promise(test.step_func(function(resolve, reject) {
</ins><span class="cx">       worker.addEventListener('statechange', test.step_func(function() {
</span><span class="cx">           if (worker.state === state)
</span><span class="cx">             resolve(state);
</span><ins>+
+          if (is_state_advanced(worker.state, state)) {
+            reject(new Error(
+              `The state of the worker becomes ${worker.state} while waiting` +
+                `for ${state}.`));
+          }
</ins><span class="cx">         }));
</span><span class="cx">     }));
</span><span class="cx"> }
</span><span class="lines">@@ -274,13 +284,13 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// Registers, waits for activation, then unregisters on a dummy scope.
</del><ins>+// Registers, waits for activation, then unregisters on a sample scope.
</ins><span class="cx"> //
</span><span class="cx"> // This can be used to wait for a period of time needed to register,
</span><span class="cx"> // activate, and then unregister a service worker.  When checking that
</span><span class="cx"> // certain behavior does *NOT* happen, this is preferable to using an
</span><span class="cx"> // arbitrary delay.
</span><del>-async function wait_for_activation_on_dummy_scope(t, window_or_workerglobalscope) {
</del><ins>+async function wait_for_activation_on_sample_scope(t, window_or_workerglobalscope) {
</ins><span class="cx">   const script = '/service-workers/service-worker/resources/empty-worker.js';
</span><span class="cx">   const scope = 'resources/there/is/no/there/there?' + Date.now();
</span><span class="cx">   let registration = await window_or_workerglobalscope.navigator.serviceWorker.register(script, { scope });
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcestestrequestmodeworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-request-mode-worker.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-request-mode-worker.js                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-request-mode-worker.js      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+// Add a unique UUID per request to induce service worker script update.
+// Time stamp: %UUID%
+
+// The server injects the request headers here as a JSON string.
+const headersAsJson = `%HEADERS%`;
+const headers = JSON.parse(headersAsJson);
+
+self.addEventListener('message', async (e) => {
+  e.source.postMessage(headers);
+});
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcestestrequestmodeworkerpy"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-request-mode-worker.py (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-request-mode-worker.py                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-request-mode-worker.py      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+import json
+import os
+import uuid
+import sys
+
+from wptserve.utils import isomorphic_decode
+
+def main(request, response):
+  path = os.path.join(os.path.dirname(isomorphic_decode(__file__)),
+                      u"test-request-mode-worker.js")
+  body = open(path, u"rb").read()
+
+  data = {isomorphic_decode(key):isomorphic_decode(request.headers[key]) for key, value in request.headers.items()}
+
+  body = body.replace(b"%HEADERS%", json.dumps(data).encode("utf-8"))
+  body = body.replace(b"%UUID%", str(uuid.uuid4()).encode("utf-8"))
+
+  headers = []
+  headers.append((b"ETag", b"etag"))
+  headers.append((b"Content-Type", b'text/javascript'))
+
+  return headers, body
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcestestharnesshelpersjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/testharness-helpers.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/testharness-helpers.js        2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/testharness-helpers.js   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">       assert_equals(actual, expected, prefix);
</span><span class="cx">       return;
</span><span class="cx">     }
</span><del>-    assert_true(typeof expected === 'object', prefix);
</del><ins>+    assert_equals(typeof expected, 'object', prefix);
</ins><span class="cx">     assert_equals(object_stack.indexOf(actual), -1,
</span><span class="cx">                   prefix + ' must not contain cyclic references.');
</span><span class="cx"> 
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx"> // FIXME: Remove assert_will_be_idl_attribute once we complete the transition
</span><span class="cx"> // of moving the DOM attributes to prototype chains.  (http://crbug.com/43394)
</span><span class="cx"> function assert_will_be_idl_attribute(object, attribute_name, description) {
</span><del>-  assert_true(typeof object === "object", description);
</del><ins>+  assert_equals(typeof object, "object", description);
</ins><span class="cx"> 
</span><span class="cx">   assert_true("hasOwnProperty" in object, description);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcestypecheckworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/type-check-worker.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/type-check-worker.js                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/type-check-worker.js     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+let type = '';
+try {
+  importScripts('empty.js');
+  type = 'classic';
+} catch (e) {
+  type = 'module';
+}
+onmessage = e => {
+  e.source.postMessage(type);
+};
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesunregisterimmediatelyhelpersjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/unregister-immediately-helpers.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/unregister-immediately-helpers.js     2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/unregister-immediately-helpers.js        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -14,6 +14,6 @@
</span><span class="cx"> async function add_controlled_iframe(test, url) {
</span><span class="cx">   const frame = await with_iframe(url);
</span><span class="cx">   test.add_cleanup(() => { frame.remove(); });
</span><del>-  assert_true(frame.contentWindow.navigator.serviceWorker.controller !== null);
</del><ins>+  assert_not_equals(frame.contentWindow.navigator.serviceWorker.controller, null);
</ins><span class="cx">   return frame;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesw3cimportlog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/w3c-import.log (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/w3c-import.log        2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/w3c-import.log   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -27,9 +27,12 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/appcache-ordering.is-appcached.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/appcache-ordering.is-appcached.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/appcache-ordering.manifest
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/basic-module-2.js
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/basic-module.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/blank.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/bytecheck-worker-imported-script.py
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/bytecheck-worker.py
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/claim-blob-url-worker-fetch-iframe.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/claim-nested-worker-fetch-iframe.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/claim-nested-worker-fetch-parent-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/claim-shared-worker-fetch-iframe.html
</span><span class="lines">@@ -43,6 +46,8 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-navigate-frame.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-navigate-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-navigated-frame.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-url-of-blob-url-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/client-url-of-blob-url-worker.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-frame-freeze.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-get-client-types-frame-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-get-client-types-frame.html
</span><span class="lines">@@ -53,6 +58,7 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-get-other-origin.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-get-resultingClientId-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-get-worker.js
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-matchall-blob-url-worker.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-matchall-client-types-dedicated-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-matchall-client-types-iframe.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/clients-matchall-client-types-shared-worker.js
</span><span class="lines">@@ -61,9 +67,8 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/cors-approved.txt
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/cors-approved.txt.headers
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/cors-denied.txt
</span><del>-/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy-worker-interceptor.js
-/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy.html
-/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/dummy.txt
</del><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/create-blob-url-worker.js
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/create-out-of-scope-worker.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/echo-content.py
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/echo-cookie-worker.py
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/echo-message-to-source-worker.js
</span><span class="lines">@@ -139,6 +144,7 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-resources-iframe.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-resources-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-iframe.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-sync-error-worker.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-sync-iframe.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-sync-on-worker-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-request-xhr-sync-worker.js
</span><span class="lines">@@ -155,6 +161,7 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/http-to-https-redirect-and-register-iframe.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/iframe-with-image.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/immutable-prototype-serviceworker.js
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-echo-cookie-worker-module.py
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-echo-cookie-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-mime-type-worker.py
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-relative.xsl
</span><span class="lines">@@ -161,6 +168,7 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-scripts-404-after-update-plus-update-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-scripts-404-after-update.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-scripts-404.js
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-scripts-cross-origin-worker.sub.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-scripts-diff-resource-map-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-scripts-echo.py
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/import-scripts-get.py
</span><span class="lines">@@ -209,8 +217,12 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-to-http-iframe.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-to-http-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/navigation-timing-worker.js
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-blob-url-worker-created-from-worker.html
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-blob-url-workers.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-iframe-parent.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested-worker-created-from-blob-url-worker.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/nested_load_worker.js
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/no-dynamic-import.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/notification_icon.py
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/object-image-is-not-intercepted-iframe.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/object-is-not-intercepted-iframe.html
</span><span class="lines">@@ -245,6 +257,7 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/postmessage-blob-url.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/postmessage-dictionary-transferables-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/postmessage-echo-worker.js
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/postmessage-fetched-text.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/postmessage-msgport-to-client-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/postmessage-on-load-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/postmessage-to-client-worker.js
</span><span class="lines">@@ -258,7 +271,6 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/referrer-policy-iframe.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/register-closed-window-iframe.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/register-iframe.html
</span><del>-/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-basic.js
</del><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-mime-types.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-scope.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/registration-tests-script-url.js
</span><span class="lines">@@ -275,6 +287,9 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/respond-with-body-accessed-response-iframe.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/respond-with-body-accessed-response-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/respond-with-body-accessed-response.jsonp
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample-worker-interceptor.js
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample.html
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample.txt
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sandboxed-iframe-fetch-event-iframe.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sandboxed-iframe-fetch-event-iframe.py
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sandboxed-iframe-fetch-event-worker.js
</span><span class="lines">@@ -299,8 +314,11 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-helpers.sub.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-request-headers-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-request-headers-worker.py
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-request-mode-worker.js
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/test-request-mode-worker.py
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/testharness-helpers.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/trickle.py
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/type-check-worker.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/unregister-controller-page.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/unregister-immediately-helpers.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/update-claim-worker.py
</span><span class="lines">@@ -331,6 +349,7 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/worker-load-interceptor.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/worker-testharness.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/worker_interception_redirect_webworker.py
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/xhr-content-length-worker.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/xhr-iframe.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/xhr-response-url-worker.js
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/xsl-base-url-iframe.xml
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourceswindowclientnavigateworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/windowclient-navigate-worker.js (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/windowclient-navigate-worker.js       2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/windowclient-navigate-worker.js  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,34 +1,33 @@
</span><span class="cx"> importScripts('/resources/testharness.js');
</span><span class="cx"> 
</span><del>-function match_query(query_string) {
-  return self.location.search.substr(1) == query_string;
</del><ins>+function matchQuery(queryString) {
+  return self.location.search.substr(1) === queryString;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-async function navigate_test(t, e) {
-  var port = e.data.port;
-  var url = e.data.url;
-  var expected = e.data.expected;
</del><ins>+async function navigateTest(t, e) {
+  const port = e.data.port;
+  const url = e.data.url;
+  const expected = e.data.expected;
</ins><span class="cx"> 
</span><del>-  var p = clients.matchAll({ includeUncontrolled : true })
-    .then(function(client_list) {
-        for (var i = 0; i < client_list.length; i++) {
-          var client = client_list[i];
-          if (client.frameType == 'nested') {
-            return client.navigate(url);
-          }
</del><ins>+  let p = clients.matchAll({ includeUncontrolled : true })
+    .then(function(clients) {
+      for (const client of clients) {
+        if (client.url === e.data.clientUrl) {
+          assert_equals(client.frameType, e.data.frameType);
+          return client.navigate(url);
</ins><span class="cx">         }
</span><del>-        throw 'Could not locate window client.';
-      })
-    .then(function(new_client) {
-        // If we didn't reject, we better get resolved with the right thing.
-        if (new_client === null) {
-          assert_equals(new_client, expected);
-        } else {
-          assert_equals(new_client.url, expected);
-        }
-      });
</del><ins>+      }
+      throw 'Could not locate window client.';
+    }).then(function(newClient) {
+      // If we didn't reject, we better get resolved with the right thing.
+      if (newClient === null) {
+        assert_equals(newClient, expected);
+      } else {
+        assert_equals(newClient.url, expected);
+      }
+    });
</ins><span class="cx"> 
</span><del>-  if (typeof self[expected] == "function") {
</del><ins>+  if (typeof self[expected] === "function") {
</ins><span class="cx">     // It's a JS error type name.  We are expecting our promise to be rejected
</span><span class="cx">     // with that error.
</span><span class="cx">     p = promise_rejects_js(t, self[expected], p);
</span><span class="lines">@@ -40,26 +39,24 @@
</span><span class="cx"> 
</span><span class="cx"> function getTestClient() {
</span><span class="cx">   return clients.matchAll({ includeUncontrolled: true })
</span><del>-    .then(function(client_list) {
-        for (var i = 0; i < client_list.length; i++) {
-          var client = client_list[i];
-
-          if (/windowclient-navigate\.https\.html/.test(client.url)) {
-            return client;
-          }
</del><ins>+    .then(function(clients) {
+      for (const client of clients) {
+        if (client.url.includes('windowclient-navigate.https.html')) {
+          return client;
</ins><span class="cx">         }
</span><ins>+      }
</ins><span class="cx"> 
</span><del>-        throw new Error('Service worker was unable to locate test client.');
-      });
</del><ins>+      throw new Error('Service worker was unable to locate test client.');
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function waitForMessage(client) {
</span><del>-  var channel = new MessageChannel();
</del><ins>+  const channel = new MessageChannel();
</ins><span class="cx">   client.postMessage({ port: channel.port2 }, [channel.port2]);
</span><span class="cx"> 
</span><span class="cx">   return new Promise(function(resolve) {
</span><del>-        channel.port1.onmessage = resolve;
-      });
</del><ins>+    channel.port1.onmessage = resolve;
+  });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // The worker must remain in the "installing" state for the duration of some
</span><span class="lines">@@ -66,13 +63,13 @@
</span><span class="cx"> // sub-tests. In order to achieve this coordination without relying on global
</span><span class="cx"> // state, the worker must create a message channel with the client from within
</span><span class="cx"> // the "install" event handler.
</span><del>-if (match_query('installing')) {
</del><ins>+if (matchQuery('installing')) {
</ins><span class="cx">   self.addEventListener('install', function(e) {
</span><del>-      e.waitUntil(getTestClient().then(waitForMessage));
-    });
</del><ins>+    e.waitUntil(getTestClient().then(waitForMessage));
+  });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> self.addEventListener('message', function(e) {
</span><del>-    e.waitUntil(promise_test(t => navigate_test(t, e),
-                             e.data.description + " worker side"));
-  });
</del><ins>+  e.waitUntil(promise_test(t => navigateTest(t, e),
+                           e.data.description + " worker side"));
+});
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerresourcesxhrcontentlengthworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/xhr-content-length-worker.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/xhr-content-length-worker.js                          (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/xhr-content-length-worker.js     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+// Service worker for the xhr-content-length test.
+
+self.addEventListener("fetch", event => {
+  const url = new URL(event.request.url);
+  const type = url.searchParams.get("type");
+
+  if (type === "no-content-length") {
+    event.respondWith(new Response("Hello!"));
+  }
+
+  if (type === "larger-content-length") {
+    event.respondWith(new Response("meeeeh", { headers: [["Content-Length", "10000"]] }));
+  }
+
+  if (type === "double-content-length") {
+    event.respondWith(new Response("meeeeh", { headers: [["Content-Length", "10000"], ["Content-Length", "10000"]] }));
+  }
+
+  if (type === "bogus-content-length") {
+    event.respondWith(new Response("meeeeh", { headers: [["Content-Length", "test"]] }));
+  }
+});
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkersvgtargetreftest001framehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/svg-target-reftest-001-frame.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/svg-target-reftest-001-frame.html                               (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/svg-target-reftest-001-frame.html  2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<img src="/images/green.svg">
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkersvgtargetreftesthttpsexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/svg-target-reftest.https-expected.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/svg-target-reftest.https-expected.html  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/svg-target-reftest.https-expected.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -2,4 +2,4 @@
</span><span class="cx"> <meta charset="utf-8">
</span><span class="cx"> <title>Green svg box reference file</title>
</span><span class="cx"> <p>Pass if you see a green box below.</p>
</span><del>-<iframe src="resources/svg-target-reftest-001-frame.html">
</del><ins>+<iframe src="svg-target-reftest-001-frame.html">
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerupdateafteronedayhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-after-oneday.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-after-oneday.https.html  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-after-oneday.https.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">         })
</span><span class="cx">       .then(function() {
</span><span class="cx">           // Trigger a non-navigation fetch event
</span><del>-          frame.contentWindow.load_image(normalizeURL('resources/update/dummy'));
</del><ins>+          frame.contentWindow.load_image(normalizeURL('resources/update/sample'));
</ins><span class="cx">           return wait_for_update(t, registration);
</span><span class="cx">        })
</span><span class="cx">        .then(function() {
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerupdatebytecheckcorsimporthttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck-cors-import.https-expected.txt (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck-cors-import.https-expected.txt                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck-cors-import.https-expected.txt    2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+
+Harness Error (TIMEOUT), message = null
+
+PASS Test(main: default, imported: default)
+TIMEOUT Test(main: default, imported: time) Test timed out
+NOTRUN Test(main: time, imported: default)
+NOTRUN Test(main: time, imported: time)
+NOTRUN Test module script(main: default, imported: default)
+NOTRUN Test module script(main: default, imported: time)
+NOTRUN Test module script(main: time, imported: default)
+NOTRUN Test module script(main: time, imported: time)
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerupdatebytecheckcorsimporthttpshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck-cors-import.https.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck-cors-import.https.html                         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck-cors-import.https.html    2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+<!doctype html>
+<meta charset=utf-8>
+<title></title>
+<meta name="timeout" content="long">
+<script src="/resources/testharness.js"></script>
+<script src="resources/testharness-helpers.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script>
+// Tests of updating a service worker. This file contains cors cases only.
+
+/*
+ * @param string main
+ *   Decide the content of the main script, where 'default' is for constant
+ *   content while 'time' is for time-variant content.
+ * @param string imported
+ *   Decide the content of the imported script, where 'default' is for constant
+ *   content while 'time' is for time-variant content.
+ */
+const settings = [{main: 'default', imported: 'default'},
+                  {main: 'default', imported: 'time'   },
+                  {main: 'time',    imported: 'default'},
+                  {main: 'time',    imported: 'time'   }];
+
+const host_info = get_host_info();
+settings.forEach(({main, imported}) => {
+  promise_test(async (t) => {
+    // Specify a cross origin path to load imported scripts from a cross origin.
+    const path = host_info.HTTPS_REMOTE_ORIGIN +
+                 '/service-workers/service-worker/resources/';
+    const script = 'resources/bytecheck-worker.py' +
+                   '?main=' + main +
+                   '&imported=' + imported +
+                   '&path=' + path +
+                   '&type=classic';
+    const scope = 'resources/blank.html';
+
+    // Register a service worker.
+    const swr = await service_worker_unregister_and_register(t, script, scope);
+    t.add_cleanup(() => swr.unregister());
+    const sw = await wait_for_update(t, swr);
+    await wait_for_state(t, sw, 'activated');
+    assert_array_equals([swr.active, swr.waiting, swr.installing],
+                        [sw, null, null]);
+
+    // Update the service worker registration.
+    await swr.update();
+
+    // If there should be a new service worker.
+    if (main === 'time' || imported === 'time') {
+      return wait_for_update(t, swr);
+    }
+    // Otherwise, make sure there is no newly created service worker.
+    assert_array_equals([swr.active, swr.waiting, swr.installing],
+                        [sw, null, null]);
+  }, `Test(main: ${main}, imported: ${imported})`);
+});
+
+settings.forEach(({main, imported}) => {
+  promise_test(async (t) => {
+    // Specify a cross origin path to load imported scripts from a cross origin.
+    const path = host_info.HTTPS_REMOTE_ORIGIN +
+                 '/service-workers/service-worker/resources/';
+    const script = 'resources/bytecheck-worker.py' +
+                   '?main=' + main +
+                   '&imported=' + imported +
+                   '&path=' + path +
+                   '&type=module';
+    const scope = 'resources/blank.html';
+
+    // Register a service worker.
+    const swr = await service_worker_unregister_and_register(t, script, scope, {type: 'module'});
+    t.add_cleanup(() => swr.unregister());
+    const sw = await wait_for_update(t, swr);
+    await wait_for_state(t, sw, 'activated');
+    assert_array_equals([swr.active, swr.waiting, swr.installing],
+                        [sw, null, null]);
+
+    // Update the service worker registration.
+    await swr.update();
+
+    // If there should be a new service worker.
+    if (main === 'time' || imported === 'time') {
+      return wait_for_update(t, swr);
+    }
+    // Otherwise, make sure there is no newly created service worker.
+    assert_array_equals([swr.active, swr.waiting, swr.installing],
+                        [sw, null, null]);
+  }, `Test module script(main: ${main}, imported: ${imported})`);
+});
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerupdatebytecheckhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck.https.html     2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck.https.html        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -8,10 +8,9 @@
</span><span class="cx"> <script src="resources/test-helpers.sub.js"></script>
</span><span class="cx"> <script src="/common/get-host-info.sub.js"></script>
</span><span class="cx"> <script>
</span><ins>+// Tests of updating a service worker. This file contains non-cors cases only.
</ins><span class="cx"> 
</span><span class="cx"> /*
</span><del>- * @param bolean cors
- *   Determine wether the imported script should be a cross origin script.
</del><span class="cx">  * @param string main
</span><span class="cx">  *   Decide the content of the main script, where 'default' is for constant
</span><span class="cx">  *   content while 'time' is for time-variant content.
</span><span class="lines">@@ -19,57 +18,75 @@
</span><span class="cx">  *   Decide the content of the imported script, where 'default' is for constant
</span><span class="cx">  *   content while 'time' is for time-variant content.
</span><span class="cx">  */
</span><del>-const settings = [{cors: false, main: 'default', imported: 'default'},
-                  {cors: false, main: 'default', imported: 'time'   },
-                  {cors: false, main: 'time',    imported: 'default'},
-                  {cors: false, main: 'time',    imported: 'time'   },
-                  {cors: true,  main: 'default', imported: 'default'},
-                  {cors: true,  main: 'default', imported: 'time'   },
-                  {cors: true,  main: 'time',    imported: 'default'},
-                  {cors: true,  main: 'time',    imported: 'time'   }];
</del><ins>+const settings = [{main: 'default', imported: 'default'},
+                  {main: 'default', imported: 'time'   },
+                  {main: 'time',    imported: 'default'},
+                  {main: 'time',    imported: 'time'   }];
</ins><span class="cx"> 
</span><span class="cx"> const host_info = get_host_info();
</span><del>-settings.reduce((p, s) => {
-  return p.then(promise_test(function(t) {
-    var path = !s.cors ? ''
-                       : host_info.HTTPS_REMOTE_ORIGIN +
-                         '/service-workers/service-worker/resources/';
-    var script = 'resources/bytecheck-worker.py' +
-                 '?main=' + s.main +
-                 '&imported=' + s.imported +
-                 '&path=' + path;
-    var scope = 'resources/blank.html';
</del><ins>+settings.forEach(({main, imported}) => {
+  promise_test(async (t) => {
+    // Empty path results in the same origin imported scripts.
+    const path = '';
+    const script = 'resources/bytecheck-worker.py' +
+                   '?main=' + main +
+                   '&imported=' + imported +
+                   '&path=' + path +
+                   '&type=classic';
+    const scope = 'resources/blank.html';
</ins><span class="cx"> 
</span><del>-    var swr, sw;
-    return Promise.resolve()
-      // Register a service worker.
-      .then(_ => service_worker_unregister_and_register(t, script, scope))
-      .then(r => {
-        t.add_cleanup(() => service_worker_unregister(t, scope));
-        swr = r;
-        return wait_for_update(t, swr);
-      })
-      .then(w => sw = w)
-      .then(_ => wait_for_state(t, sw, 'activated'))
-      .then(_ => assert_array_equals([swr.active,
-                                      swr.waiting,
-                                      swr.installing],
-                                     [sw, null, null]))
</del><ins>+    // Register a service worker.
+    const swr = await service_worker_unregister_and_register(t, script, scope);
+    t.add_cleanup(() => swr.unregister());
+    const sw = await wait_for_update(t, swr);
+    await wait_for_state(t, sw, 'activated');
+    assert_array_equals([swr.active, swr.waiting, swr.installing],
+                        [sw, null, null]);
</ins><span class="cx"> 
</span><del>-      // Update the service worker registration.
-      .then(_ => swr.update())
-      .then(_ => {
-         // If there should be a new service worker.
-         if (s.main === 'time' || s.imported === 'time') {
-           return wait_for_update(t, swr);
-         }
-         // Otherwise, make sure there is no newly created service worker.
-         assert_array_equals([swr.active,
-                              swr.waiting,
-                              swr.installing],
-                             [sw, null, null]);
-      });
-  }, `Test(cors: ${s.cors}, main: ${s.main}, imported: ${s.imported})`));
-}, Promise.resolve());
</del><ins>+    // Update the service worker registration.
+    await swr.update();
</ins><span class="cx"> 
</span><ins>+    // If there should be a new service worker.
+    if (main === 'time' || imported === 'time') {
+      return wait_for_update(t, swr);
+    }
+    // Otherwise, make sure there is no newly created service worker.
+    assert_array_equals([swr.active, swr.waiting, swr.installing],
+                        [sw, null, null]);
+  }, `Test(main: ${main}, imported: ${imported})`);
+});
+
+settings.forEach(({main, imported}) => {
+  promise_test(async (t) => {
+    // Empty path results in the same origin imported scripts.
+    const path = './';
+    const script = 'resources/bytecheck-worker.py' +
+                   '?main=' + main +
+                   '&imported=' + imported +
+                   '&path=' + path +
+                   '&type=module';
+    const scope = 'resources/blank.html';
+
+    // Register a module service worker.
+    const swr = await service_worker_unregister_and_register(t, script, scope,
+                                                            {type: 'module'});
+
+    t.add_cleanup(() => swr.unregister());
+    const sw = await wait_for_update(t, swr);
+    await wait_for_state(t, sw, 'activated');
+    assert_array_equals([swr.active, swr.waiting, swr.installing],
+                        [sw, null, null]);
+
+    // Update the service worker registration.
+    await swr.update();
+
+    // If there should be a new service worker.
+    if (main === 'time' || imported === 'time') {
+      return wait_for_update(t, swr);
+    }
+    // Otherwise, make sure there is no newly created service worker.
+    assert_array_equals([swr.active, swr.waiting, swr.installing],
+                        [sw, null, null]);
+  }, `Test module script(main: ${main}, imported: ${imported})`);
+});
</ins><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerupdatemodulerequestmodehttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-module-request-mode.https-expected.txt (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-module-request-mode.https-expected.txt                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-module-request-mode.https-expected.txt      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+FAIL headers of a main module script assert_equals: expected (string) "same-origin" but got (undefined) undefined
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerupdatemodulerequestmodehttpshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-module-request-mode.https.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-module-request-mode.https.html                           (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-module-request-mode.https.html      2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<!DOCTYPE html>
+<meta charset="utf-8">
+<meta name="timeout" content="long">
+<title>Test that mode is set to same-origin for a main module</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<script>
+// Tests a main module service worker script fetch during an update check.
+// The fetch should have the mode set to 'same-origin'.
+//
+// The test works by registering a main module service worker. It then does an
+// update. The test server responds with an updated worker script that remembers
+// the http request. The updated worker reports back this request to the test
+// page.
+promise_test(async (t) => {
+  const script = "resources/test-request-mode-worker.py";
+  const scope = "resources/";
+
+  // Register the service worker.
+  await service_worker_unregister(t, scope);
+  const registration = await navigator.serviceWorker.register(
+      script, {scope, type: 'module'});
+  await wait_for_state(t, registration.installing, 'activated');
+
+  // Do an update.
+  await registration.update();
+
+  // Ask the new worker what the request was.
+  const newWorker = registration.installing;
+  const sawMessage = new Promise((resolve) => {
+    navigator.serviceWorker.onmessage = (event) => {
+      resolve(event.data);
+    };
+  });
+  newWorker.postMessage('getHeaders');
+  const result = await sawMessage;
+
+  // Test the result.
+  assert_equals(result['sec-fetch-mode'], 'same-origin');
+  assert_equals(result['origin'], undefined);
+
+}, 'headers of a main module script');
+
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerw3cimportlog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/w3c-import.log (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/w3c-import.log  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/w3c-import.log     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -31,10 +31,12 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-worker-fetch.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-id.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-navigate.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-url-of-blob-url-worker.https.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-get-client-types.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-get-cross-origin.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-get-resultingClientId.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-get.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-blob-url-worker.https.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-client-types.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-exact-controller.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-frozen.https.html
</span><span class="lines">@@ -69,10 +71,6 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-after-navigation-within-page.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-async-respond-with.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-handled.https.html
</span><del>-/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-backward-navigation-manual.https.html
-/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-history-forward-navigation-manual.https.html
-/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-iframe-navigation-manual.https.html
-/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-is-reload-navigation-manual.https.html
</del><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-network-error.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-redirect.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-referrer-policy.https.html
</span><span class="lines">@@ -85,7 +83,6 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-response-body-with-invalid-chunk.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-stops-propagation.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-throws-after-respond-with.https.html
</span><del>-/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw-manual.https.html
</del><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-worker-timing-frame.tentative.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event.https.html
</span><span class="lines">@@ -100,6 +97,7 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-no-freshness-headers.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-redirect.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-resources.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-error.https.window.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync-on-worker.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-xhr.https.html
</span><span class="lines">@@ -109,9 +107,10 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/getregistration.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/getregistrations.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/global-serviceworker.https.any.js
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/historical.https.any.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/http-to-https-redirect-and-register.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/immutable-prototype-serviceworker.https.html
</span><del>-/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-module-scripts.https.html
</del><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-cross-origin.https.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-mime-types.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-redirect.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-resource-map.https.html
</span><span class="lines">@@ -130,10 +129,14 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/multiple-update.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigate-window.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect-body.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect-resolution.https.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect-to-http.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-timing.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/nested-blob-url-workers.https.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/next-hop-protocol.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/no-dynamic-import-in-module.any.js
+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/no-dynamic-import.any.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/onactivate-script-error.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/oninstall-script-error.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/opaque-response-preloaded.https.html
</span><span class="lines">@@ -160,7 +163,9 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-iframe.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-mime-types.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-schedule-job.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-scope-module-static-import.https.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-scope.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script-module.https.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script-url.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-script.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-security-error.https.html
</span><span class="lines">@@ -199,9 +204,11 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-after-navigation-fetch-event.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-after-navigation-redirect.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-after-oneday.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck-cors-import.https.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-import-scripts.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-missing-import-scripts.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-module-request-mode.https.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-no-cache-request-headers.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-not-allowed.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/update-on-navigation.https.html
</span><span class="lines">@@ -218,5 +225,6 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-in-sandboxed-iframe-by-csp-fetch-event.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception-redirect.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-content-length.https.window.js
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-response-url.https.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xsl-base-url.https.html
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerwindowclientnavigatehttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/windowclient-navigate.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/windowclient-navigate.https.html        2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/windowclient-navigate.https.html   2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -11,112 +11,136 @@
</span><span class="cx"> 
</span><span class="cx"> const SCOPE = 'resources/blank.html';
</span><span class="cx"> const SCRIPT_URL = 'resources/windowclient-navigate-worker.js';
</span><del>-const CROSS_ORIGIN_URL = get_host_info()['HTTPS_REMOTE_ORIGIN'] + base_path() +
-    'resources/blank.html';
</del><ins>+const CROSS_ORIGIN_URL =
+  get_host_info()['HTTPS_REMOTE_ORIGIN'] + base_path() + 'resources/blank.html';
</ins><span class="cx"> 
</span><del>-navigate_test({
-    description: 'normal',
-    dest_url: 'blank.html?navigate',
-    expected: normalizeURL(SCOPE) + '?navigate',
-  });
</del><ins>+navigateTest({
+  description: 'normal',
+  destUrl: 'blank.html?navigate',
+  expected: normalizeURL(SCOPE) + '?navigate',
+});
</ins><span class="cx"> 
</span><del>-navigate_test({
-    description: 'blank url',
-    dest_url: '',
-    expected: normalizeURL(SCRIPT_URL)
-  });
</del><ins>+navigateTest({
+  description: 'blank url',
+  destUrl: '',
+  expected: normalizeURL(SCRIPT_URL)
+});
</ins><span class="cx"> 
</span><del>-navigate_test({
-    description: 'in scope but not controlled test on installing worker',
-    dest_url: 'blank.html?navigate',
-    expected: 'TypeError',
-    wait_state: 'installing',
-  });
</del><ins>+navigateTest({
+  description: 'in scope but not controlled test on installing worker',
+  destUrl: 'blank.html?navigate',
+  expected: 'TypeError',
+  waitState: 'installing',
+});
</ins><span class="cx"> 
</span><del>-navigate_test({
-    description: 'in scope but not controlled test on active worker',
-    dest_url: 'blank.html?navigate',
-    expected: 'TypeError',
-    should_be_reload: false,
-  });
</del><ins>+navigateTest({
+  description: 'in scope but not controlled test on active worker',
+  destUrl: 'blank.html?navigate',
+  expected: 'TypeError',
+  controlled: false,
+});
</ins><span class="cx"> 
</span><del>-navigate_test({
-    description: 'out of scope',
-    src_url: '/common/blank.html',
-    dest_url: 'blank.html?navigate',
-    expected: 'TypeError',
-  });
</del><ins>+navigateTest({
+  description: 'out of scope',
+  srcUrl: '/common/blank.html',
+  destUrl: 'blank.html?navigate',
+  expected: 'TypeError',
+});
</ins><span class="cx"> 
</span><del>-navigate_test({
-    description: 'cross orgin url',
-    dest_url: CROSS_ORIGIN_URL,
-    expected: null
-  });
</del><ins>+navigateTest({
+  description: 'cross orgin url',
+  destUrl: CROSS_ORIGIN_URL,
+  expected: null
+});
</ins><span class="cx"> 
</span><del>-navigate_test({
-    description: 'invalid url (http://[example.com])',
-    dest_url: 'http://[example].com',
-    expected: 'TypeError'
-  });
</del><ins>+navigateTest({
+  description: 'invalid url (http://[example.com])',
+  destUrl: 'http://[example].com',
+  expected: 'TypeError'
+});
</ins><span class="cx"> 
</span><del>-navigate_test({
-    description: 'invalid url (view-source://example.com)',
-    dest_url: 'view-source://example.com',
-    expected: 'TypeError'
-  });
</del><ins>+navigateTest({
+  description: 'invalid url (view-source://example.com)',
+  destUrl: 'view-source://example.com',
+  expected: 'TypeError'
+});
</ins><span class="cx"> 
</span><del>-navigate_test({
-    description: 'invalid url (file:///)',
-    dest_url: 'file:///',
-    expected: 'TypeError'
-  });
</del><ins>+navigateTest({
+  description: 'invalid url (file:///)',
+  destUrl: 'file:///',
+  expected: 'TypeError'
+});
</ins><span class="cx"> 
</span><del>-navigate_test({
-    description: 'invalid url (about:blank)',
-    dest_url: 'about:blank',
-    expected: 'TypeError'
-  });
</del><ins>+navigateTest({
+  description: 'invalid url (about:blank)',
+  destUrl: 'about:blank',
+  expected: 'TypeError'
+});
</ins><span class="cx"> 
</span><del>-function navigate_test(override_parameters) {
</del><ins>+navigateTest({
+  description: 'navigate on a top-level window client',
+  destUrl: 'blank.html?navigate',
+  srcUrl: 'resources/loaded.html',
+  scope: 'resources/loaded.html',
+  expected: normalizeURL(SCOPE) + '?navigate',
+  frameType: 'top-level'
+});
+
+async function createFrame(t, parameters) {
+  if (parameters.frameType === 'top-level') {
+    // Wait for window.open is completed.
+    await new Promise(resolve => {
+      const win = window.open(parameters.srcUrl);
+      t.add_cleanup(() => win.close());
+      window.addEventListener('message', (e) => {
+        if (e.data.type === 'LOADED') {
+          resolve();
+        }
+      });
+    });
+  }
+
+  if (parameters.frameType === 'nested') {
+    const frame = await with_iframe(parameters.srcUrl);
+    t.add_cleanup(() => frame.remove());
+  }
+}
+
+function navigateTest(overrideParameters) {
</ins><span class="cx">   // default parameters
</span><del>-  var parameters = {
</del><ins>+  const parameters = {
</ins><span class="cx">     description: null,
</span><del>-    src_url: SCOPE,
-    dest_url: null,
</del><ins>+    srcUrl: SCOPE,
+    destUrl: null,
</ins><span class="cx">     expected: null,
</span><del>-    wait_state: 'activated',
</del><ins>+    waitState: 'activated',
</ins><span class="cx">     scope: SCOPE,
</span><del>-    should_be_reload: true
</del><ins>+    controlled: true,
+    // `frameType` can be 'nested' for an iframe WindowClient or 'top-level' for
+    // a main frame WindowClient.
+    frameType: 'nested'
</ins><span class="cx">   };
</span><del>-  var key;
</del><span class="cx"> 
</span><del>-  for (key in override_parameters)
-    parameters[key] = override_parameters[key];
</del><ins>+  for (const key in overrideParameters)
+    parameters[key] = overrideParameters[key];
</ins><span class="cx"> 
</span><del>-  promise_test(function(test) {
-    var service_worker;
-    var client_frame;
-    var registration;
-    var pausedLifecyclePort;
-    var script_url = SCRIPT_URL;
</del><ins>+  promise_test(async function(t) {
+    let pausedLifecyclePort;
+    let scriptUrl = SCRIPT_URL;
</ins><span class="cx"> 
</span><span class="cx">     // For in-scope-but-not-controlled test on installing worker,
</span><del>-    // if the wait_state is "installing", then append the query to script_url.
-    if (parameters.wait_state == 'installing') {
-      script_url += '?' + parameters.wait_state;
</del><ins>+    // if the waitState is "installing", then append the query to scriptUrl.
+    if (parameters.waitState === 'installing') {
+      scriptUrl += '?' + parameters.waitState;
</ins><span class="cx"> 
</span><del>-      navigator.serviceWorker.addEventListener('message', function(event) {
-          if (event.data.port) {
-            pausedLifecyclePort = event.data.port;
-          }
-        });
</del><ins>+      navigator.serviceWorker.addEventListener('message', (event) => {
+        if (event.data.port) {
+          pausedLifecyclePort = event.data.port;
+        }
+      });
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    test.add_cleanup(function() {
-      if (client_frame && client_frame) {
-        client_frame.remove();
-      }
-
</del><ins>+    t.add_cleanup(() => {
</ins><span class="cx">       // Some tests require that the worker remain in a given lifecycle phase.
</span><span class="cx">       // "Clean up" logic for these tests requires signaling the worker to
</span><span class="cx">       // release the hold; this allows the worker to be properly discarded
</span><span class="lines">@@ -126,47 +150,40 @@
</span><span class="cx">         // specified here solely to aid in test debugging.
</span><span class="cx">         pausedLifecyclePort.postMessage('continue lifecycle');
</span><span class="cx">       }
</span><ins>+    });
</ins><span class="cx"> 
</span><del>-      if (registration) {
-        return registration.unregister();
-      }
</del><ins>+    // Create a frame that is not controlled by a service worker.
+    if (!parameters.controlled) {
+      await createFrame(t, parameters);
+    }
+
+    const registration = await service_worker_unregister_and_register(
+        t, scriptUrl, parameters.scope);
+    const serviceWorker = registration.installing;
+    await wait_for_state(t, serviceWorker, parameters.waitState);
+    t.add_cleanup(() => registration.unregister());
+
+    // Create a frame after a service worker is registered so that the frmae is
+    // controlled by an active service worker.
+    if (parameters.controlled) {
+      await createFrame(t, parameters);
+    }
+
+    const response = await new Promise(resolve => {
+      const channel = new MessageChannel();
+      channel.port1.onmessage = t.step_func(resolve);
+      serviceWorker.postMessage({
+        port: channel.port2,
+        url: parameters.destUrl,
+        clientUrl: new URL(parameters.srcUrl, location).toString(),
+        frameType: parameters.frameType,
+        expected: parameters.expected,
+        description: parameters.description,
+      }, [channel.port2]);
</ins><span class="cx">     });
</span><span class="cx"> 
</span><del>-    return with_iframe(parameters.src_url)
-      .then(function(frame) {
-          client_frame = frame;
-          return service_worker_unregister_and_register(
-              test, script_url, parameters.scope);
-        })
-      .then(function(r) {
-          registration = r;
-          service_worker = registration.installing;
-          return wait_for_state(test, service_worker, parameters.wait_state);
-        })
-      .then(function() {
-          if (parameters.should_be_reload) {
-            client_frame.remove();
-            return with_iframe(parameters.src_url);
-          }
-          return client_frame;
-        })
-      .then(function(frame) {
-          client_frame = frame;
-          return new Promise(function(resolve) {
-              var channel = new MessageChannel();
-              channel.port1.onmessage = test.step_func(resolve);
-              service_worker.postMessage({
-                  port: channel.port2,
-                  url: parameters.dest_url,
-                  expected: parameters.expected,
-                  description: parameters.description,
-                }, [channel.port2]);
-            });
-        })
-      .then(function(response) {
-          assert_equals(response.data, null);
-          return fetch_tests_from_worker(service_worker);
-        });
</del><ins>+    assert_equals(response.data, null);
+    await fetch_tests_from_worker(serviceWorker);
</ins><span class="cx">   }, parameters.description);
</span><span class="cx"> }
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerworkerinterceptionhttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https-expected.txt (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https-expected.txt  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https-expected.txt     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> 
</span><span class="cx"> FAIL Verify a dedicated worker script request issued from a uncontrolled document is intercepted by worker's own service worker. promise_test: Unhandled rejection with value: undefined
</span><ins>+FAIL Verify an out-of-scope dedicated worker script request issued from a controlled document should not be intercepted by document's service worker. assert_equals: expected "worker loading was not intercepted by service worker" but got "worker loading intercepted by service worker"
</ins><span class="cx"> FAIL Verify a shared worker script request issued from a uncontrolled document is intercepted by worker's own service worker. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: SharedWorker"
</span><span class="cx"> FAIL Verify a same-origin worker script served by a service worker succeeds in starting a dedicated worker. promise_test: Unhandled rejection with value: undefined
</span><span class="cx"> FAIL Verify a same-origin worker script served by a service worker succeeds in starting a shared worker. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: SharedWorker"
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerworkerinterceptionhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https.html  2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https.html     2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -17,8 +17,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> promise_test(async t => {
</span><del>-  const worker_url = 'resources/dummy-synthesized-worker.js?dedicated';
-  const service_worker_url = 'resources/dummy-worker-interceptor.js';
</del><ins>+  const worker_url = 'resources/sample-synthesized-worker.js?dedicated';
+  const service_worker_url = 'resources/sample-worker-interceptor.js';
</ins><span class="cx">   const scope = worker_url;
</span><span class="cx"> 
</span><span class="cx">   await setup_service_worker(t, service_worker_url, scope);
</span><span class="lines">@@ -32,8 +32,35 @@
</span><span class="cx">    `document is intercepted by worker's own service worker.`);
</span><span class="cx"> 
</span><span class="cx"> promise_test(async t => {
</span><del>-  const worker_url = 'resources/dummy-synthesized-worker.js?shared';
-  const service_worker_url = 'resources/dummy-worker-interceptor.js';
</del><ins>+  const frame_url = 'resources/create-out-of-scope-worker.html';
+  const service_worker_url = 'resources/sample-worker-interceptor.js';
+  const scope = frame_url;
+
+  const registration = await service_worker_unregister_and_register(
+      t, service_worker_url, scope);
+  t.add_cleanup(() => service_worker_unregister(t, scope));
+  await wait_for_state(t, registration.installing, 'activated');
+
+  const frame = await with_iframe(frame_url);
+  t.add_cleanup(_ => frame.remove());
+
+  assert_equals(
+    frame.contentWindow.navigator.serviceWorker.controller.scriptURL,
+    get_newest_worker(registration).scriptURL,
+    'the frame should be controlled by a service worker'
+  );
+
+  const result = await frame.contentWindow.getWorkerPromise();
+
+  assert_equals(result,
+                'worker loading was not intercepted by service worker');
+}, `Verify an out-of-scope dedicated worker script request issued from a ` +
+   `controlled document should not be intercepted by document's service ` +
+   `worker.`);
+
+promise_test(async t => {
+  const worker_url = 'resources/sample-synthesized-worker.js?shared';
+  const service_worker_url = 'resources/sample-worker-interceptor.js';
</ins><span class="cx">   const scope = worker_url;
</span><span class="cx"> 
</span><span class="cx">   await setup_service_worker(t, service_worker_url, scope);
</span><span class="lines">@@ -47,8 +74,8 @@
</span><span class="cx">    `document is intercepted by worker's own service worker.`);
</span><span class="cx"> 
</span><span class="cx"> promise_test(async t => {
</span><del>-  const worker_url = 'resources/dummy-same-origin-worker.js?dedicated';
-  const service_worker_url = 'resources/dummy-worker-interceptor.js';
</del><ins>+  const worker_url = 'resources/sample-same-origin-worker.js?dedicated';
+  const service_worker_url = 'resources/sample-worker-interceptor.js';
</ins><span class="cx">   const scope = worker_url;
</span><span class="cx"> 
</span><span class="cx">   await setup_service_worker(t, service_worker_url, scope);
</span><span class="lines">@@ -62,8 +89,8 @@
</span><span class="cx">    'in starting a dedicated worker.');
</span><span class="cx"> 
</span><span class="cx"> promise_test(async t => {
</span><del>-  const worker_url = 'resources/dummy-same-origin-worker.js?shared';
-  const service_worker_url = 'resources/dummy-worker-interceptor.js';
</del><ins>+  const worker_url = 'resources/sample-same-origin-worker.js?shared';
+  const service_worker_url = 'resources/sample-worker-interceptor.js';
</ins><span class="cx">   const scope = worker_url;
</span><span class="cx"> 
</span><span class="cx">   await setup_service_worker(t, service_worker_url, scope);
</span><span class="lines">@@ -77,8 +104,8 @@
</span><span class="cx">    'in starting a shared worker.');
</span><span class="cx"> 
</span><span class="cx"> promise_test(async t => {
</span><del>-  const worker_url = 'resources/dummy-cors-worker.js?dedicated';
-  const service_worker_url = 'resources/dummy-worker-interceptor.js';
</del><ins>+  const worker_url = 'resources/sample-cors-worker.js?dedicated';
+  const service_worker_url = 'resources/sample-worker-interceptor.js';
</ins><span class="cx">   const scope = worker_url;
</span><span class="cx"> 
</span><span class="cx">   await setup_service_worker(t, service_worker_url, scope);
</span><span class="lines">@@ -89,8 +116,8 @@
</span><span class="cx">    'worker start.');
</span><span class="cx"> 
</span><span class="cx"> promise_test(async t => {
</span><del>-  const worker_url = 'resources/dummy-cors-worker.js?shared';
-  const service_worker_url = 'resources/dummy-worker-interceptor.js';
</del><ins>+  const worker_url = 'resources/sample-cors-worker.js?shared';
+  const service_worker_url = 'resources/sample-worker-interceptor.js';
</ins><span class="cx">   const scope = worker_url;
</span><span class="cx"> 
</span><span class="cx">   await setup_service_worker(t, service_worker_url, scope);
</span><span class="lines">@@ -101,8 +128,8 @@
</span><span class="cx">    'worker start.');
</span><span class="cx"> 
</span><span class="cx"> promise_test(async t => {
</span><del>-  const worker_url = 'resources/dummy-no-cors-worker.js?dedicated';
-  const service_worker_url = 'resources/dummy-worker-interceptor.js';
</del><ins>+  const worker_url = 'resources/sample-no-cors-worker.js?dedicated';
+  const service_worker_url = 'resources/sample-worker-interceptor.js';
</ins><span class="cx">   const scope = worker_url;
</span><span class="cx"> 
</span><span class="cx">   await setup_service_worker(t, service_worker_url, scope);
</span><span class="lines">@@ -113,8 +140,8 @@
</span><span class="cx">    'fails dedicated worker start.');
</span><span class="cx"> 
</span><span class="cx"> promise_test(async t => {
</span><del>-  const worker_url = 'resources/dummy-no-cors-worker.js?shared';
-  const service_worker_url = 'resources/dummy-worker-interceptor.js';
</del><ins>+  const worker_url = 'resources/sample-no-cors-worker.js?shared';
+  const service_worker_url = 'resources/sample-worker-interceptor.js';
</ins><span class="cx">   const scope = worker_url;
</span><span class="cx"> 
</span><span class="cx">   await setup_service_worker(t, service_worker_url, scope);
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerxhrcontentlengthhttpswindowexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-content-length.https.window-expected.txt (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-content-length.https.window-expected.txt                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-content-length.https.window-expected.txt       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+
+PASS Setup
+PASS Synthetic response without Content-Length header
+FAIL Synthetic response with Content-Length header with value larger than response body length assert_true: expected true got false
+FAIL Synthetic response with two Content-Length headers value larger than response body length assert_true: expected true got false
+PASS Synthetic response with bogus Content-Length header
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerxhrcontentlengthhttpswindowhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-content-length.https.window.html (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-content-length.https.window.html                            (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-content-length.https.window.html       2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+<!-- This file is required for WebKit test infrastructure to run the templated test -->
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerxhrcontentlengthhttpswindowjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-content-length.https.window.js (0 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-content-length.https.window.js                              (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-content-length.https.window.js 2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+// META: script=resources/test-helpers.sub.js
+
+let frame;
+
+promise_test(async (t) => {
+  const scope = "resources/empty.html";
+  const script = "resources/xhr-content-length-worker.js";
+  const registration = await service_worker_unregister_and_register(t, script, scope);
+  await wait_for_state(t, registration.installing, "activated");
+  frame = await with_iframe(scope);
+}, "Setup");
+
+promise_test(async t => {
+  const xhr = new frame.contentWindow.XMLHttpRequest();
+  xhr.open("GET", "test?type=no-content-length");
+  xhr.send();
+  const event = await new Promise(resolve => xhr.onload = resolve);
+  assert_equals(xhr.getResponseHeader("content-length"), null);
+  assert_false(event.lengthComputable);
+  assert_equals(event.total, 0);
+  assert_equals(event.loaded, xhr.responseText.length);
+}, `Synthetic response without Content-Length header`);
+
+promise_test(async t => {
+  const xhr = new frame.contentWindow.XMLHttpRequest();
+  xhr.open("GET", "test?type=larger-content-length");
+  xhr.send();
+  const event = await new Promise(resolve => xhr.onload = resolve);
+  assert_equals(xhr.getResponseHeader("content-length"), "10000");
+  assert_true(event.lengthComputable);
+  assert_equals(event.total, 10000);
+  assert_equals(event.loaded, xhr.responseText.length);
+}, `Synthetic response with Content-Length header with value larger than response body length`);
+
+promise_test(async t => {
+  const xhr = new frame.contentWindow.XMLHttpRequest();
+  xhr.open("GET", "test?type=double-content-length");
+  xhr.send();
+  const event = await new Promise(resolve => xhr.onload = resolve);
+  assert_equals(xhr.getResponseHeader("content-length"), "10000, 10000");
+  assert_true(event.lengthComputable);
+  assert_equals(event.total, 10000);
+  assert_equals(event.loaded, xhr.responseText.length);
+}, `Synthetic response with two Content-Length headers value larger than response body length`);
+
+promise_test(async t => {
+  const xhr = new frame.contentWindow.XMLHttpRequest();
+  xhr.open("GET", "test?type=bogus-content-length");
+  xhr.send();
+  const event = await new Promise(resolve => xhr.onload = resolve);
+  assert_equals(xhr.getResponseHeader("content-length"), "test");
+  assert_false(event.lengthComputable);
+  assert_equals(event.total, 0);
+  assert_equals(event.loaded, xhr.responseText.length);
+}, `Synthetic response with bogus Content-Length header`);
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsserviceworkersserviceworkerxhrresponseurlhttpshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-response-url.https.html (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-response-url.https.html     2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/xhr-response-url.https.html        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> // worker.
</span><span class="cx"> promise_test(async (t) => {
</span><span class="cx">   // Build a URL that tells the service worker to respondWith(fetch(|target|)).
</span><del>-  const target = new URL('resources/dummy.txt', window.location);
</del><ins>+  const target = new URL('resources/sample.txt', window.location);
</ins><span class="cx">   const url = build_url({
</span><span class="cx">     respondWith: 'fetch',
</span><span class="cx">     url: target
</span></span></pre></div>
<a id="trunkLayoutTeststestsoptionsjson"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/tests-options.json (279388 => 279389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/tests-options.json     2021-06-29 21:51:33 UTC (rev 279388)
+++ trunk/LayoutTests/tests-options.json        2021-06-29 22:04:42 UTC (rev 279389)
</span><span class="lines">@@ -2849,6 +2849,12 @@
</span><span class="cx">     "imported/w3c/web-platform-tests/service-workers/service-worker/activation.https.html": [
</span><span class="cx">         "slow"
</span><span class="cx">     ],
</span><ins>+    "imported/w3c/web-platform-tests/service-workers/service-worker/claim-fetch.https.html": [
+        "slow"
+    ],
+    "imported/w3c/web-platform-tests/service-workers/service-worker/client-navigate.https.html": [
+        "slow"
+    ],
</ins><span class="cx">     "imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-order.https.html": [
</span><span class="cx">         "slow"
</span><span class="cx">     ],
</span><span class="lines">@@ -2915,6 +2921,9 @@
</span><span class="cx">     "imported/w3c/web-platform-tests/service-workers/service-worker/registration-mime-types.https.html": [
</span><span class="cx">         "slow"
</span><span class="cx">     ],
</span><ins>+    "imported/w3c/web-platform-tests/service-workers/service-worker/registration-schedule-job.https.html": [
+        "slow"
+    ],
</ins><span class="cx">     "imported/w3c/web-platform-tests/service-workers/service-worker/registration-updateviacache.https.html": [
</span><span class="cx">         "slow"
</span><span class="cx">     ],
</span><span class="lines">@@ -2933,9 +2942,15 @@
</span><span class="cx">     "imported/w3c/web-platform-tests/service-workers/service-worker/update-after-navigation-redirect.https.html": [
</span><span class="cx">         "slow"
</span><span class="cx">     ],
</span><ins>+    "imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck-cors-import.https.html": [
+        "slow"
+    ],
</ins><span class="cx">     "imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck.https.html": [
</span><span class="cx">         "slow"
</span><span class="cx">     ],
</span><ins>+    "imported/w3c/web-platform-tests/service-workers/service-worker/update-module-request-mode.https.html": [
+        "slow"
+    ],
</ins><span class="cx">     "imported/w3c/web-platform-tests/service-workers/service-worker/update.https.html": [
</span><span class="cx">         "slow"
</span><span class="cx">     ],
</span></span></pre>
</div>
</div>

</body>
</html>