Part 2: Replace inapplicable tests with a web-platform-test for reloading after setting javascript: URI, and fix other tests relying on javascript: URI.

Some notes about the changes:

Both test_bug384014.html and test_bug123696.html were testing reloading of
javascript: URI. The expected result of the iframes after reloading would
become about:blank. I deleted both file and instead wrote with
web-platform-test to cover reloading of javascript: URI since wpt is more
preferable.

storage-cache-error.html was utilizing javascript: URI to test bug 1262766.
javascript: URI would cause CacheStorage::Keys to throw a dom security
exception because the URI's principal (which did not match the principal of the
document in this case!) was a nullpricipal.  With my patches the iframe's URL
would no longer be the javascript: URI, so it's no longer applicable for the
test case. Instead we can test what bug 1262766 was originally about - that
CacheStorage::Keys would throw a dom security exception if it's in a private
browsing window.

Differential Revision: https://phabricator.services.mozilla.com/D59465

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=836567
gecko-commit: 68447a9ccb6afbde6bf3817c72bae89a5f7d242d
gecko-integration-branch: autoland
gecko-reviewers: Gijs, miker
1 file changed
tree: 3923ccdba6d7fe2a6b0be576f585ec03bc334ee4
  1. .github/
  2. .well-known/
  3. 2dcontext/
  4. accelerometer/
  5. accname/
  6. acid/
  7. ambient-light/
  8. animation-worklet/
  9. annotation-model/
  10. annotation-protocol/
  11. annotation-vocab/
  12. apng/
  13. appmanifest/
  14. audio-output/
  15. background-fetch/
  16. BackgroundSync/
  17. battery-status/
  18. beacon/
  19. bluetooth/
  20. clear-site-data/
  21. client-hints/
  22. clipboard-apis/
  23. common/
  24. compat/
  25. compression/
  26. conformance-checkers/
  27. console/
  28. contacts/
  29. content-dpr/
  30. content-security-policy/
  31. cookie-store/
  32. cookies/
  33. core-aam/
  34. cors/
  35. credential-management/
  36. css/
  37. custom-elements/
  38. device-memory/
  39. docs/
  40. document-policy/
  41. dom/
  42. domparsing/
  43. domxpath/
  44. dpub-aam/
  45. dpub-aria/
  46. editing/
  47. element-timing/
  48. encoding/
  49. encoding-detection/
  50. encrypted-media/
  51. entries-api/
  52. event-timing/
  53. eventsource/
  54. feature-policy/
  55. fetch/
  56. FileAPI/
  57. fonts/
  58. forced-colors-mode/
  59. fullscreen/
  60. gamepad/
  61. generic-sensor/
  62. geolocation-API/
  63. geolocation-sensor/
  64. graphics-aam/
  65. gyroscope/
  66. hr-time/
  67. html/
  68. html-longdesc/
  69. html-media-capture/
  70. idle-detection/
  71. imagebitmap-renderingcontext/
  72. images/
  73. import-maps/
  74. IndexedDB/
  75. inert/
  76. infrastructure/
  77. input-device-capabilities/
  78. input-events/
  79. installedapp/
  80. interfaces/
  81. intersection-observer/
  82. js/
  83. keyboard-lock/
  84. keyboard-map/
  85. kv-storage/
  86. largest-contentful-paint/
  87. layout-instability/
  88. lifecycle/
  89. loading/
  90. longtask-timing/
  91. magnetometer/
  92. mathml/
  93. measure-memory/
  94. media/
  95. media-capabilities/
  96. media-playback-quality/
  97. media-source/
  98. mediacapture-depth/
  99. mediacapture-fromelement/
  100. mediacapture-image/
  101. mediacapture-record/
  102. mediacapture-streams/
  103. mediasession/
  104. mimesniff/
  105. mixed-content/
  106. mst-content-hint/
  107. native-file-system/
  108. navigation-timing/
  109. netinfo/
  110. network-error-logging/
  111. notifications/
  112. offscreen-canvas/
  113. old-tests/
  114. orientation-event/
  115. orientation-sensor/
  116. origin-policy/
  117. page-visibility/
  118. paint-timing/
  119. payment-handler/
  120. payment-method-basic-card/
  121. payment-method-id/
  122. payment-request/
  123. performance-timeline/
  124. PeriodicBackgroundSync/
  125. permissions/
  126. picture-in-picture/
  127. pointerevents/
  128. pointerlock/
  129. portals/
  130. preload/
  131. presentation-api/
  132. printing/
  133. priority-hints/
  134. proximity/
  135. push-api/
  136. quirks/
  137. referrer-policy/
  138. remote-playback/
  139. reporting/
  140. requestidlecallback/
  141. resize-observer/
  142. resource-timing/
  143. resources/
  144. screen-capture/
  145. screen-orientation/
  146. screen_enumeration/
  147. scroll-animations/
  148. scroll-to-text-fragment/
  149. secure-contexts/
  150. selection/
  151. serial/
  152. server-timing/
  153. service-workers/
  154. shadow-dom/
  155. shape-detection/
  156. signed-exchange/
  157. sms/
  158. speech-api/
  159. std-toast/
  160. storage/
  161. storage-access-api/
  162. streams/
  163. subresource-integrity/
  164. svg/
  165. svg-aam/
  166. timing-entrytypes-registry/
  167. tools/
  168. touch-events/
  169. trusted-types/
  170. uievents/
  171. upgrade-insecure-requests/
  172. url/
  173. user-timing/
  174. vibration/
  175. visual-viewport/
  176. wai-aria/
  177. wake-lock/
  178. wasm/
  179. web-animations/
  180. web-bundle/
  181. web-locks/
  182. web-nfc/
  183. web-share/
  184. webaudio/
  185. webauthn/
  186. WebCryptoAPI/
  187. webdriver/
  188. webgl/
  189. webgpu/
  190. WebIDL/
  191. webmessaging/
  192. webmidi/
  193. webrtc/
  194. webrtc-extensions/
  195. webrtc-identity/
  196. webrtc-quic/
  197. webrtc-stats/
  198. webrtc-svc/
  199. websockets/
  200. webstorage/
  201. webusb/
  202. webvr/
  203. webvtt/
  204. webxr/
  205. workers/
  206. worklets/
  207. x-frame-options/
  208. xhr/
  209. xslt/
  210. .azure-pipelines.yml
  211. .codecov.yml
  212. .gitattributes
  213. .gitignore
  214. .mailmap
  215. .pyup.yml
  216. .taskcluster.yml
  217. CODEOWNERS
  218. CONTRIBUTING.md
  219. LICENSE.md
  220. lint.whitelist
  221. README.md
  222. testharness_runner.html
  223. update-built-tests.sh
  224. wpt
  225. wpt.py
