tree: 5541de009088ab85f7e7f0369bb470d0f8bb915b [path history] [tgz]
  1. resources/
  2. a-element-expected.txt
  3. a-element-origin-expected.txt
  4. a-element-origin-xhtml-expected.txt
  5. a-element-origin-xhtml.xhtml
  6. a-element-origin.html
  7. a-element-xhtml-expected.txt
  8. a-element-xhtml.xhtml
  9. a-element.html
  10. data-uri-fragment-expected.txt
  11. data-uri-fragment.html
  12. failure-expected.txt
  13. failure.html
  14. historical.any-expected.txt
  15. historical.any.html
  16. historical.any.js
  17. historical.any.worker-expected.txt
  18. historical.any.worker.html
  19. idlharness.any-expected.txt
  20. idlharness.any.html
  21. idlharness.any.js
  22. idlharness.any.worker-expected.txt
  23. idlharness.any.worker.html
  24. META.yml
  25. percent-encoding.window-expected.txt
  26. percent-encoding.window.html
  27. percent-encoding.window.js
  28. README.md
  29. toascii.window-expected.txt
  30. toascii.window.html
  31. toascii.window.js
  32. url-character-sets.any-expected.txt
  33. url-character-sets.any.html
  34. url-character-sets.any.js
  35. url-character-sets.any.worker-expected.txt
  36. url-character-sets.any.worker.html
  37. url-constructor-expected.txt
  38. url-constructor.any-expected.txt
  39. url-constructor.any.html
  40. url-constructor.any.js
  41. url-constructor.any.worker-expected.txt
  42. url-constructor.any.worker.html
  43. url-origin-expected.txt
  44. url-origin.any-expected.txt
  45. url-origin.any.html
  46. url-origin.any.js
  47. url-origin.any.worker-expected.txt
  48. url-origin.any.worker.html
  49. url-searchparams.any-expected.txt
  50. url-searchparams.any.html
  51. url-searchparams.any.js
  52. url-searchparams.any.worker-expected.txt
  53. url-searchparams.any.worker.html
  54. url-setters-a-area.window-expected.txt
  55. url-setters-a-area.window.html
  56. url-setters-a-area.window.js
  57. url-setters-stripping.any-expected.txt
  58. url-setters-stripping.any.html
  59. url-setters-stripping.any.js
  60. url-setters-stripping.any.worker-expected.txt
  61. url-setters-stripping.any.worker.html
  62. url-setters.any-expected.txt
  63. url-setters.any.html
  64. url-setters.any.js
  65. url-setters.any.worker-expected.txt
  66. url-setters.any.worker.html
  67. url-tojson-expected.txt
  68. url-tojson.any-expected.txt
  69. url-tojson.any.html
  70. url-tojson.any.js
  71. url-tojson.any.worker-expected.txt
  72. url-tojson.any.worker.html
  73. urlencoded-parser.any-expected.txt
  74. urlencoded-parser.any.html
  75. urlencoded-parser.any.js
  76. urlencoded-parser.any.worker-expected.txt
  77. urlencoded-parser.any.worker.html
  78. urlsearchparams-append-expected.txt
  79. urlsearchparams-append.any-expected.txt
  80. urlsearchparams-append.any.html
  81. urlsearchparams-append.any.js
  82. urlsearchparams-append.any.worker-expected.txt
  83. urlsearchparams-append.any.worker.html
  84. urlsearchparams-constructor-expected.txt
  85. urlsearchparams-constructor.any-expected.txt
  86. urlsearchparams-constructor.any.html
  87. urlsearchparams-constructor.any.js
  88. urlsearchparams-constructor.any.worker-expected.txt
  89. urlsearchparams-constructor.any.worker.html
  90. urlsearchparams-delete-expected.txt
  91. urlsearchparams-delete.any-expected.txt
  92. urlsearchparams-delete.any.html
  93. urlsearchparams-delete.any.js
  94. urlsearchparams-delete.any.worker-expected.txt
  95. urlsearchparams-delete.any.worker.html
  96. urlsearchparams-foreach-expected.txt
  97. urlsearchparams-foreach.any-expected.txt
  98. urlsearchparams-foreach.any.html
  99. urlsearchparams-foreach.any.js
  100. urlsearchparams-foreach.any.worker-expected.txt
  101. urlsearchparams-foreach.any.worker.html
  102. urlsearchparams-get-expected.txt
  103. urlsearchparams-get.any-expected.txt
  104. urlsearchparams-get.any.html
  105. urlsearchparams-get.any.js
  106. urlsearchparams-get.any.worker-expected.txt
  107. urlsearchparams-get.any.worker.html
  108. urlsearchparams-getall-expected.txt
  109. urlsearchparams-getall.any-expected.txt
  110. urlsearchparams-getall.any.html
  111. urlsearchparams-getall.any.js
  112. urlsearchparams-getall.any.worker-expected.txt
  113. urlsearchparams-getall.any.worker.html
  114. urlsearchparams-has-expected.txt
  115. urlsearchparams-has.any-expected.txt
  116. urlsearchparams-has.any.html
  117. urlsearchparams-has.any.js
  118. urlsearchparams-has.any.worker-expected.txt
  119. urlsearchparams-has.any.worker.html
  120. urlsearchparams-set-expected.txt
  121. urlsearchparams-set.any-expected.txt
  122. urlsearchparams-set.any.html
  123. urlsearchparams-set.any.js
  124. urlsearchparams-set.any.worker-expected.txt
  125. urlsearchparams-set.any.worker.html
  126. urlsearchparams-sort-expected.txt
  127. urlsearchparams-sort.any-expected.txt
  128. urlsearchparams-sort.any.html
  129. urlsearchparams-sort.any.js
  130. urlsearchparams-sort.any.worker-expected.txt
  131. urlsearchparams-sort.any.worker.html
  132. urlsearchparams-stringifier-expected.txt
  133. urlsearchparams-stringifier.any-expected.txt
  134. urlsearchparams-stringifier.any.html
  135. urlsearchparams-stringifier.any.js
  136. urlsearchparams-stringifier.any.worker-expected.txt
  137. urlsearchparams-stringifier.any.worker.html
  138. w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/url/README.md

