-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1843478 [wpt PR 41038] - WPT: ServiceWorker static routing API fo…
…r subresource loads., a=testonly Automatic update from web-platform-tests WPT: ServiceWorker static routing API for subresource loads. This CL adds the Web Platform Tests to test ServiceWorker static routing API for subresources. WICG proposal: WICG/proposals#102 Spec PR: w3c/ServiceWorker#1686 Change-Id: I7379d85b5a2208f248878abe9d1a920ad97d47ab Bug: 1371756 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4664026 Reviewed-by: Shunya Shishido <sisidovskichromium.org> Reviewed-by: Minoru Chikamune <chikamunechromium.org> Reviewed-by: Kouhei Ueno <kouheichromium.org> Commit-Queue: Yoshisato Yanagisawa <yyanagisawachromium.org> Reviewed-by: Kent Tamura <tkentchromium.org> Cr-Commit-Position: refs/heads/main{#1171605} -- wpt-commits: d6ae6c83c103fdf28aefd9fb3445470c96c0e17b wpt-pr: 41038 UltraBlame original commit: b5f983a66877126f278d41b511c32f703f62f63d
- Loading branch information
Showing
6 changed files
with
2,322 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
...platform/tests/service-workers/service-worker/tentative/static-router/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
A | ||
test | ||
stuite | ||
for | ||
the | ||
ServiceWorker | ||
Static | ||
Routing | ||
API | ||
. | ||
WICG | ||
proposal | ||
: | ||
https | ||
: | ||
/ | ||
/ | ||
github | ||
. | ||
com | ||
/ | ||
WICG | ||
/ | ||
proposals | ||
/ | ||
issues | ||
/ | ||
102 | ||
Specification | ||
PR | ||
: | ||
https | ||
: | ||
/ | ||
/ | ||
github | ||
. | ||
com | ||
/ | ||
w3c | ||
/ | ||
ServiceWorker | ||
/ | ||
pull | ||
/ | ||
1686 |
1 change: 1 addition & 0 deletions
1
...latform/tests/service-workers/service-worker/tentative/static-router/resources/direct.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Network |
21 changes: 21 additions & 0 deletions
21
...atform/tests/service-workers/service-worker/tentative/static-router/resources/simple.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
< | ||
! | ||
DOCTYPE | ||
html | ||
> | ||
< | ||
title | ||
> | ||
Simple | ||
< | ||
/ | ||
title | ||
> | ||
Here | ||
' | ||
s | ||
a | ||
simple | ||
html | ||
file | ||
. |
127 changes: 127 additions & 0 deletions
127
...ests/service-workers/service-worker/tentative/static-router/resources/static-router-sw.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
' | ||
use | ||
strict | ||
' | ||
; | ||
self | ||
. | ||
addEventListener | ||
( | ||
' | ||
install | ||
' | ||
e | ||
= | ||
> | ||
{ | ||
e | ||
. | ||
registerRouter | ||
( | ||
{ | ||
condition | ||
: | ||
{ | ||
urlPattern | ||
: | ||
" | ||
* | ||
. | ||
txt | ||
" | ||
} | ||
source | ||
: | ||
" | ||
network | ||
" | ||
} | ||
) | ||
; | ||
self | ||
. | ||
skipWaiting | ||
( | ||
) | ||
; | ||
} | ||
) | ||
; | ||
self | ||
. | ||
addEventListener | ||
( | ||
' | ||
activate | ||
' | ||
e | ||
= | ||
> | ||
{ | ||
e | ||
. | ||
waitUntil | ||
( | ||
clients | ||
. | ||
claim | ||
( | ||
) | ||
) | ||
; | ||
} | ||
) | ||
; | ||
self | ||
. | ||
addEventListener | ||
( | ||
' | ||
fetch | ||
' | ||
function | ||
( | ||
event | ||
) | ||
{ | ||
const | ||
url | ||
= | ||
new | ||
URL | ||
( | ||
event | ||
. | ||
request | ||
. | ||
url | ||
) | ||
; | ||
const | ||
nonce | ||
= | ||
url | ||
. | ||
searchParams | ||
. | ||
get | ||
( | ||
' | ||
nonce | ||
' | ||
) | ||
; | ||
event | ||
. | ||
respondWith | ||
( | ||
new | ||
Response | ||
( | ||
nonce | ||
) | ||
) | ||
; | ||
} | ||
) | ||
; |
Oops, something went wrong.