README.md

The web-platform-tests Project

Taskcluster CI Status

The web-platform-tests Project is a W3C-coordinated attempt to build a cross-browser test suite for the Web-platform stack. 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.

The most important sources of information and activity are:

  • github.com/web-platform-tests/wpt: the canonical location of the project's source code revision history and the discussion forum for changes to the code
  • web-platform-tests.org: the documentation website; details how to set up the project, how to write tests, how to give and receive peer review, how to serve as an administrator, and more
  • wpt.live: a public deployment of the test suite, allowing anyone to run the tests by visiting from an Internet-enabled browser of their choice
  • wpt.fyi: an archive of test results collected from an array of web browsers on a regular basis
  • Real-time chat room: the IRC chat room named #testing on irc.w3.org; includes participants located around the world, but busiest during the European working day; all discussion is archived here
  • Mailing list: a public and low-traffic discussion list

If you'd like clarification about anything, don't hesitate to ask in the chat room or on the mailing list.

Setting Up the Repo

Clone or otherwise get https://github.com/web-platform-tests/wpt.

Note: because of the frequent creation and deletion of branches in this repo, it is recommended to “prune” stale branches when fetching updates, i.e. use git pull --prune (or git fetch -p && git merge).

Running the Tests

See the documentation website and in particular the system setup for running tests locally.

Command Line Tools

The wpt command provides a frontend to a variety of tools for working with and running web-platform-tests. Some of the most useful commands are:

  • wpt serve - For starting the wpt http server
  • wpt run - For running tests in a browser
  • wpt lint - For running the lint against all tests
  • wpt manifest - For updating or generating a MANIFEST.json test manifest
  • wpt install - For installing the latest release of a browser or webdriver server on the local machine.

Windows Notes

On Windows wpt commands must be prefixed with python or the path to the python binary (if python is not in your %PATH%).

python wpt [command]

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 wpt commands.

Please make sure git and your text editor do not automatically convert line endings, as it will cause lint errors. For git, please set git config core.autocrlf false in your working tree.

Publication

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

Pull requests are automatically mirrored except those that modify sensitive resources (such as .py). The latter require someone with merge access to comment with “LGTM” or “w3c-test:mirror” to indicate the pull request has been checked.

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 to contribute to test development. 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 ./wpt lint as described above.
  • Commit locally and push that to your repo.
  • Create a pull request based on the above.

Issues with web-platform-tests

If you spot an issue with a test and are not comfortable providing a pull request per above to fix it, please file a new issue. Thank you!