Test Suites for Web Platform specifications—including WHATWG, W3C and others
HTML JavaScript GLSL Python CSS Ruby
Latest commit 8493c04 Nov 30, 2016 @mfoltzgoogle mfoltzgoogle committed with tidoust [Presentation API] Fix connect, terminate and presentation page (#4256)
This update partially addresses #4040. It fixes the test on the `connect` event
and the misnamed event in the `terminate` test.

The `start()` promise test that checks for `InvalidAccessError` was also not
returning a Promise in practice.

The update also fixes the presentation page: the code was missing a curly
bracket and was not expecting the right object in response to the
`connectionavailable` event.
Permalink
Failed to load latest commit information.
2dcontext make auto generation a util function Nov 29, 2016
DOM-parsing/todo Add DOM parsing and serialization tests (#493) Aug 31, 2016
FileAPI Reduced my number of notications Nov 29, 2016
IndexedDB Merge pull request #4220 from pwnall/idb_tests2 Nov 19, 2016
WebCryptoAPI Merge pull request #3954 from mwatson2/unwrap-non-extractable-keys Nov 15, 2016
WebIDL Test current Realm (still to be defined in more detail) Oct 13, 2016
XMLHttpRequest Reduced my number of notications Nov 29, 2016
ambient-light AmbientLightSensor: add some basic functionality tests (#3696) Sep 18, 2016
annotation-model Update to address misinterpretation of CR spec. (#4197) Nov 12, 2016
annotation-protocol Removed commented out lines from OPTIONS (#4105) Oct 28, 2016
annotation-vocab Annotation vocabulary setup (#4231) Nov 22, 2016
app-uri Use correct paths to testharness.js and testharnessreport.js. (#3539) Aug 24, 2016
battery-status Battery: Fix racy issue in battery-promise-iframe.html (#3191) Jun 20, 2016
bluetooth WebBluetooth WPT tests Nov 7, 2016
common Port test_bug411103.html to wpt; Nov 2, 2016
compat A mochitest to verify that when text-decoration-color is currentColor… Oct 7, 2016
conformance-checkers [cc] Remove test that expects iframe with content to be valid Nov 22, 2016
console Add an OWNERS file for console Oct 17, 2016
content-security-policy Upstreaming changes to CSP 'javascript:' from Blink. (#4205) Nov 14, 2016
cookies test cookie path matching Oct 31, 2016
cors Make some OWNERS files more accurate Nov 11, 2016
cssom-view elementFromPoint: fix scrolled out of view cases (#4217) Nov 22, 2016
cssom Add a test of basic CSS value serialization roundtripping behaviour. Nov 1, 2016
custom-elements Import a WebKit test for the element queue. (#4164) Nov 3, 2016
docs Remove mentions of critic, now it's dead. Sep 23, 2016
dom Reduced my number of notications Nov 29, 2016
domparsing Make some OWNERS files more accurate Nov 11, 2016
domxpath fixup! Check which node is returned in the xml_xpath_tests.xml test d… Nov 24, 2016
dpub-aam Added placeholder for dpub-aria tests. (#4057) Nov 4, 2016
dpub-aria Added placeholder for dpub-aria tests. (#4057) Nov 4, 2016
editing Respect type-in state when caching inline styles; (#3885) Oct 6, 2016
encoding Make some OWNERS files more accurate Nov 11, 2016
encrypted-media [eme] Add missing ; to unique-origin.js (#4107) Oct 31, 2016
eventsource Make some OWNERS files more accurate Nov 11, 2016
ext-xhtml-pubid/the-xhtml-syntax/parsing-xhtml-documents Convert files with only CRLF line endings to pure LF Jan 28, 2014
fetch Fetch: align multipart/form-data with HTML Nov 25, 2016
fonts Import MathML tests for the mathvariant attribute. Oct 19, 2016
fullscreen Upstream Blink's Fullscreen tests as manual tests Sep 28, 2016
gamepad Add OWNERS files generated from commit log. Feb 2, 2016
generic-sensor Add IDL harness tests for generic sensor and ambient light APIs. Remo… Apr 17, 2016
geolocation-API Add OWNERS files generated from commit log. Feb 2, 2016
hr-time Updated WebIDL to match hr-time-2 Oct 24, 2016
html-imports Remove more testharness.css links (#2217) Mar 31, 2016
html-longdesc Add OWNERS files generated from commit log. Feb 2, 2016
html-media-capture Move csswg-test-style manual tests to actually be manual (#4245) Nov 24, 2016
html Reduced my number of notications Nov 29, 2016
http Cleanup basic-auth-cache test. (#3812) Sep 23, 2016
imagebitmap-renderingcontext Clean up ImageBitmapRenderingContext tests Nov 14, 2016
images Add OWNERS files generated from commit log. Feb 2, 2016
infrastructure Move failing-test.html out of common. Feb 3, 2015
innerText Test innerText getter for <select>, <optgroup> and <option> Nov 3, 2016
input-events added new folder for input-events (#3537) Aug 25, 2016
js Add a test for incumbent global handling when invoking promise callba… Apr 8, 2016
mathml Remove gratuitous metadata and self-loop in reftest graph Nov 22, 2016
media-source Make some OWNERS files more accurate Nov 11, 2016
media Remove self from all OWNERS files (#2907) Apr 26, 2016
mediacapture-record Test the BlobEvent constructor (#3749) Oct 6, 2016
mediacapture-streams Get a MediaStreamTrack instance from WebAudio for event constructor t… Sep 21, 2016
microdata Microdata DOM API was removed in whatwg/html@2aaecb8 Oct 8, 2015
mixed-content Provide a mode whenever calling open() in Python. (#3311); r=Ms2ger Jul 22, 2016
navigation-timing Added more reviewers for webperf with authorization from the individu… Jun 21, 2016
notifications Add OWNERS files generated from commit log. Feb 2, 2016
offscreen-canvas/tools make auto generation a util function Nov 29, 2016
old-tests Mark these tests explicitly as manual so they get marked as a test Sep 14, 2016
orientation-event Import test cases from DVCS for Device Orientation Event (#350) Jun 13, 2016
page-visibility Updated WebIDL to match Page Visibility 2 Nov 12, 2016
payment-request Add copyright since test originated from Chromium Aug 19, 2016
performance-timeline Test to address w3c/performance-timeline#57 Sep 29, 2016
pointerevents Add NavidZ to the PointerEvents OWNERS file Oct 31, 2016
pointerlock Fix step_func_done() usage in pointerlock_shadow-manual.html (#3919) Oct 17, 2016
presentation-api [Presentation API] Fix connect, terminate and presentation page (#4256) Nov 30, 2016
progress-events Remove invalid-as-of-ES6 test of ProgressEvent.length (#3068) May 25, 2016
proximity Add OWNERS files generated from commit log. Feb 2, 2016
quirks-mode Test lack of support for list item bullet size quirk (#3192) Jun 20, 2016
referrer-policy Add referrer policy test case for srcdoc iframes with own policy (#4226) Nov 19, 2016
resource-timing fix Resource Timing test for transferSize (#3872) Oct 4, 2016
resources @ 873f968 Update resources. Oct 25, 2016
screen-orientation Add OWNERS files generated from commit log. Feb 2, 2016
secure-contexts Implement isSecureContext for worker scopes. Nov 2, 2016
selection Request long timeout for selection/collapse.html. Apr 8, 2016
selectors-api/tests/submissions/Opera Fix other tests that use the ParentNode-querySelector-All.js script. Jul 20, 2015
selectors Web platform test for child-indexed selectors matching the root eleme… Oct 7, 2016
service-workers Make test setup resilient against buggy implementations (#4233) Nov 22, 2016
shadow-dom Fixed expectation relying on :last-child bug in Blink. Nov 16, 2016
streams Fix a streams test that forgot to return a promise Nov 2, 2016
subresource-integrity Fix testharness.js path in subresources-integrity tests, Jun 9, 2016
svg fixup! Test SVGUnitTypes changes (no longer a mixin) Nov 24, 2016
tools @ 00a578d Update to latest wpt-tools Nov 2, 2016
touch-events Expand on the Touch constructor tests (#3748) Sep 29, 2016
typedarrays Add OWNERS files generated from commit log. Feb 2, 2016
uievents Merge pull request #3864 from cdumez/keyboard_replace_OS_Meta Oct 14, 2016
url Move URL origin tests to new file Nov 18, 2016
user-timing Added more reviewers for webperf with authorization from the individu… Jun 21, 2016
vibration Remove more testharness.css links (#2217) Mar 31, 2016
wai-aria Initial add of wai-aria folder. (#3474) Aug 19, 2016
web-animations Simplify tests for checking the finish notification steps Oct 14, 2016
webaudio Implement ConstantSourceNode; Nov 2, 2016
webauthn delinting Oct 29, 2016
webdriver webdriver: fix resize tests (#3859) Oct 10, 2016
webgl Replaced references to mxr.mozilla.org in the codebase with dxr.mozil… Aug 25, 2016
webmessaging Reduced my number of notications Nov 29, 2016
webrtc Merge pull request #4113 from fippo/mediadevices-gum Oct 31, 2016
websockets Reduced my number of notications Nov 29, 2016
webstorage Reduced my number of notications Nov 29, 2016
webvtt part5 : the value of position and line are double. Aug 1, 2016
workers SharedWorker no longer throws URLMismatchError (#3942) Oct 17, 2016
.gitignore Add .DS_Store to .gitignore. Oct 19, 2016
.gitmodules Ignore dirty tools submodule in git status Nov 16, 2015
.travis.yml Enable logging test stability results to GitHub PR. Oct 20, 2016
CONTRIBUTING.md Further modifications to the CLA text. Aug 8, 2013
LICENSE actual license May 29, 2013
README.md Mention Bash on Ubuntu on Windows in docs Nov 29, 2016
check_stability.py Update Firefox archive URL (#4249) Nov 25, 2016
ci_lint.sh Add a travis job for testing PR stability Oct 20, 2016
ci_stability.sh Reduce logging coming from wptrunner in stability check (#4066) Oct 24, 2016
config.default.json serve: Add empty "aliases" config so that it can be overridden. (#4077) Nov 2, 2016
diff-manifest.py Fix a travis failure with git merge-base. (#3817) Sep 23, 2016
lint More helpful error message for failed ImportError Aug 9, 2015
lint.whitelist Make stability checker report link to w3c-test.org URLs (#4050) Oct 27, 2016
manifest Make sure we supply the correct test root when generating the manifest. Mar 30, 2015
serve Pass routes in to servers rather than relying on global state. Mar 11, 2015
serve.py Add a warning when running ./serve when tools.serve cannot be imported ( Oct 30, 2016
server-side.md Make tests self-hosting Jan 6, 2014
testharness_runner.html Add testharness_runner file here for now. Apr 17, 2015

README.md

The Web Platform Tests Project IRC chat

The Web Platform Tests Project is a W3C-coordinated attempt to build a cross-browser testsuite for the Web-platform stack. However, for mainly historic reasons, the CSS WG testsuite is in a separate repository, csswg-test. 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.

Running the Tests

The tests are designed to be run from your local computer. The test environment requires Python 2.7+ (but not Python 3.x). You will also need a copy of OpenSSL. Users on Windows should read the Windows Notes section below.

To get the tests running, you need to set up the test domains in your hosts file. The following entries are required:

127.0.0.1   web-platform.test
127.0.0.1   www.web-platform.test
127.0.0.1   www1.web-platform.test
127.0.0.1   www2.web-platform.test
127.0.0.1   xn--n8j6ds53lwwkrqhv28a.web-platform.test
127.0.0.1   xn--lve-6lad.web-platform.test
0.0.0.0     nonexistent-origin.web-platform.test

Because web-platform-tests uses git submodules, you must ensure that these are up to date. In the root of your checkout, run:

git submodule update --init --recursive

The test environment can then be started using

./serve

This will start HTTP servers on two ports and a websockets server on one port. By default one web server starts on port 8000 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, copy the config.default.json file to config.json and edit the new file, replacing the part that reads:

"http": [8000, "auto"]

to some port of your choice e.g.

"http": [1234, "auto"]

If you installed OpenSSL in such a way that running openssl at a command line doesn't work, you also need to adjust the path to the OpenSSL binary. This can be done by adding a section to config.json like:

"ssl": {"openssl": {"binary": "/path/to/openssl"}}

Windows Notes

Running wptserve with SSL enabled on Windows typically requires installing an OpenSSL distribution. Shining Light provide a convenient installer that is known to work, but requires a little extra setup.

After installation ensure that the path to OpenSSL is on your %Path% environment variable.

Then set the path to the default OpenSSL configuration file (usually something like C:\OpenSSL-Win32\bin\openssl.cfg in the server configuration. To do this copy config.default.json in the web-platform-tests root to config.json. Then edit the JSON so that the key ssl/openssl/base_conf_path has a value that is the path to the OpenSSL config file.

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

Test Runner

There is a test runner that is designed to provide a convenient way to run the web-platform tests in-browser. It will run testharness.js tests automatically but requires manual work for reftests and manual tests.

The runner can be found at /tools/runner/index.html on the local server i.e.

http://web-platform.test:8000/tools/runner/index.html

in the default configuration. The first time you use this it has to generate a manifest of all tests. This may take some time, so please be patient.

Publication

The master branch is automatically synced to http://w3c-test.org/.

Pull requests that have been checked are automatically mirrored to http://w3c-test.org/submissions/.

Finding Things

Each top-level directory represents a W3C specification: the name matches the shortname used after the canonical address of the said specification under http://www.w3.org/TR/ .

For some of the specifications, the tree under the top-level directory represents the sections of the respective documents, using the section IDs for directory names, with a maximum of three levels deep.

So if you're looking for tests in HTML for "The History interface", they will be under html/browsers/history/the-history-interface/.

Various resources that tests depend on are in common, images, and fonts.

Branches

In the vast majority of cases the only upstream branch that you should need to care about is master. If you see other branches in the repository, you can generally safely ignore them.

Contributing

Save the Web, Write Some Tests!

Absolutely everyone is welcome (and even encouraged) to contribute to test development, so long as you fulfill the contribution requirements detailed in the Contributing Guidelines. 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 the lint script described below.
  • Commit locally and push that to your repo.
  • Send in a pull request based on the above.

Lint tool

We have a lint tool for catching common mistakes in test files. You can run it manually by starting the lint executable from the root of your local web-platform-tests working directory like this:

./lint

The lint tool is also run automatically for every submitted pull request, and reviewers will not merge branches with tests that have lint errors, so you must fix any errors the lint tool reports. For details on doing that, see the lint-tool documentation.

But in the unusual case of error reports for things essential to a certain test or that for other exceptional reasons shouldn't prevent a merge of a test, update and commit the lint.whitelist file in the web-platform-tests root directory to suppress the error reports. For details on doing that, see the lint-tool documentation.

Adding command-line scripts ("tools" subdirs)

Sometimes you may want to add a script to the repository that's meant to be used from the command line, not from a browser (e.g., a script for generating test files). If you want to ensure (e.g., for security reasons) that such scripts won't be handled by the HTTP server, but will instead only be usable from the command line, then place them in either:

  • the tools subdir at the root of the repository, or

  • the tools subdir at the root of any top-level directory in the repository which contains the tests the script is meant to be used with

Any files in those tools directories won't be handled by the HTTP server; instead the server will return a 404 if a user navigates to the URL for a file within them.

If you want to add a script for use with a particular set of tests but there isn't yet any tools subdir at the root of a top-level directory in the repository containing those tests, you can create a tools subdir at the root of that top-level directory and place your scripts there.

For example, if you wanted to add a script for use with tests in the notifications directory, create the notifications/tools subdir and put your script there.

Test Review

We can sometimes take a little while to go through pull requests because we have to go through all the tests and ensure that they match the specification correctly. But we look at all of them, and take everything that we can.

OWNERS files are used only to indicate who should be notified of pull requests. If you are interested in receiving notifications of proposed changes to tests in a given directory, feel free to add yourself to the OWNERS file. Anyone with expertise in the specification under test can approve a pull request. In particular, if a test change has already been adequately reviewed "upstream" in another repository, it can be pushed here without any further review by supplying a link to the upstream review.

Getting Involved

If you wish to contribute actively, you're very welcome to join the [email protected] mailing list (low traffic) by signing up to our mailing list. The mailing list is archived.

Join us on irc #testing (irc.w3.org, port 6665). The channel is archived.

Documentation