urltestdata.json

These tests are for browsers, but the data for a-element.html, url-constructor.html, a-element-xhtml.xhtml, and failure.html is in resources/urltestdata.json and can be re-used by non-browser implementations. This file contains a JSON array of comments as strings and test cases as objects. The keys for each test case are:

  • base: an absolute URL as a string whose parsing without a base of its own must succeed. This key is always present, and may have a value like "about:blank" when input is an absolute URL.
  • input: an URL as a string to be parsed with base as its base URL.
  • Either:
    • failure with the value true, indicating that parsing input should return failure,

    • or href, origin, protocol, username, password, host, hostname, port, pathname, search, and hash with string values; indicating that parsing input should return an URL record and that the getters of each corresponding attribute in that URL’s API should return the corresponding value.

      The origin key may be missing. In that case, the API’s origin attribute is not tested.

In addition to testing that parsing input against base gives the result, a test harness for the URL constructor (or similar APIs) should additionally test the following pattern: if failure is true, parsing about:blank against input must give failure. This tests that the logic for converting base URLs into strings properly fails the whole parsing algorithm if the base URL cannot be parsed.

setters_tests.json

resources/setters_tests.json is self-documented.

toascii.json

resources/toascii.json is a JSON resource containing an array where each item is an object consisting of an optional comment field and mandatory input and output fields. input is the domain to be parsed according to the rules of UTS #46 (as stipulated by the URL Standard). output gives the expected output of the parser after serialization. An output of null means parsing is expected to fail.

URL parser's encoding argument

Tests in /encoding and /html/infrastructure/urls/resolving-urls/query-encoding/ cover the encoding argument to the URL parser.

There's also limited coverage in resources/percent-encoding.json for percent-encode after encoding with percentEncodeSet set to special-query percent-encode set and spaceAsPlus set to false. (Improvements to expand coverage here are welcome.)

Specification

The tests in this directory assert conformance with the URL Standard.