Scheduling APIs: Implement scheduler.yield() prototype (part 2: inherit)

This CL implements the scheduler.yield() "inherit" option:
 - Signal selection: GetTaskSignalFromOptions() is updated to take
   inheritance into account. If either the signal or priority options
   are to inherit, the inherited signal is retrieved from V8 and used
   in the computation:
     - signal: "inherit", priority: unset - use the inherited signal
     if there is one, otherwise default priority.
     - signal: "inherit", priority: fixed - create a composite signal
     from the inherited signal and fixed priority. If the inherited
     signal is null, just use a fixed priority signal.
     - signal: unset, priority: "inherit" - if there's nothing to
     inherit use the default priority; if the inherited signal has
     fixed priority and can't abort, use that; otherwise create a
     new composite signal.

 - DOMTask is updated to support continuation, passing its signal
   when creating a task scope (main thread). For workers, DOMTask
   will set the continuation preserved embedder data manually before
   running the task.

 - WPT tests are added and modified to cover the "inherit" option.

Bug: 979020
Change-Id: Ia9776b9292d70636e2b1eea191e9c09b1809fa84
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4326152
Commit-Queue: Scott Haseley <shaseley@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1118868}
5 files changed
tree: d5025a81cd871911480ce77519a9733e2d945b42
  1. .github/
  2. .well-known/
  3. accelerometer/
  4. accessibility/
  5. accname/
  6. acid/
  7. ambient-light/
  8. animation-worklet/
  9. annotation-model/
  10. annotation-protocol/
  11. annotation-vocab/
  12. apng/
  13. appmanifest/
  14. attribution-reporting/
  15. audio-output/
  16. autoplay-policy-detection/
  17. avif/
  18. background-fetch/
  19. background-sync/
  20. badging/
  21. battery-status/
  22. beacon/
  23. bluetooth/
  24. browsing-topics/
  25. clear-site-data/
  26. client-hints/
  27. clipboard-apis/
  28. close-watcher/
  29. common/
  30. compat/
  31. compression/
  32. compute-pressure/
  33. conformance-checkers/
  34. console/
  35. contacts/
  36. content-dpr/
  37. content-index/
  38. content-security-policy/
  39. contenteditable/
  40. cookie-store/
  41. cookies/
  42. core-aam/
  43. cors/
  44. credential-management/
  45. css/
  46. custom-elements/
  47. custom-state-pseudo-class/
  48. delegated-ink/
  49. density-size-correction/
  50. deprecation-reporting/
  51. device-memory/
  52. direct-sockets/
  53. docs/
  54. document-picture-in-picture/
  55. document-policy/
  56. dom/
  57. domparsing/
  58. domxpath/
  59. dpub-aam/
  60. dpub-aria/
  61. ecmascript/
  62. editing/
  63. element-timing/
  64. encoding/
  65. encoding-detection/
  66. encrypted-media/
  67. entries-api/
  68. event-timing/
  69. eventsource/
  70. eyedropper/
  71. feature-policy/
  72. fetch/
  73. file-system-access/
  74. FileAPI/
  75. focus/
  76. font-access/
  77. fonts/
  78. forced-colors-mode/
  79. fs/
  80. fullscreen/
  81. gamepad/
  82. generic-sensor/
  83. geolocation-API/
  84. geolocation-sensor/
  85. graphics-aam/
  86. gyroscope/
  87. hr-time/
  88. html/
  89. html-longdesc/
  90. html-media-capture/
  91. idle-detection/
  92. imagebitmap-renderingcontext/
  93. images/
  94. import-maps/
  95. IndexedDB/
  96. inert/
  97. infrastructure/
  98. input-device-capabilities/
  99. input-events/
  100. installedapp/
  101. interfaces/
  102. intersection-observer/
  103. intervention-reporting/
  104. is-input-pending/
  105. js/
  106. js-self-profiling/
  107. keyboard-lock/
  108. keyboard-map/
  109. largest-contentful-paint/
  110. layout-instability/
  111. lifecycle/
  112. loading/
  113. long-animation-frame/
  114. longtask-timing/
  115. magnetometer/
  116. managed/
  117. mathml/
  118. measure-memory/
  119. media/
  120. media-capabilities/
  121. media-playback-quality/
  122. media-source/
  123. mediacapture-extensions/
  124. mediacapture-fromelement/
  125. mediacapture-handle/
  126. mediacapture-image/
  127. mediacapture-insertable-streams/
  128. mediacapture-record/
  129. mediacapture-region/
  130. mediacapture-streams/
  131. mediasession/
  132. merchant-validation/
  133. mimesniff/
  134. mixed-content/
  135. mst-content-hint/
  136. navigation-api/
  137. navigation-timing/
  138. netinfo/
  139. network-error-logging/
  140. notifications/
  141. old-tests/
  142. orientation-event/
  143. orientation-sensor/
  144. page-lifecycle/
  145. page-visibility/
  146. paint-timing/
  147. parakeet/
  148. payment-handler/
  149. payment-method-basic-card/
  150. payment-method-id/
  151. payment-request/
  152. pending-beacon/
  153. performance-timeline/
  154. periodic-background-sync/
  155. permissions/
  156. permissions-policy/
  157. permissions-request/
  158. permissions-revoke/
  159. picture-in-picture/
  160. png/
  161. pointerevents/
  162. pointerlock/
  163. portals/
  164. preload/
  165. presentation-api/
  166. private-click-measurement/
  167. proximity/
  168. push-api/
  169. quirks/
  170. referrer-policy/
  171. remote-playback/
  172. reporting/
  173. requestidlecallback/
  174. resize-observer/
  175. resource-timing/
  176. resources/
  177. sanitizer-api/
  178. savedata/
  179. scheduler/
  180. screen-capture/
  181. screen-details/
  182. screen-orientation/
  183. screen-wake-lock/
  184. scroll-animations/
  185. scroll-to-text-fragment/
  186. secure-contexts/
  187. secure-payment-confirmation/
  188. selection/
  189. serial/
  190. server-timing/
  191. service-workers/
  192. shadow-dom/
  193. shape-detection/
  194. shared-storage/
  195. signed-exchange/
  196. soft-navigation-heuristics/
  197. speculation-rules/
  198. speech-api/
  199. storage/
  200. storage-access-api/
  201. streams/
  202. subapps/
  203. subresource-integrity/
  204. svg/
  205. svg-aam/
  206. timing-entrytypes-registry/
  207. tools/
  208. top-level-storage-access-api/
  209. touch-events/
  210. trust-tokens/
  211. trusted-types/
  212. ua-client-hints/
  213. uievents/
  214. upgrade-insecure-requests/
  215. url/
  216. urlpattern/
  217. user-timing/
  218. vibration/
  219. video-rvfc/
  220. virtual-keyboard/
  221. visual-viewport/
  222. wai-aria/
  223. wasm/
  224. web-animations/
  225. web-bundle/
  226. web-locks/
  227. web-nfc/
  228. web-otp/
  229. web-share/
  230. webaudio/
  231. webauthn/
  232. webcodecs/
  233. WebCryptoAPI/
  234. webdriver/
  235. webgl/
  236. webgpu/
  237. webhid/
  238. webidl/
  239. webmessaging/
  240. webmidi/
  241. webnn/
  242. webrtc/
  243. webrtc-encoded-transform/
  244. webrtc-extensions/
  245. webrtc-ice/
  246. webrtc-identity/
  247. webrtc-priority/
  248. webrtc-stats/
  249. webrtc-svc/
  250. websockets/
  251. webstorage/
  252. webtransport/
  253. webusb/
  254. webvr/
  255. webvtt/
  256. webxr/
  257. window-placement/
  258. workers/
  259. worklets/
  260. x-frame-options/
  261. xhr/
  262. .azure-pipelines.yml
  263. .gitattributes
  264. .gitignore
  265. .mailmap
  266. .taskcluster.yml
  267. CODE_OF_CONDUCT.md
  268. CODEOWNERS
  269. CONTRIBUTING.md
  270. LICENSE.md
  271. lint.ignore
  272. README.md
  273. wpt
  274. wpt.py
