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

Specification

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