-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1720812 [wpt PR 29684] - [WPT] Move/merge COEP/COOP dispatcher fr…
…amework to /common, a=testonly Automatic update from web-platform-tests [WPT] Move/merge COEP/COOP dispatcher framework to /common (#29684) To reduce duplication and prepare for using this framework for BFCache (web-platform-tests/wpt#28950), this CL merges two sets of dispatcher/executor files under COEP and COOP and move them to `/common`. Relevant discussion is also in web-platform-tests/rfcs#89. Most of the changes are simple path renaming, except for: - Service worker's scope is also moved to `/common/dispatcher/` in: /wpt/html/cross-origin-embedder-policy/credentialless/service-worker-coep-credentialless-proxy.tentative.https.html /wpt/html/cross-origin-embedder-policy/credentialless/service-worker-coep-none-proxy.tentative.https.html /wpt/html/cross-origin-opener-policy/popup-coop-by-sw.https.html because the service workers should control executors. - Diffs between COEP and COOP dispatchers are merged, but are trivial (e.g. some functionality exists only one of them, like 6 concurrent accesses to the server, retrying on failure, Access-Control-Allow-Credentials in dispatcher, etc.). - Reporting-related part of `dispatcher.js` is moved to /wpt/html/cross-origin-opener-policy/reporting/resources/reporting-common.js. - README.md about the dispatcher is moved and added. - /wpt/html/cross-origin-embedder-policy/credentialless/resources/cacheable-response.py is also merged into dispatcher.py, because they should access the same stash and already have common code. - Stash paths are moved to '/common/dispatcher'. - `executer.js` and `sw_executer.js` are moved to `executer-worker.js` and `executer-service-worker.js`, respectively, to clarify they are worker scripts, rather than helpers. - Timeout in receive() is removed because no one uses that parameter. - Duplicated/unused const declarations are removed. Bug: 1107415 Change-Id: I0d28e7f4b4cca6599562ac4766a326880139028d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3033199 Commit-Queue: Hiroshige Hayashizaki <[email protected]> Reviewed-by: Arthur Sonzogni <[email protected]> Reviewed-by: Kouhei Ueno <[email protected]> Cr-Commit-Position: refs/heads/main@{#921511} Co-authored-by: Hiroshige Hayashizaki <[email protected]> -- wpt-commits: bb06b9cd1abb9467a296177d468da156f6df2bbc wpt-pr: 29684
- Loading branch information
1 parent
e8b7f01
commit 8f34a98
Showing
90 changed files
with
231 additions
and
359 deletions.
There are no files selected for viewing
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,33 @@ | ||
# Message passing API | ||
|
||
`dispatcher.js` (and its server-side backend `dispatcher.py`) provides a | ||
universal queue-based message passing API. | ||
Each queue is identified by a UUID, and accessed via the following APIs: | ||
|
||
- `send(uuid, message)` pushes a string `message` to the queue `uuid`. | ||
- `receive(uuid)` pops the first item from the queue `uuid`. | ||
- `showRequestHeaders(origin, uuid)` and | ||
`cacheableShowRequestHeaders(origin, uuid)` return URLs, that push request | ||
headers to the queue `uuid` upon fetching. | ||
|
||
It works cross-origin, and even access different browser context groups. | ||
|
||
Messages are queued, this means one doesn't need to wait for the receiver to | ||
listen, before sending the first message | ||
(but still need to wait for the resolution of the promise returned by `send()` | ||
to ensure the order between `send()`s). | ||
|
||
# Executor framework | ||
|
||
The message passing API can be used for sending arbitrary javascript to be | ||
evaluated in another page or worker (the "executor"). | ||
|
||
`executor.html` (as a Document), `executor-worker.js` (as a Web Worker), and | ||
`executor-service-worker.js` (as a Service Worker) are examples of executors. | ||
Tests can send arbitrary javascript to these executors to evaluate in its | ||
execution context. | ||
|
||
This is universal and avoids introducing many specific `XXX-helper.html` | ||
resources. | ||
Moreover, tests are easier to read, because the whole logic of the test can be | ||
defined in a single file. |
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
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
File renamed without changes.
File renamed without changes.
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
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
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
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
12 changes: 0 additions & 12 deletions
12
...g/web-platform/tests/html/cross-origin-embedder-policy/credentialless/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 |
---|---|---|
@@ -1,15 +1,3 @@ | ||
# Helper files: | ||
|
||
- `resources/dispatcher.js` provides `send()` and `receive()`. This is an | ||
universal message passing API. It works cross-origin, and even access | ||
different browser context groups. Messages are queued, this means one doesn't | ||
need to wait for the receiver to listen, before sending the first message. | ||
|
||
- `resources/executor.html` is a document. Test can send arbitrary javascript to evaluate | ||
in its execution context. This is universal and avoids introducing many | ||
specific `XXX-helper.html` resources. Moreover, tests are easier to read, | ||
because the whole logic of the test can be defined in a single file. | ||
|
||
# Related documents: | ||
- https://github.com/mikewest/credentiallessness/ | ||
- https://github.com/w3ctag/design-reviews/issues/582 |
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
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
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
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
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
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
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
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
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
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
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
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
24 changes: 0 additions & 24 deletions
24
...rm/tests/html/cross-origin-embedder-policy/credentialless/resources/cacheable-response.py
This file was deleted.
Oops, something went wrong.
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
15 changes: 0 additions & 15 deletions
15
...b-platform/tests/html/cross-origin-embedder-policy/credentialless/resources/executor.html
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.