commit | 9dcc8580a5da88049a48ebbfb3fb08a22c5a90d9 | [log] [tgz] |
---|---|---|
author | Dominic Farolino <dom@chromium.org> | Sat Mar 16 02:20:49 2024 |
committer | Blink WPT Bot <blink-w3c-test-autoroller@chromium.org> | Sat Mar 16 02:34:15 2024 |
tree | 9f5b3943fc31b22b6d5a120a4d82c85e871bb8d8 | |
parent | ddf5b1d83d7bd893030f1761af17deab9d9881c1 [diff] |
DOM: Implement Observable#from() conversion operator This CL implements 3/4 of the Observable#from() conversion operator. This operator [1], [2] (not quite yet specified) takes a Web IDL `any` value and converts it to an Observable with the following semantics, based on what the `any` value actually is under the hood: 1. Observable: just return the same Observable. 2. Async iterable: create & return an Observable that, on subscription, pulls values from the async iterable, and pushes them to the subscriber. 3. Iterable: create & return an Observable that, on subscription, synchronously pushes each value to the subscriber. 4. Promise: create & return an Observable that, on subscription, reacts [3] to given promise with two handlers: a. Fulfillment handler: pushes the value to the subscriber, and calls complete() b. Rejection handler: Calls the subscriber's error with the given rejection value This CL implements (1), (3), and (4) by introducing new subscriber delegates that are specific to these cases. Async iterable support, (2), will come in a future CL, as there is not yet equivalent bindings support for this, so it will need a more thoughtful design. [1]: https://github.com/wicg/observable?tab=readme-ov-file#constructing--converting-objects-to-observables [2]: https://wicg.github.io/observable/#observable-from [3]: https://webidl.spec.whatwg.org/#dfn-perform-steps-once-promise-is-settled Bug: 40282760 Change-Id: I6b392ba77221fb1a77e334aa5f151ed6518419ed Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5337908 Reviewed-by: Mason Freed <masonf@chromium.org> Commit-Queue: Dominic Farolino <dom@chromium.org> Cr-Commit-Position: refs/heads/main@{#1273758}
The web-platform-tests Project is a cross-browser test suite for the Web-platform stack. Writing tests in a way that allows them to be run in all browsers gives browser projects confidence that they are shipping software that is compatible with other implementations, and that later implementations will be compatible with their implementations. This in turn gives Web authors/developers confidence that they can actually rely on the Web platform to deliver on the promise of working across browsers and devices without needing extra layers of abstraction to paper over the gaps left by specification editors and implementors.
The most important sources of information and activity are:
wpt:matrix.org
matrix channel; includes participants located around the world, but busiest during the European working day.If you'd like clarification about anything, don't hesitate to ask in the chat room or on the mailing list.
Clone or otherwise get https://github.com/web-platform-tests/wpt.
Note: because of the frequent creation and deletion of branches in this repo, it is recommended to “prune” stale branches when fetching updates, i.e. use git pull --prune
(or git fetch -p && git merge
).
See the documentation website and in particular the system setup for running tests locally.
The wpt
command provides a frontend to a variety of tools for working with and running web-platform-tests. Some of the most useful commands are:
wpt serve
- For starting the wpt http serverwpt run
- For running tests in a browserwpt lint
- For running the lint against all testswpt manifest
- For updating or generating a MANIFEST.json
test manifestwpt install
- For installing the latest release of a browser or webdriver server on the local machine.wpt serve-wave
- For starting the wpt http server and the WAVE test runner. For more details on how to use the WAVE test runner see the documentation.On Windows wpt
commands must be prefixed with python
or the path to the python binary (if python
is not in your %PATH%
).
python wpt [command]
Alternatively, you may also use Bash on Ubuntu on Windows in the Windows 10 Anniversary Update build, then access your windows partition from there to launch wpt
commands.
Please make sure git and your text editor do not automatically convert line endings, as it will cause lint errors. For git, please set git config core.autocrlf false
in your working tree.
The master branch is automatically synced to wpt.live and w3c-test.org.
Save the Web, Write Some Tests!
Absolutely everyone is welcome to contribute to test development. No test is too small or too simple, especially if it corresponds to something for which you've noted an interoperability bug in a browser.
The way to contribute is just as usual:
git checkout -b topic
../wpt lint
as described above.If you spot an issue with a test and are not comfortable providing a pull request per above to fix it, please file a new issue. Thank you!