diff --git a/testing/web-platform/tests/service-workers/service-worker/navigation-headers.https.html b/testing/web-platform/tests/service-workers/service-worker/navigation-headers.https.html
new file mode 100644
index 000000000000..410b8e4631c1
--- /dev/null
+++ b/testing/web-platform/tests/service-workers/service-worker/navigation-headers.https.html
@@ -0,0 +1,558 @@
+
+
+
Service Worker: Navigation Post Request Origin Header
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js b/testing/web-platform/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js
index 4631e83e0cea..20a80665270d 100644
--- a/testing/web-platform/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js
+++ b/testing/web-platform/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js
@@ -90,8 +90,12 @@ self.addEventListener('fetch', function(event) {
var request = event.request;
if (url) {
request = new Request(url, init);
+ } else if (params['change-request']) {
+ request = new Request(request, init);
}
- fetch(request).then(function(response) {
+ const response_promise = params['navpreload'] ? event.preloadResponse
+ : fetch(request);
+ response_promise.then(function(response) {
var expectedType = params['expected_type'];
if (expectedType && response.type !== expectedType) {
// Resolve a JSON object with a failure instead of rejecting
diff --git a/testing/web-platform/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js.headers b/testing/web-platform/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js.headers
new file mode 100644
index 000000000000..123053b38c66
--- /dev/null
+++ b/testing/web-platform/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js.headers
@@ -0,0 +1,2 @@
+Content-Type: text/javascript
+Service-Worker-Allowed: /
diff --git a/testing/web-platform/tests/service-workers/service-worker/resources/form-poster.html b/testing/web-platform/tests/service-workers/service-worker/resources/form-poster.html
new file mode 100644
index 000000000000..5d56fde19a8e
--- /dev/null
+++ b/testing/web-platform/tests/service-workers/service-worker/resources/form-poster.html
@@ -0,0 +1,12 @@
+
+
+
+
diff --git a/testing/web-platform/tests/service-workers/service-worker/resources/location-setter.html b/testing/web-platform/tests/service-workers/service-worker/resources/location-setter.html
new file mode 100644
index 000000000000..fae18e806655
--- /dev/null
+++ b/testing/web-platform/tests/service-workers/service-worker/resources/location-setter.html
@@ -0,0 +1,10 @@
+
+
+
diff --git a/testing/web-platform/tests/service-workers/service-worker/resources/navigation-headers-server.py b/testing/web-platform/tests/service-workers/service-worker/resources/navigation-headers-server.py
new file mode 100644
index 000000000000..5b2e044f8b52
--- /dev/null
+++ b/testing/web-platform/tests/service-workers/service-worker/resources/navigation-headers-server.py
@@ -0,0 +1,19 @@
+def main(request, response):
+ response.status = (200, b"OK")
+ response.headers.set(b"Content-Type", b"text/html")
+ return b"""
+ """ % (request.headers.get(
+ b"origin", b"not set"), request.headers.get(b"referer", b"not set"),
+ request.headers.get(b"sec-fetch-site", b"not set"),
+ request.headers.get(b"sec-fetch-mode", b"not set"),
+ request.headers.get(b"sec-fetch-dest", b"not set"))
diff --git a/testing/web-platform/tests/service-workers/service-worker/resources/same-site-cookies-register.html b/testing/web-platform/tests/service-workers/service-worker/resources/same-site-cookies-register.html
new file mode 100644
index 000000000000..084f0a08a8e6
--- /dev/null
+++ b/testing/web-platform/tests/service-workers/service-worker/resources/same-site-cookies-register.html
@@ -0,0 +1,22 @@
+
+
+
diff --git a/testing/web-platform/tests/service-workers/service-worker/resources/same-site-cookies-unregister.html b/testing/web-platform/tests/service-workers/service-worker/resources/same-site-cookies-unregister.html
new file mode 100644
index 000000000000..cca3620b61e7
--- /dev/null
+++ b/testing/web-platform/tests/service-workers/service-worker/resources/same-site-cookies-unregister.html
@@ -0,0 +1,11 @@
+
+
+
diff --git a/testing/web-platform/tests/service-workers/service-worker/same-site-cookies.https.html b/testing/web-platform/tests/service-workers/service-worker/same-site-cookies.https.html
new file mode 100644
index 000000000000..54c42c84d802
--- /dev/null
+++ b/testing/web-platform/tests/service-workers/service-worker/same-site-cookies.https.html
@@ -0,0 +1,215 @@
+
+
+Service Worker: Same-site cookie behavior
+
+
+
+
+
+
+
+