tree: a8434d22d4f45f667d97212d814b1167f9241df8 [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-shadowrealm.window-expected.txt
  20. idlharness-shadowrealm.window.html
  21. idlharness-shadowrealm.window.js
  22. idlharness.any-expected.txt
  23. idlharness.any.html
  24. idlharness.any.js
  25. idlharness.any.worker-expected.txt
  26. idlharness.any.worker.html
  27. META.yml
  28. percent-encoding.window-expected.txt
  29. percent-encoding.window.html
  30. percent-encoding.window.js
  31. README.md
  32. toascii.window-expected.txt
  33. toascii.window.html
  34. toascii.window.js
  35. url-constructor.any-expected.txt
  36. url-constructor.any.html
  37. url-constructor.any.js
  38. url-constructor.any.worker-expected.txt
  39. url-constructor.any.worker.html
  40. url-origin.any-expected.txt
  41. url-origin.any.html
  42. url-origin.any.js
  43. url-origin.any.worker-expected.txt
  44. url-origin.any.worker.html
  45. url-searchparams.any-expected.txt
  46. url-searchparams.any.html
  47. url-searchparams.any.js
  48. url-searchparams.any.worker-expected.txt
  49. url-searchparams.any.worker.html
  50. url-setters-a-area.window-expected.txt
  51. url-setters-a-area.window.html
  52. url-setters-a-area.window.js
  53. url-setters-stripping.any-expected.txt
  54. url-setters-stripping.any.html
  55. url-setters-stripping.any.js
  56. url-setters-stripping.any.worker-expected.txt
  57. url-setters-stripping.any.worker.html
  58. url-setters.any-expected.txt
  59. url-setters.any.html
  60. url-setters.any.js
  61. url-setters.any.worker-expected.txt
  62. url-setters.any.worker.html
  63. url-tojson.any-expected.txt
  64. url-tojson.any.html
  65. url-tojson.any.js
  66. url-tojson.any.worker-expected.txt
  67. url-tojson.any.worker.html
  68. urlencoded-parser.any-expected.txt
  69. urlencoded-parser.any.html
  70. urlencoded-parser.any.js
  71. urlencoded-parser.any.worker-expected.txt
  72. urlencoded-parser.any.worker.html
  73. urlsearchparams-append.any-expected.txt
  74. urlsearchparams-append.any.html
  75. urlsearchparams-append.any.js
  76. urlsearchparams-append.any.worker-expected.txt
  77. urlsearchparams-append.any.worker.html
  78. urlsearchparams-constructor.any-expected.txt
  79. urlsearchparams-constructor.any.html
  80. urlsearchparams-constructor.any.js
  81. urlsearchparams-constructor.any.worker-expected.txt
  82. urlsearchparams-constructor.any.worker.html
  83. urlsearchparams-delete.any-expected.txt
  84. urlsearchparams-delete.any.html
  85. urlsearchparams-delete.any.js
  86. urlsearchparams-delete.any.worker-expected.txt
  87. urlsearchparams-delete.any.worker.html
  88. urlsearchparams-foreach.any-expected.txt
  89. urlsearchparams-foreach.any.html
  90. urlsearchparams-foreach.any.js
  91. urlsearchparams-foreach.any.worker-expected.txt
  92. urlsearchparams-foreach.any.worker.html
  93. urlsearchparams-get.any-expected.txt
  94. urlsearchparams-get.any.html
  95. urlsearchparams-get.any.js
  96. urlsearchparams-get.any.worker-expected.txt
  97. urlsearchparams-get.any.worker.html
  98. urlsearchparams-getall.any-expected.txt
  99. urlsearchparams-getall.any.html
  100. urlsearchparams-getall.any.js
  101. urlsearchparams-getall.any.worker-expected.txt
  102. urlsearchparams-getall.any.worker.html
  103. urlsearchparams-has.any-expected.txt
  104. urlsearchparams-has.any.html
  105. urlsearchparams-has.any.js
  106. urlsearchparams-has.any.worker-expected.txt
  107. urlsearchparams-has.any.worker.html
  108. urlsearchparams-set.any-expected.txt
  109. urlsearchparams-set.any.html
  110. urlsearchparams-set.any.js
  111. urlsearchparams-set.any.worker-expected.txt
  112. urlsearchparams-set.any.worker.html
  113. urlsearchparams-sort.any-expected.txt
  114. urlsearchparams-sort.any.html
  115. urlsearchparams-sort.any.js
  116. urlsearchparams-sort.any.worker-expected.txt
  117. urlsearchparams-sort.any.worker.html
  118. urlsearchparams-stringifier.any-expected.txt
  119. urlsearchparams-stringifier.any.html
  120. urlsearchparams-stringifier.any.js
  121. urlsearchparams-stringifier.any.worker-expected.txt
  122. urlsearchparams-stringifier.any.worker.html
  123. 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.