blob: 878ef50fcdd4ac7f03508760499f372db4ecf4cd [file] [log] [blame] [view]
qyearsley4f0acca42017-01-30 08:18:431# Web Platform Tests
2
rbyers6299b9132017-02-10 18:06:573Interoperability between browsers is
qyearsley9c9781a2017-02-11 00:08:394[critical](https://www.chromium.org/blink/platform-predictability) to Chromium's
5mission of improving the web. We believe that leveraging and contributing to a
6shared test suite is one of the most important tools in achieving
7interoperability between browsers. The [web-platform-tests
rbyers6299b9132017-02-10 18:06:578repository](https://github.com/w3c/web-platform-tests) is the primary shared
qyearsley9c9781a2017-02-11 00:08:399test suite where all browser engines are collaborating. There's also a
rbyers6299b9132017-02-10 18:06:5710[csswg-test repository](https://github.com/w3c/csswg-test) for CSS tests, but
11that will [soon be merged into
12web-platform-tests](https://github.com/w3c/csswg-test/issues/1102).
qyearsley4f0acca42017-01-30 08:18:4313
14[TOC]
15
16## Import
17
18Chromium has mirrors
19([web-platform-tests](https://chromium.googlesource.com/external/w3c/web-platform-tests/),
20[csswg-test](https://chromium.googlesource.com/external/w3c/csswg-test/)) of the
21GitHub repos, and periodically imports a subset of the tests so that they are
22run as part of the regular Blink layout test testing process.
23
24The goal of this process are to be able to run the Web Platform Tests unmodified
25locally just as easily as we can run the Blink tests, and ensure that we are
26tracking tip-of-tree in the Web Platform Tests repository as closely as
27possible, and running as many of the tests as possible.
28
29### Automatic import process
30
31There is an automatic process for updating the Chromium copy of the Web Platform
32Tests. The import is done by the builder [w3c-test-autoroller
33builder](https://build.chromium.org/p/chromium.infra.cron/builders/w3c-test-autoroller).
34
35The easiest way to check the status of recent imports is to look at:
36
37- Recent logs on Buildbot for [w3c-test-autoroller
38 builder](https://build.chromium.org/p/chromium.infra.cron/builders/w3c-test-autoroller)
39- Recent CLs created by
40 [[email protected]](https://codereview.chromium.org/search?owner=blink-w3c-test-autoroller%40chromium.org).
41
42### Skipped tests
43
44We control which tests are imported via a file called
45[W3CImportExpectations](../../third_party/WebKit/LayoutTests/W3CImportExpectations),
46which has a list of directories to skip while importing.
47
48In addition to the directories and tests explicitly skipped there, tests may
49also be skipped for a couple other reasons, e.g. if the file path is too long
50for Windows. To check what files are skipped in import, check the recent logs
51for [w3c-test-autoroller
52builder](https://build.chromium.org/p/chromium.infra.cron/builders/w3c-test-autoroller).
53
54### Manual import
55
56To pull the latest versions of the tests that are currently being imported, you
57can also directly invoke the
58[wpt-import](../../third_party/WebKit/Tools/Scripts/wpt-import) script.
59
60That script will pull the latest version of the tests from our mirrors of the
61upstream repositories. If any new versions of tests are found, they will be
62committed locally to your local repository. You may then upload the changes.
63
qyearsley9c9781a2017-02-11 00:08:3964### Enabling import for a new directory
65
qyearsley4f0acca42017-01-30 08:18:4366If you wish to add more tests (by un-skipping some of the directories currently
67skipped in `W3CImportExpectations`), you can modify that file locally and commit
qyearsley9c9781a2017-02-11 00:08:3968it, and on the next auto-import, the new tests should be imported.
69
70If you want to import immediately (in order to try the tests out locally, etc)
71you can also run `wpt-import --allow-local-commits`, but this is not required.
qyearsley4f0acca42017-01-30 08:18:4372
73## Contributing tests back to the Web Platform Tests project.
74
75If you need to make changes to Web Platform Tests, just commit your changes
76directly to
77[LayoutTests/external/wpt](../../third_party/WebKit/LayoutTests/external/wpt)
78and the changes will be automatically upstreamed within 24 hours.
79
rbyers6299b9132017-02-10 18:06:5780Note that tests in Web Platform Tests are expected to match behavior defined by
qyearsley9c9781a2017-02-11 00:08:3981the relevant WHATWG or W3C specification, not simply Blink's behavior. If in
rbyers6299b9132017-02-10 18:06:5782doubt, please request code review from someone with expertise in the relevant
83specification text.
84
qyearsley4f0acca42017-01-30 08:18:4385Note: if you're adding a new test in `external/wpt`, you'll need to re-generate
86MANIFEST.json manually until [CL 2644783003](https://crrev.com/2644783003) is
87landed. The command to do so is:
88
89```bash
90Tools/Scripts/webkitpy/thirdparty/wpt/wpt/manifest --work \
91 --tests-root=LayoutTests/external/wpt
92```
93
qyearsley9c9781a2017-02-11 00:08:3994### What kinds of changes can be upstreamed?
95
96In general, changes involving adding, removing or modifying tests can all be
97upstreamed. From a Chromium commit, any changes outside of
98[external/wpt](../../third_party/WebKit/LayoutTests/external/wpt) will not be
99upstreamed, and any changes `*-expected.txt`, `OWNERS`, and `MANIFEST.json`,
100will also not be upstreamed.
101
102Entirely new top-level directories should generally be added upstream, since
103that's the only way to add an OWNERS file upstream. After adding a new top-level
104directory upstream, you should add a line for it in `W3CImportExpectations`.
105
qyearsley4f0acca42017-01-30 08:18:43106### Will the exported commits be linked to my GitHub profile?
107
108The email you commit with in Chromium will be the author of the commit on
109GitHub. You can [add it as a secondary address on your GitHub
110account](https://help.github.com/articles/adding-an-email-address-to-your-github-account/)
111to link your exported commits to your GitHub profile.
112
113### What if there are conflicts?
114
115This cannot be avoided entirely as the two repositories are independent, but
116should be rare with frequent imports and exports. When it does happen, manual
117intervention will be needed and in non-trivial cases you may be asked to help
118resolve the conflict.
119
120### Direct pull requests
121
122It's still possible to make direct pull requests to web-platform-tests. The
123processes for getting new tests committed the W3C repos are at
qyearsley7b458d52017-02-02 17:51:15124http://testthewebforward.org/docs/. Some specifics are at
125http://testthewebforward.org/docs/github-101.html.