Split Chrome and Chromium into separate products (#32485)

* Chromium as a separate product

Chromium will need to be pulled from Chrome's implementation as a separate product. This commit creates the skeleton for Chromium as a separate product, while still being functionally identical to Chrome.

* Separate Chrome and Chromium functionality

Currently, we only install Chromium tip-of-tree using the `./wpt install` command. Because a Chrome binary cannot be installed, we no longer try to find a binary in the virtual environment for Chrome. Addtionally, trying to install Chrome via wpt will raise a NotImplementedError.

Functionality for installing chromedriver is shared, however the chromedriver for each product will now be saved in a folder with their respective product name i.e. `venv/bin/{product}/chromedriver`. This removes the need to detect the wrong chromedriver or reinstall a new chromedriver when switching from testing Chrome to Chromium, or vice-versa.

Some refactoring and moving some actions to private methods has occurred in this commit.

* allow user to supply browser version for install command

the `--browser-version` command line argument is now supported for `./wpt install`. This will allow the user to download a specific version of the Chromium browser binary or chromedriver associated with that version.

* update install tests to reflect split change

Install also now includes a check to make sure that the `--browser-version` install argument can only be supplied with chrome and chromium product.

* increase pipeline timeout

* adjust browser_version install logic

Changing logic for accessing the browser_version command line argument and ensuring that it is not called on browsers that do not support it.

* line and string reformatting

 for Chrome/Chromium classes in browser.py

* ensure browser setup checks venv path for webdrvier

* Refactor run.py to allow browsers to use same setup

Edge, Chrome, and Chromium have very similar browser setup processes. This change refactors the instantiation of browser setup classes to allow multiple browsers to use the same setup class.

* Error handling for checking webdriver version

If a null webdriver path is passed to `webdriver_version`, It will now show a warning and return null.

remove whitespace

small refactoring changes to browser.py

ChromeChromiumBase's private method `_get_chromium_url_by_version` no longer takes in a file name argument to reduce coupling.
- Getting latest chromium revision has been moved to a separate private method, `_get_latest_chromium_revision`.

* Add new test for attempting to install Chrome

A new test was added to ensure a NotImplementedError is raised when attempting to install Chrome via `wpt install`

remove line whitespace

remove unused variable

* Ensure Chromium revision number consistency

This change ensures that if multiple Chromium components are downloaded in a single invocation, all of those components will be downloaded using the same revision number. Affects the browser binary, webdriver, and mojojs.

* Changes based on review feedback

- f-string changes
- Update logic for revision numbers to be more readable
- Ensure Chrome and Chromium's webdriver installs are handled separately and properly
- Move revision number references to Chromium class
- Move Chromium-specific methods to correct class
- Update tests to use Chromium over Chrome

* Change find_binary handling for Chromium

- Check specific channel directories for Chromium
- Pass filename to _format_chromium_snapshot_url
- Throw request exception when all Chromedriver downloads fail for Chrome

* Chrome installs chromedriver by version arg

- Keep successful download url, not revision
- Raise FileNotFoundError for install_webdriver
- If not browser binary is provided or detected.
= More concise logic for browser setup

* Use _venv3 directory to install/detect binary if it exists (#32835)

* docs describing installation and detection

- Concise commenting and attributes
- Use Chrome's wptrunner functions for Chromium
- Update Chromium BrowserSetup to inherit Chrome's

* Add links to documentation

* make changes to webdriver install decisions

* change docs wording

* update tests

* Move revision detection method into shared class

* explicit typing for BrowserSetup attribute

* correct mypy typing

* Changes suggest by @jgraham

Small wording changes to comments/docstrings as well.

* add filename to last url used

* Update docs/running-tests/chrome-chromium-installation-detection.md

Co-authored-by: Philip Jägenstedt <philip@foolip.org>

* Update docs/running-tests/chrome-chromium-installation-detection.md

Co-authored-by: Philip Jägenstedt <philip@foolip.org>
Update docs/running-tests/chrome-chromium-installation-detection.md

* Apply suggestions from @foolip docs review

Co-authored-by: Philip Jägenstedt <philip@foolip.org>

* Doc formatting and change request

also,
- small syntactic and comment changes
- added TODO comment for Chrome version matching logic

* Update docs

* Update chrome-chromium-installation-detection.md

* Apply suggestions from code review

changes suggested by @foolip

Co-authored-by: Philip Jägenstedt <philip@foolip.org>

* Changes based on feedback

- descriptive comment about getting base revision from version
- remove duplicated code

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