Use valid and spec-compliant MP4 file for all tests. r=gerald,jgraham (#3903) * Test for writable effect. MozReview-Commit-ID: 2hMY2barRb9 Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1049975 * Respect type-in state when caching inline styles; MozReview-Commit-ID: OZCUbNUvmz Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1250805 * Pointer Event] Refine setPointerCapture / releasePointerCapture to follow the algorithm defined in the spec. f=bevistseng, Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1294335 * The error event in a worker (firing at the worker's global) should have the original exception value in its .error property. Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=986459 * Do not write <parsererror> nodes for invalid XML documents in XMLHttpRequests made by web content. r=billm, Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=289714 * Add reftests. r=dholbert,heycam MANIFEST.json is revised automatically by --manifest-update. MozReview-Commit-ID: PZgNtDlaFk Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1245751 * Add tests for a, script, mpath, and animate elements. r=dholbert,heycam Extend the original test for <a> element in dom/svg/ and add some mochitests in svg/linking/scripted/. MozReview-Commit-ID: G7lszyUVMiU Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1245751 * Fix setting location.hash for documents with about:something URIs to actually work. Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1298977 * Support :indeterminate pseudo-class for radio groups. Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=885359 * HTMLFormElemement should have unenumerable named properties per spec. Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1270369 * Rework animation phase and fill mode handling This reflects the following updates to the spec: https://github.com/w3c/web-animations/commit/9369384f6cfa0716520595bed9d05a51197efecc MozReview-Commit-ID: JYUOZcnPEJQ Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1299695 * Pointer Event] Update web-platform-test pointerevent_element_haspointercapture-manual.html. f=bevistseng Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1298255 * Make sure the parser insertion point is defined when firing the load event for external <scripts> or firing the error event on a failed external script load (but not other cases, like bogus script URL). If we have a creator parser, then we were a parser-inserted script and should presumably be able to set a valid insertion point when we run or fire our load/error events. For the error event case, we do this in nsScriptElement::ScriptAvailable, so that async error events due to things like bogus script URLs do not end up with a valid insertion point. For the load event case, we just do this in ScriptEvaluated directly. ScriptEvaluated is called while the scriptloader has our script set as the current parser-inserted script. But for the error event case we need to maintain that state around the ScriptAvailable call that will fire the event. Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1297125 * Remove the existing Location hardcoding in js::SetPrototype now that Location handles that itself. Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1299306 * Let the web platform test scheme-data.html pass for HEAD and POST requests. Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1063526 * Test for setting spacing. MozReview-Commit-ID: 5pMhC00vNIh Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1274944 * Throw NetworkErrors instead of failures where appropriate for some XHR web platform tests. r=bz, r=keeler, r=Mossop, Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=918751 * P5 - Adding new tests for SRI and enabling test for Request's integrity attribute in wpt. r=bkelly. Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1187335 * P6 - Support script/css to set integrity metadata to serviceWorker. r=bkelly. r=francois. Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1187335 * Use valid and spec-compliant MP4 file for all tests. r=gerald,jgraham The MP4 used in the tests was invalid: 1- It contains out of order and overlapping frames 2- The first frame for each of the first 9 media segments were marked as keyframe, even though they weren't The new file was encoded such that: - The total bitrate remains the same as in the previous files - The total duration is similar - Each media segment starts with a valid keyframe - Frames are properly ordered - GOP is made of 24 frames - The video track doesn't start at 0, which helps testing the proper behaviour regarding buffered range calculation. - Like in the previous video, the audio track is present but made of silence (which is puzzling for a video initially designed to test A/V sync) The webm file presents the same characteristics. MozReview-Commit-ID: 6AKKmInaenE Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1300296 
5 files changed
tree: 62834ca5a248349162b76b54e1b5ec549f957af3
  1. 2dcontext/
  2. ambient-light/
  3. annotation-model/
  4. annotation-protocol/
  5. app-uri/
  6. battery-status/
  7. common/
  8. compat/
  9. conformance-checkers/
  10. content-security-policy/
  11. cookies/
  12. cors/
  13. cssom-view/
  14. custom-elements/
  15. docs/
  16. dom/
  17. DOM-parsing/
  18. domparsing/
  19. domxpath/
  20. editing/
  21. encoding/
  22. encrypted-media/
  23. eventsource/
  24. ext-xhtml-pubid/
  25. fetch/
  26. FileAPI/
  27. fonts/
  28. fullscreen/
  29. gamepad/
  30. generic-sensor/
  31. geolocation-API/
  32. hr-time/
  33. html/
  34. html-imports/
  35. html-longdesc/
  36. html-media-capture/
  37. http/
  38. images/
  39. IndexedDB/
  40. infrastructure/
  41. innerText/
  42. input-events/
  43. js/
  44. media/
  45. media-source/
  46. mediacapture-record/
  47. mediacapture-streams/
  48. microdata/
  49. mixed-content/
  50. navigation-timing/
  51. notifications/
  52. old-tests/
  53. orientation-event/
  54. page-visibility/
  55. payment-request/
  56. performance-timeline/
  57. pointerevents/
  58. pointerlock/
  59. presentation-api/
  60. progress-events/
  61. proximity/
  62. quirks-mode/
  63. referrer-policy/
  64. resource-timing/
  65. screen-orientation/
  66. secure-contexts/
  67. selection/
  68. selectors/
  69. selectors-api/
  70. service-workers/
  71. shadow-dom/
  72. streams/
  73. subresource-integrity/
  74. svg/
  75. touch-events/
  76. typedarrays/
  77. uievents/
  78. url/
  79. user-timing/
  80. vibration/
  81. wai-aria/
  82. web-animations/
  83. webaudio/
  84. webauthn/
  85. WebCryptoAPI/
  86. webdriver/
  87. webgl/
  88. WebIDL/
  89. webmessaging/
  90. webrtc/
  91. websockets/
  92. webstorage/
  93. webvtt/
  94. workers/
  95. XMLHttpRequest/
  96. .gitignore
  97. .gitmodules
  98. .travis.yml
  99. config.default.json
  100. CONTRIBUTING.md
  101. diff-manifest.py
  102. LICENSE
  103. lint
  104. lint.whitelist
  105. manifest
  106. README.md
  107. serve
  108. serve.py
  109. server-side.md
  110. testharness_runner.html
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.

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.

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