HTML JavaScript GLSL Python CSS Ruby
Latest commit 3c1489c Feb 17, 2017 @cdumez cdumez committed with domenic Make running order of test cases deterministic in html/browsers/brows…
…ing-the-web/unloading-documents/beforeunload-canceling.html (#4920)

WebKit's testharness prints out the returnValue of the BeforeUnloadEvent and
those are printed in a non-deterministic order given that the order of the
tests relies on the order of the load events firing for each frame. Make the
order deterministic to address flakiness issues in harnesses like the one
used by WebKit.
Permalink
Failed to load latest commit information.
2dcontext Rewrite toBlob tests outside the canvas harness. Feb 10, 2017
DOM-parsing/todo Add DOM parsing and serialization tests (#493) Aug 31, 2016
FileAPI Update tests for removal of Blob.close() method. (#4783) Feb 10, 2017
IndexedDB IndexedDB: Avoid global leaks through undeclared variables Feb 17, 2017
WebCryptoAPI Update timeout annotations to the new syntax. (#4710) Feb 3, 2017
WebIDL Revert "Update current-realm.html test (#4378)" Jan 5, 2017
XMLHttpRequest XMLHttpRequest should reset timers when send() is executed again, Feb 15, 2017
accelerometer Add IDL harness tests for motion sensors Dec 2, 2016
ambient-light Fix compatibility issue between idlharness.js and chromium Dec 2, 2016
annotation-model Annotation model fixreqs (#4232) Dec 13, 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
assumptions Move myself around in OWNERS files (#4774) Feb 9, 2017
auxclick Add the auxclick test folder and a test for it (#4293) Dec 14, 2016
battery-status Battery: Fix racy issue in battery-promise-iframe.html (#3191) Jun 20, 2016
bluetooth Rename Blacklist to Blocklist (#4213) Jan 31, 2017
clear-site-data Add basic tests for the Clear-Site-Data header (#4317) Dec 15, 2016
clipboard Create OWNERS (#4536) Jan 30, 2017
common Fixup bad merge of serviceworker get-host-info.sub.js changes (#4877) Feb 15, 2017
compat A mochitest to verify that when text-decoration-color is currentColor… Oct 7, 2016
conformance-checkers cc Add tests that exercise table-integrity checking Jan 30, 2017
console Add an OWNERS file for console Oct 17, 2016
content-security-policy Only allow valid base64-values for CSP nonce and hash sources, per spec. Jan 3, 2017
cookies Modify errors from try server, Jan 3, 2017
cors Update @Velmont's name. Jan 31, 2017
css-values Add test for unset value storage Dec 28, 2016
cssom-view Add a test for non-support of DOMRectList. Feb 2, 2017
cssom Support origins in CSSOM stylesheets Feb 6, 2017
custom-elements [custom-elements] Remove duplicated test Feb 8, 2017
docs web-platform-tests.org index: Make images clickable. (#4891) Feb 16, 2017
dom [dom] Generate unique names for distinct tests Feb 9, 2017
domparsing Test that createContextualFragment works on a variety of contexts Jan 10, 2017
domxpath Add a test for the XPath interfaces (#4834) Feb 15, 2017
dpub-aam Added placeholder for dpub-aria tests. (#4057) Nov 4, 2016
dpub-aria Dpub vocab (#4387) Jan 31, 2017
editing Respect type-in state when caching inline styles; (#3885) Oct 6, 2016
encoding Encoding: Consolidate label tests to one per label Jan 20, 2017
encrypted-media Remove message handler and long timeout from tests that don't need them. Dec 21, 2016
eventsource Test that various MessageEvents are trusted Feb 8, 2017
ext-xhtml-pubid/the-xhtml-syntax/parsing-xhtml-documents Convert files with only CRLF line endings to pure LF Jan 28, 2014
fetch Add some tests for the spec behavior. Feb 15, 2017
fonts Move myself around in OWNERS files (#4774) Feb 9, 2017
fullscreen Revert changes to document-onfullscreenerror.html working around impl… Feb 9, 2017
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
gyroscope Add IDL harness tests for motion sensors Dec 2, 2016
hr-time [hr-time] Fix IDL to get correct testing of Global property Feb 3, 2017
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 Make running order of test cases deterministic in html/browsers/brows… Feb 17, 2017
http Cleanup basic-auth-cache test. (#3812) Sep 23, 2016
imagebitmap-renderingcontext Clean up ImageBitmapRenderingContext tests Nov 14, 2016
images Move myself around in OWNERS files (#4774) Feb 9, 2017
infrastructure Move failing-test.html out of common. Feb 3, 2015
innerText innerText setter should replace existing text node Jan 17, 2017
input-events Add IDL test for partial InputEvent Dec 16, 2016
js Add a test for incumbent global handling when invoking promise callba… Apr 8, 2016
magnetometer Add IDL harness tests for motion sensors Dec 2, 2016
mathml Remove gratuitous metadata and self-loop in reftest graph Nov 22, 2016
media-capabilities Media Capabilities: stub implementation of mediaCapabilities.query(). Feb 15, 2017
media-source Do not expect init segment to be parsed when appending corrupted data. Jan 3, 2017
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
mediasession Media Session: move all tests but mojo/ ones to external/wpt/. Feb 9, 2017
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 Update NT2 name to be the requested URL instead of 'document' Feb 7, 2017
notifications Notification tests for whatwg/notifications#92 Jan 13, 2017
offscreen-canvas Move myself around in OWNERS files (#4774) Feb 9, 2017
old-tests Reindent /old-tests/submission/Opera/script_scheduling/078.html Feb 6, 2017
orientation-event Sync'ed with February 16 2016 Device Orientation spec Jan 31, 2017
page-visibility Updated WebIDL to match Page Visibility 2 Nov 12, 2016
payment-request Test same origin-domain for BC containers and allowpaymentrequest Jan 25, 2017
performance-timeline Test to address w3c/performance-timeline#57 Sep 29, 2016
pointerevents [WPT Export] Remove whitespace in a pointerevents WPT test to test WP… Feb 14, 2017
pointerlock Fix step_func_done() usage in pointerlock_shadow-manual.html (#3919) Oct 17, 2016
preload Various improvements to the existing set of preload tests Feb 8, 2017
presentation-api [Presentaiton API] Drop duplicate "click" event handler (#4791) Feb 10, 2017
progress-events Consolidate redundant ProgressEvent constructor tests (#4616) Jan 24, 2017
proximity followup. Fix web platform tests that either depended on the old spec… Jan 3, 2017
quirks-mode Test lack of support for list item bullet size quirk (#3192) Jun 20, 2016
referrer-policy Trivial exportable change in wpt. Feb 17, 2017
remote-playback Remote Playback API: move tests that can be moved to WPT. Feb 9, 2017
resource-timing review some initial tests for resource timing (#4266) Dec 6, 2016
resources @ be66db3 Update to latest resources Feb 10, 2017
screen-orientation Add OWNERS files generated from commit log. Feb 2, 2016
secure-contexts Implement isSecureContext for worker scopes. Nov 2, 2016
selection selection: Align collapse-NN.html and extend-NN.html to the latest dr… Feb 17, 2017
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 Add LayoutTests to test Blob URL transfer to {Shared,Service}Workers Feb 16, 2017
shadow-dom [shadow-dom] Specify unique names for tests (#4773) Feb 10, 2017
storage Start a test suite for Storage Feb 16, 2017
streams WritableStream: Add tests for re-entrant calls inside strategySize (#… Feb 17, 2017
subresource-integrity Fix testharness.js path in subresources-integrity tests, Jun 9, 2016
svg-aam Placeholder for svg-aam tests Jan 31, 2017
svg fixup! Test SVGUnitTypes changes (no longer a mixin) Nov 24, 2016
tools @ f484942 Update tools. Feb 17, 2017
touch-events Expand on the Touch constructor tests (#3748) Sep 29, 2016
typedarrays Adjust webplatform ArrayBuffer test . Jan 3, 2017
uievents Remove manual flag from non-manual test Jan 3, 2017
upgrade-insecure-requests Basic tests for Upgrade-Insecure-Requests. (#4292) Dec 8, 2016
url URL: improve coverage of conditions in the standard Feb 16, 2017
user-timing Clean up user-timing tests. (#4646) Jan 28, 2017
vibration Remove more testharness.css links (#2217) Mar 31, 2016
wai-aria Initial add of wai-aria folder. (#3474) Aug 19, 2016
web-animations Upstream animation-effect-timing-defaults.html from Blink (#3338) Feb 17, 2017
webaudio AudioBuffer ctor updated, Jan 31, 2017
webauthn removing stray debug statement Oct 31, 2016
webdriver Fix calls to session.find; Feb 15, 2017
webgl Replaced references to mxr.mozilla.org in the codebase with dxr.mozil… Aug 25, 2016
webmessaging Test that various MessageEvents are trusted Feb 8, 2017
webrtc booleans never turn negative. Jan 3, 2017
websockets Consolidate tests for invalid arguments to WebSocket::close(). Feb 9, 2017
webstorage Remove incorrect optimization in LevelDBWrapperImpl::DeleteAll(). Feb 16, 2017
webvr Rename vr/idlharness.html to webvr/idlharness.html Jan 11, 2017
webvtt Fix bogus expectations in webvtt test media_404_omit_subtitles.html Feb 16, 2017
workers Add LayoutTests to test Blob URL transfer to {Shared,Service}Workers Feb 16, 2017
.gitignore Update generated tests; add shell script to avoid people working out … Jan 5, 2017
.gitmodules Ignore dirty tools submodule in git status Nov 16, 2015
.travis.yml add travis webhook (#4651) Feb 6, 2017
CONTRIBUTING.md Further modifications to the CLA text. Aug 8, 2013
LICENSE.md Update with the license text Dec 7, 2016
README.md Standardise on web-platform-tests in README (#4796) Feb 10, 2017
check_stability.py Wrap all test results in a <details> in stability checker (#4820) Feb 14, 2017
ci_built_diff.sh Update generated tests; add shell script to avoid people working out … Jan 5, 2017
ci_lint.sh Add a travis job for testing PR stability Oct 20, 2016
ci_stability.sh Truncate data written to logs in C.I. environment (#4697) Feb 9, 2017
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 Add W3C-TEST.ORG:.travis.yml to lint allow list Feb 3, 2017
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
test_keys_wdspec.html Merge branch 'master' into sync_652e9980354b74fdba69bd1d013048305290e051 Jan 31, 2017
testharness_runner.html Add testharness_runner file here for now. Apr 17, 2015
update-built-tests.sh Update generated tests; add shell script to avoid people working out … Jan 5, 2017

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.

On Windows, be sure to add the Python directory (c:\python2x, by default) to your %Path% Environment Variable, and 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

If you are behind a proxy, you also need to make sure the domains above are excluded from your proxy lookups.

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, i.e.:

Run the installer for Win32_OpenSSL_v1.1.0b (30MB). During installation, change the default location for where to Copy OpenSSL Dlls from the System directory to the /bin directory.

After installation, ensure that the path to OpenSSL (typically, this will be C:\OpenSSL-Win32\bin) is in your %Path% Environment Variable. If you forget to do this part, you will most likely see a 'File Not Found' error when you start wptserve.

Finally, set the path value in the server configuration file to the default OpenSSL configuration file location. 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 (typically this will be C:\\OpenSSL-Win32\\bin\\openssl.cfg).

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 are automatically mirrored to http://w3c-test.org/submissions/ a few minutes after someone with merge access has added a comment with "LGTM" (or "w3c-test:mirror") to indicate the PR has been checked.

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 public-test-infra@w3.org 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