зеркало из https://github.com/mozilla/gecko-dev.git
Read-only Git mirror of the Mercurial gecko repositories at https://hg.mozilla.org. How to contribute: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
43a34a8adf
Automatic update from web-platform-tests service worker: Improve WPT tests for async respondWith/waitUntil. (#15852) See discussion at [1] and [2]. This makes the following changes. 1. Adds a test for: self.addEventListener('fetch', e => { Promise.resolve().then(() => { e.respondWith(new Response('hi')); }); }); This should not throw because respondWith() is called while the event dispatch flag is still set. The microtask checkpoint is in "Cleanup After Running Scripts" here: https://html.spec.whatwg.org/multipage/webappapis.html#clean-up-after-running-script This is called from step 16.2 here: https://heycam.github.io/webidl/#call-a-user-objects-operation Which in turn is called from the DOM spec's "Inner Invoke" to call event targets: https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke 2. Changes the expectation for: addEventListener('message', event => { Promise.resolve().then(event.waitUntil(p)); }); From throws to not throws, for the same reasoning as above. 3. Changes the expectation for: addEventListener('message', event => { waitPromise = Promise.resolve(); event.waitUntil(waitPromise); waitPromise.then(() => { Promise.resolve().then(() => {event.waitUntil();}); }); }); From throws to not throws. This is subtle. Because all the promises are just Promise.resolve(), the event dispatch flag is still set by the time the second waitUntil() is called. 4. To test what 3. originally intended, a new test is added which makes waitPromise a promise that does not immediately resolve. 5. Changes the expectation for: addEventListener(‘fetch’, event => { response = Promise.resolve(new Response('RESP')); event.respondWith(response); response.then(() => { Promise.resolve().then(() => {event.waitUntil();}); }) }); Again this is because the promises used resolve immediately, so the event dispatch flag is still set. Similarly, a new test is added to cover the original intent. These WPT changes appear to match the behavior of Safari and Edge while diverging from Chrome and (partially) Firefox. [1] https://github.com/w3c/ServiceWorker/issues/1213 [2] https://github.com/w3c/ServiceWorker/issues/1394 Bug: 942414 Change-Id: I9a4a56d71d3919ed614ff78df2bdc6cc0251dadd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1524393 Commit-Queue: Matt Falkenhagen <falken@chromium.org> Reviewed-by: Ben Kelly <wanderview@chromium.org> Cr-Commit-Position: refs/heads/master@{#641514} -- wpt-commits: cecb3eba4dae3d795876f7b4be71bd49afa03356 wpt-pr: 15852 |
||
---|---|---|
.cargo | ||
.vscode | ||
accessible | ||
browser | ||
build | ||
caps | ||
chrome | ||
config | ||
db | ||
devtools | ||
docshell | ||
dom | ||
editor | ||
extensions | ||
gfx | ||
gradle/wrapper | ||
hal | ||
image | ||
intl | ||
ipc | ||
js | ||
layout | ||
media | ||
memory | ||
mfbt | ||
mobile | ||
modules | ||
mozglue | ||
netwerk | ||
nsprpub | ||
other-licenses | ||
parser | ||
python | ||
remote | ||
security | ||
services | ||
servo | ||
startupcache | ||
storage | ||
taskcluster | ||
testing | ||
third_party | ||
toolkit | ||
tools | ||
uriloader | ||
view | ||
widget | ||
xpcom | ||
xpfe/appshell | ||
.arcconfig | ||
.clang-format | ||
.clang-format-ignore | ||
.cron.yml | ||
.eslintignore | ||
.eslintrc.js | ||
.flake8 | ||
.gdbinit | ||
.gdbinit_python | ||
.git-blame-ignore-revs | ||
.gitignore | ||
.hg-annotate-ignore-revs | ||
.hg-format-source | ||
.hgignore | ||
.hgtags | ||
.lldbinit | ||
.mailmap | ||
.taskcluster.yml | ||
.trackerignore | ||
.yamllint | ||
.ycm_extra_conf.py | ||
AUTHORS | ||
CLOBBER | ||
Cargo.lock | ||
Cargo.toml | ||
GNUmakefile | ||
LEGAL | ||
LICENSE | ||
Makefile.in | ||
README.txt | ||
aclocal.m4 | ||
build.gradle | ||
client.mk | ||
client.py | ||
configure.in | ||
configure.py | ||
gradle.properties | ||
gradlew | ||
gradlew.bat | ||
mach | ||
moz.build | ||
moz.configure | ||
mozilla-config.h.in | ||
old-configure.in | ||
package-lock.json | ||
package.json | ||
settings.gradle | ||
test.mozbuild |
README.txt
An explanation of the Mozilla Source Code Directory Structure and links to project pages with documentation can be found at: https://developer.mozilla.org/en/Mozilla_Source_Code_Directory_Structure For information on how to build Mozilla from the source code, see: https://developer.mozilla.org/en/docs/Build_Documentation To have your bug fix / feature added to Mozilla, you should create a patch and submit it to Bugzilla (https://bugzilla.mozilla.org). Instructions are at: https://developer.mozilla.org/en/docs/Creating_a_patch https://developer.mozilla.org/en/docs/Getting_your_patch_in_the_tree If you have a question about developing Mozilla, and can't find the solution on https://developer.mozilla.org, you can try asking your question in a mozilla.* Usenet group, or on IRC at irc.mozilla.org. [The Mozilla news groups are accessible on Google Groups, or news.mozilla.org with a NNTP reader.] Nightly development builds can be downloaded from: https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/ - or - https://www.mozilla.org/firefox/channel/desktop/#nightly Keep in mind that nightly builds, which are used by Mozilla developers for testing, may be buggy.