README.md

The web-platform-tests Project

Taskcluster CI Status documentation manifest Python 3

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:

  • github.com/web-platform-tests/wpt: the canonical location of the project's source code revision history and the discussion forum for changes to the code
  • web-platform-tests.org: the documentation website; details how to set up the project, how to write tests, how to give and receive peer review, how to serve as an administrator, and more
  • wpt.live: a public deployment of the test suite, allowing anyone to run the tests by visiting from an Internet-enabled browser of their choice
  • wpt.fyi: an archive of test results collected from an array of web browsers on a regular basis
  • Real-time chat room: the wpt:matrix.org matrix channel; includes participants located around the world, but busiest during the European working day.
  • Mailing list: a public and low-traffic discussion list
  • RFCs: a repo for requesting comments on substantial changes that would impact other stakeholders or users; people who work on WPT infra are encouraged to watch the repo.

If you'd like clarification about anything, don't hesitate to ask in the chat room or on the mailing list.

Setting Up the Repo

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).

Running the Tests

See the documentation website and in particular the system setup for running tests locally.

Command Line Tools

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 server
  • wpt run - For running tests in a browser
  • wpt lint - For running the lint against all tests
  • wpt manifest - For updating or generating a MANIFEST.json test manifest
  • wpt 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.

Windows Notes

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.

Publication

The master branch is automatically synced to wpt.live and w3c-test.org.

Contributing

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:

  • Fork this repository (and make sure you're still relatively in sync with it if you forked a while ago).
  • Create a branch for your changes: git checkout -b topic.
  • Make your changes.
  • Run ./wpt lint as described above.
  • Commit locally and push that to your repo.
  • Create a pull request based on the above.

Issues with web-platform-tests

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!