Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Test Suites for Web Platform specifications—including WHATWG, W3C and others
HTML JavaScript Python CSS Haxe Makefile
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
2dcontext Parse currentColor as Canvas2D color
DOMEvents Move stopPropagation.dispatchEvent.html into place.
FileAPI Adding for support Blob.{close,isClose} #6723
IndexedDB IndexedDB: Import blink's tests for getAll/getAllKeys
WebCryptoAPI More tests for crypto.getRandomValues()
WebIDL Upstream DOMException constructor cases from Blink
XMLHttpRequest Update Web Platform tests to check for correct behavior,
ambient-light Update some IDLs to match specs better.
app-uri Fix spelling mistakes in app-uri
battery-status Improve unplugging tests for Battery Status API
common Move failing-test.html out of common.
conformance-checkers [cc] Updated some tests w/ ARIA warnings.
content-security-policy Use AsyncOpen2 in dom/workers/ScriptLoader.cpp - part 2 - WPT,
cors Remove existing console.* instances in the suite.
cssom-view [cssom-view] elementFromPoint against an image map
custom-elements Extend timeouts for three long tests
docs docs/ Add link to Manual Tests page
dom Remove reference to obsolete replaceWholeText method.
domparsing Add tests for Document#charset.
domxpath Import Opera XPath tests.
editing Do not request images from other domains
encoding Implement Encoding Standard-compliant big5 encoder. r=emk.
eventsource Rewrite event source test to be less time dependant
ext-xhtml-pubid/the-xhtml-syntax/parsing-xhtml-documents Convert files with only CRLF line endings to pure LF
fetch/nosniff Address nits from @mikewest
fonts move hierarchy to the root
gamepad Add some basic manual tests and an idlharness test for Gamepad API.
geolocation-API Merge pull request #348 from zqzhang/submission/zqzhang/geo-idl-test-…
hr-time in workers exists
html-imports Remove existing console.* instances in the suite.
html-longdesc Remove implementation reports.
html-media-capture Make assertion more common about data storage
html Merge pull request #2380 from common-nighthawk/li-html-add-coverage
http Add a test for respecting the HTTP content length header.
images Merge pull request #293 from onlimii/submission/jcxia-fileapi-url
infrastructure Move failing-test.html out of common.
innerText Implement HTMLElement.innerText. r=smaug,mats
js Merge pull request #2037 from w3c/SetPrototypeOf-window
media-source Increase timeout for unstable Media Source test, rs=Ms2ger
media Add whole load of tests for "Loading Web Pages".
mediacapture-streams getUserMedia s/PermissionDeniedError/SecurityError/.
microdata Microdata DOM API was removed in whatwg/html@2aaecb8
mixed-content Use AsyncOpen2 in dom/workers/ScriptLoader.cpp - part 2 - WPT,
navigation-timing Remove references to webidl2.js.
notifications Update notifications tag same description of pass condition
old-tests/submission Make script scheduling tests not depend on clock synchronisation betw…
page-visibility Removed trailing whitespaces and tabs. Removed webperf specs from lin…
performance-timeline Address review comments on the Performance Timeline tests.
pointerevents pointerevents: validate capture target authenticity
pointerlock Revolves
progress-events Move the test for cross-origin progress events into place.
proximity Remove references to webidl2.js.
quirks-mode Fix a couple of issues that make the…
referrer-policy Referrer-Policy: Remove dead code in wrapResult.
resource-timing Correct initiatorType of iframe element
resources @ 24f4a92 Update to latest testharness.js
screen-orientation Remove "orientation-" prefix in Screen Orientation test name
selection Increase timeout on selection/addRange.html to avoid intermittent tim…
selectors-api/tests/submissions/Opera Fix other tests that use the ParentNode-querySelector-All.js script.
selectors/attribute-selectors/attribute-case Use an actually-really-invalid selector for the invalid selector sani…
service-workers Fix wpt sandboxed-iframes.https.html test to expect rejected promises.
shadow-dom Fix resource URLs for testharness in 3 shadow-dom tests
subresource-integrity Removed extraneous console logs
svg Mention desired directory structure.
tools @ e30f343 Update to latest wpt-tools
touch-events Fix typo: "elment" [sic] => "element"
typedarrays Update test as per review
uievents Address linting errors in uievent checkin
url Test that searchParams is not supported where it should not be.
user-timing Removed trailing whitespaces and tabs. Removed webperf specs from lin…
vibration Remove a tab from vibration/.
web-animations Make 100% Keyframe returned by getFrames() have easing:linear.
webaudio Bug 1218694 - Test that AudioNode.connect() returns the node connect…
webdriver webdriver: fix lint issues
webgl Remove all manifest files from subdirectories
webmessaging Remove duplicate tests against MessagePort
webrtc Updating webplatform-tests,
websockets Fixes #8213: Implement Blob variant of WebSocket.send()
webstorage localStorage and document.domain test
webvtt fixup! Fix reftests missing rel=match excluding webvtt tests.
workers Use AsyncOpen2 in dom/workers/ScriptLoader.cpp - part 2 - WPT,
.gitignore gitignore: ignore whole directory
.gitmodules Ignore dirty tools submodule in git status
.travis.yml [infra] Cause Travis to start builds much faster. Further modifications to the CLA text.
LICENSE actual license Fix #2254: Add note to the README about CSS tests being elsewhere
config.default.json Add doc_root and ws_doc_root defaulting to null in config.default.json.
lint More helpful error message for failed ImportError
lint.whitelist explicitly whitelisting git submodules that are not currently scanned
manifest Make sure we supply the correct test root when generating the manifest.
serve Pass routes in to servers rather than relying on global state. Serve: Remove misleading shebang. Make tests self-hosting
testharness_runner.html Add testharness_runner file here for now.

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:   web-platform.test   www.web-platform.test   www1.web-platform.test   www2.web-platform.test   xn--n8j6ds53lwwkrqhv28a.web-platform.test   xn--lve-6lad.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


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, edit the config.json file, for example, 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.

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.


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.


The master branch is automatically synced to

Pull requests that have been checked are automatically mirrored to

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 .

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.

If you're looking at a section of the specification and can't figure out where the directory is for it in the tree, just run:

node tools/scripts/id2path.js your-id


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.


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:


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.

Getting Involved

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

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


Something went wrong with that request. Please try again.