tree: 579caff821466353aea43867330263bee317701b [path history] [tgz]
  1. META.yml
  2. OWNERS
  3. README.md
  4. a-element-origin-xhtml.xhtml
  5. a-element-origin.html
  6. a-element-xhtml.xhtml
  7. a-element.html
  8. data-uri-fragment.html
  9. failure.html
  10. historical.any-expected.txt
  11. historical.any.js
  12. historical.any.worker-expected.txt
  13. idlharness.any.js
  14. resources/
  15. toascii.window-expected.txt
  16. toascii.window.js
  17. url-constructor.html
  18. url-origin.html
  19. url-searchparams.any.js
  20. url-setters.html
  21. url-tojson-expected.txt
  22. url-tojson.any.js
  23. urlencoded-parser-expected.txt
  24. urlencoded-parser.any-expected.txt
  25. urlencoded-parser.any.js
  26. urlencoded-parser.any.worker-expected.txt
  27. urlsearchparams-append.any.js
  28. urlsearchparams-constructor.any.js
  29. urlsearchparams-delete.any.js
  30. urlsearchparams-foreach.any.js
  31. urlsearchparams-get.any.js
  32. urlsearchparams-getall.any.js
  33. urlsearchparams-has.any.js
  34. urlsearchparams-set.any.js
  35. urlsearchparams-sort.any.js
  36. urlsearchparams-stringifier.any.js
third_party/blink/web_tests/external/wpt/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.