mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
Update web-platform-tests to revision d7afcb8708eac08a614d161d5622a48172daf7e3
This commit is contained in:
parent
6f8bb4dd40
commit
edff458e23
791 changed files with 17647 additions and 10322 deletions
26
tests/wpt/web-platform-tests/docs/running-tests/chrome.md
Normal file
26
tests/wpt/web-platform-tests/docs/running-tests/chrome.md
Normal file
|
@ -0,0 +1,26 @@
|
|||
# Chrome
|
||||
|
||||
When running Chrome, there are some useful command line arguments.
|
||||
|
||||
You can inform `wpt` of the release channel of Chrome using `--channel`.
|
||||
However, `wpt` currently does not support installing Chrome or finding the
|
||||
Chrome binary of a specific channel, so you would also need to specify the path
|
||||
to the Chrome binary with `--binary`. For example, to run Chrome Dev on Linux:
|
||||
|
||||
```
|
||||
./wpt run --channel dev --binary `which google-chrome-unstable` chrome
|
||||
```
|
||||
|
||||
Note: when the channel is "dev", `wpt` will *automatically* enable all
|
||||
[experimental web platform features][1]
|
||||
(chrome://flags/#enable-experimental-web-platform-features) by passing
|
||||
`--enable-experimental-web-platform-features` to Chrome.
|
||||
|
||||
If you want to enable a specific [runtime enabled feature][1], use
|
||||
`--binary-arg` to specify the flag(s) that you want to pass to Chrome:
|
||||
|
||||
```
|
||||
./wpt run --binary-arg=--enable-blink-features=AsyncClipboard chrome clipboard-apis/
|
||||
```
|
||||
|
||||
[1]: https://www.chromium.org/blink/runtime-enabled-features
|
|
@ -0,0 +1,36 @@
|
|||
# Chrome for Android
|
||||
|
||||
To run WPT on Chrome on an Android device, some additional set up is required.
|
||||
|
||||
First of all, as usual Android development, we need to have `adb` and be able to
|
||||
connect to the device.
|
||||
|
||||
## Hosts
|
||||
|
||||
Until we find a better way, we need to root the Android device and update the
|
||||
/etc/hosts file to include the entries printed by `./wpt make-hosts-file`.
|
||||
|
||||
## CA certificate
|
||||
|
||||
In order to run HTTPS tests, we need to add
|
||||
[WPT's CA](https://github.com/web-platform-tests/wpt/blob/master/tools/certs/cacert.pem)
|
||||
to the phone. First, convert the certificate from PEM to CRT:
|
||||
|
||||
```
|
||||
openssl x509 -outform der -in tools/certs/cacert.pem -out cacert.crt
|
||||
```
|
||||
|
||||
Then copy `cacert.crt` to your phone's external storage (preferably to
|
||||
Downloads/ as it'll be easier to find). Open Settings -> Security & location ->
|
||||
Encryption & credentials -> Install from storage. Find and install `cacert.crt`.
|
||||
(The setting entries might be slightly different based your Android version.)
|
||||
|
||||
Note that having this CA installed on your device outside of a test
|
||||
environment represents a security risk.
|
||||
|
||||
|
||||
Finally, we may run wpt with the `chrome_android` product
|
||||
|
||||
```
|
||||
./wpt run chrome_android [test_list]
|
||||
```
|
|
@ -0,0 +1,22 @@
|
|||
# Writing Your Own Runner
|
||||
|
||||
Most test runners have two stages: finding all tests, followed by
|
||||
executing them (or a subset thereof).
|
||||
|
||||
To find all tests in the repository, it is **strongly** recommended to
|
||||
use the included `wpt manifest` tool: the required behaviors are more
|
||||
complex than what are documented (especially when it comes to
|
||||
precedence of the various possibilities and some undocumented legacy
|
||||
ways to define test types), and hence its behavior should be
|
||||
considered the canonical definition of how to enumerate tests and find
|
||||
their type in the repository.
|
||||
|
||||
For test execution, please read the documentation for the various test types
|
||||
very carefully and then check your understanding on
|
||||
the [mailing list][public-test-infra] or [IRC][] ([webclient][web irc], join
|
||||
channel `#testing`). It's possible edge-case behavior isn't properly
|
||||
documented!
|
||||
|
||||
[public-test-infra]: https://lists.w3.org/Archives/Public/public-test-infra/
|
||||
[IRC]: irc://irc.w3.org:6667/testing
|
||||
[web irc]: http://irc.w3.org
|
|
@ -0,0 +1,108 @@
|
|||
# Running Tests from the Local System
|
||||
|
||||
The tests are designed to be run from your local computer.
|
||||
|
||||
## System Setup
|
||||
|
||||
The test environment requires [Python 2.7+](http://www.python.org/downloads)
|
||||
(but not Python 3.x).
|
||||
|
||||
On Windows, be sure to add the Python directory (`c:\python2x`, by default) to
|
||||
your `%Path%` [Environment Variable](http://www.computerhope.com/issues/ch000549.htm),
|
||||
and read the [Windows Notes](#windows-notes) section below.
|
||||
|
||||
To get the tests running, you need to set up the test domains in your
|
||||
[`hosts` file](http://en.wikipedia.org/wiki/Hosts_%28file%29%23Location_in_the_file_system).
|
||||
|
||||
The necessary content can be generated with `./wpt make-hosts-file`; on
|
||||
Windows, you will need to preceed the prior command with `python` or
|
||||
the path to the Python binary (`python wpt make-hosts-file`).
|
||||
|
||||
For example, on most UNIX-like systems, you can setup the hosts file with:
|
||||
|
||||
```bash
|
||||
./wpt make-hosts-file | sudo tee -a /etc/hosts
|
||||
```
|
||||
|
||||
And on Windows (this must be run in a PowerShell session with Administrator privileges):
|
||||
|
||||
```bash
|
||||
python wpt make-hosts-file | Out-File %SystemRoot%\System32\drivers\etc\hosts -Encoding ascii -Append
|
||||
```
|
||||
|
||||
If you are behind a proxy, you also need to make sure the domains above are
|
||||
excluded from your proxy lookups.
|
||||
|
||||
### Windows Notes
|
||||
|
||||
Generally Windows Subsystem for Linux will provide the smoothest user
|
||||
experience for running web-platform-tests on Windows.
|
||||
|
||||
The standard Windows shell requires that all `wpt` commands are prefixed
|
||||
by the Python binary i.e. assuming `python` is on your path the server is
|
||||
started using:
|
||||
|
||||
`python wpt serve`
|
||||
|
||||
## Via the browser
|
||||
|
||||
The test environment can then be started using
|
||||
|
||||
./wpt serve
|
||||
|
||||
This will start HTTP servers on two ports and a websockets server on
|
||||
one port. By default the web servers start on ports 8000 and 8443 and the other
|
||||
ports are randomly-chosen free ports. Tests must be loaded from the
|
||||
*first* HTTP server in the output. To change the ports,
|
||||
create a `config.json` file in the wpt root directory, and add
|
||||
port definitions of your choice e.g.:
|
||||
|
||||
```
|
||||
{
|
||||
"ports": {
|
||||
"http": [1234, "auto"],
|
||||
"https":[5678]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
After your `hosts` file is configured, the servers will be locally accessible at:
|
||||
|
||||
http://web-platform.test:8000/<br>
|
||||
https://web-platform.test:8443/ *
|
||||
|
||||
This server has all the capabilities of the publicly-deployed version--see
|
||||
[Running the Tests from the Web](from-web).
|
||||
|
||||
\**See [Trusting Root CA](https://github.com/web-platform-tests/wpt/blob/master/README.md#trusting-root-ca)*
|
||||
|
||||
## Via the command line
|
||||
|
||||
Many tests can be automatically executed in a new browser instance using
|
||||
|
||||
./wpt run [browsername] [tests]
|
||||
|
||||
This will automatically load the tests in the chosen browser and extract the
|
||||
test results. For example to run the `dom/historical.html` tests in a local
|
||||
copy of Chrome:
|
||||
|
||||
./wpt run chrome dom/historical.html
|
||||
|
||||
Or to run in a specified copy of Firefox:
|
||||
|
||||
./wpt run --binary ~/local/firefox/firefox firefox dom/historical.html
|
||||
|
||||
For details on the supported products and a large number of other options for
|
||||
customising the test run:
|
||||
|
||||
./wpt run --help
|
||||
|
||||
Additional browser-specific documentation:
|
||||
|
||||
```eval_rst
|
||||
.. toctree::
|
||||
|
||||
chrome
|
||||
chrome_android
|
||||
safari
|
||||
```
|
22
tests/wpt/web-platform-tests/docs/running-tests/from-web.md
Normal file
22
tests/wpt/web-platform-tests/docs/running-tests/from-web.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Running Tests from the Web
|
||||
|
||||
Tests that have been merged on GitHub are mirrored at [http://w3c-test.org/][w3c-test].
|
||||
[On properly-configured systems](from-local-system), local files may also be
|
||||
served from the URL [http://web-platform.test](http://web-platform.test).
|
||||
|
||||
For running multiple tests inside a browser, there is a test runner
|
||||
located at `/tools/runner/index.html`.
|
||||
|
||||
This allows all the tests, or those matching a specific prefix
|
||||
(e.g. all tests under `/dom/`) to be run. For testharness.js tests,
|
||||
the results will be automatically collected, while the runner
|
||||
provides a simple UI for manually comparing reftest rendering and
|
||||
running manual tests.
|
||||
|
||||
Note, however, it does not currently handle more complex reftests with
|
||||
more than one reference involved.
|
||||
|
||||
Because it runs entirely in-browser, this runner cannot deal with
|
||||
edge-cases like tests that cause the browser to crash or hang.
|
||||
|
||||
[w3c-test]: http://w3c-test.org
|
19
tests/wpt/web-platform-tests/docs/running-tests/index.md
Normal file
19
tests/wpt/web-platform-tests/docs/running-tests/index.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Running Tests
|
||||
|
||||
```eval_rst
|
||||
.. toctree::
|
||||
|
||||
from-web
|
||||
from-local-system
|
||||
custom-runner
|
||||
```
|
||||
|
||||
The simplest way to run the tests is via the public website. More detail on
|
||||
that approach is available in [Running tests from the Web](from-web).
|
||||
|
||||
Contributors who are interested in modifying and creating tests should refer to
|
||||
[Running Tests from the Local System](from-local-system).
|
||||
|
||||
Advanced use cases may call for a customized method of executing the tests.
|
||||
Guidelines for writing a custom "runner" are available at [Writing Your Own
|
||||
Runner](custom-runner).
|
33
tests/wpt/web-platform-tests/docs/running-tests/safari.md
Normal file
33
tests/wpt/web-platform-tests/docs/running-tests/safari.md
Normal file
|
@ -0,0 +1,33 @@
|
|||
# Safari
|
||||
|
||||
To run Safari on macOS, some manual setup is required. Some steps are different
|
||||
for Safari and Safari Technology Preview.
|
||||
|
||||
* Allow Safari to be controlled by SafariDriver:
|
||||
* `safaridriver --enable` or
|
||||
* `"/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver" --enable`
|
||||
|
||||
* Allow pop-up windows:
|
||||
* `defaults write com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically 1` or
|
||||
* `defaults write com.apple.SafariTechnologyPreview WebKitJavaScriptCanOpenWindowsAutomatically 1`
|
||||
|
||||
* Turn on additional experimental features Safari Technology Preview:
|
||||
* `defaults write com.apple.SafariTechnologyPreview ExperimentalServerTimingEnabled 1`
|
||||
|
||||
* Trust the certificate:
|
||||
* `security add-trusted-cert -k "$(security default-keychain | cut -d\" -f2)" tools/certs/cacert.pem`
|
||||
|
||||
* Set `no_proxy='*'` in your environment. This is a
|
||||
workaround for a known
|
||||
[macOS High Sierra issue](https://github.com/web-platform-tests/wpt/issues/9007).
|
||||
|
||||
Now, run the tests using the `safari` product:
|
||||
```
|
||||
./wpt run safari [test_list]
|
||||
```
|
||||
|
||||
This will use the `safaridriver` found on the path, which will be stable Safari.
|
||||
To run Safari Technology Preview instead, use the `--channel=preview` argument:
|
||||
```
|
||||
./wpt run --channel=preview safari [test_list]
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue