Bug 1367041 - Add |mach wpt| support for Chrome, Edge and Servo, r=AutomatedTester
Using the wptrun infrastructure from upstream, it is now posible to
make it easy to run web-platform-tests in other browsers. The syntax
used is
mach wpt --product [chrome|servo|edge] [tests]
This will try to use the selected product; possibly prompting to
install dependencies like the WebDriver implementation. For servo if
the install isn't on the PATH then --binary can be used to point to
the actual location.
Because manifest metadata is kept in the same directory as expectation
data and we don't want to reuse Firefox expectation data for other
browsers, a new products subdirectory is introduced and added to the
ignore files. This will contain a subdirectory for each product into
which a copy of the test manifest is placed. It may also be used to
store any expectation data for the other products, in the same way as
testing/web-platform/meta.
MozReview-Commit-ID: 8fdCnha5t2F

--- a/testing/web-platform/README.md+++ b/testing/web-platform/README.md@@ -230,50 +230,19 @@ In order to update the manifest it is re web-platform-tests --manifest-update`. This rescans the test directory looking for new, removed, or altered tests. Running Tests In Other Browsers ------------------------------- web-platform-tests is cross browser, and the runner is compatible with multiple browsers. Therefore it's possible to check the behaviour of-tests in other browsers. This is somewhat more involved than running-them in Firefox since extra dependencies may be required. For example-to test in Chrome:--1. Download the chromedriver binary and place it somewhere sensible- e.g. `~/bin`+tests in other browsers. By default Chrome, Edge and Servo are+supported. In order to run the tests in these browsers use the+`--product` argument to wptrunner:-2. In your gecko source tree activate the virtualenv created by mach,- since this has most dependencies already installed. This is typically- in objdir/_virtualenv and is activated via e.g.-- source objdir/_virtualenv/bin/activate--3. Install the extra requirements:-- cd testing/web-platform/harness- pip install -r requirements_chrome.txt--4. Edit the config file `testing/web-platform/wptrunner.ini` so that- Chrome support is enabled by changing the section that reads:+ mach wpt --product chrome dom/historical.html- [products]- firefox =-- to read-- [products]- firefox =- chrome =-- (alternatively create a new config file elsewhere and use the- `--config` option to `runtests.py` to point wptrunner at this config- file).--5. Run `runtests.py` using the location of chromedriver as- the binary:-- cd testing/web-platform- python runtests.py --product=chrome --binary=~/bin/chromedriver --log-mach=---By default this will use the same test checkout and metadata as are in-the Gecko tree, so it's easy to compare behaviour relative to Firefox.+By default these browsers run without expectation metadata, but it can+be added in the `testing/web-platform/products/<product>`+directory. To run with the same metadata as for Firefox (so that+differences are reported as unexpected results), pass `--meta+testing/web-platform/meta` to the mach command.

new file mode 100644--- /dev/null+++ b/testing/web-platform/products/README@@ -0,0 +1,3 @@+This directory is for storing metadata files when running+web-platform-tests with non-firefox browsers. By default all+subdirectories here are ignored in VCS.\ No newline at end of file