gecko-dev/testing/web-platform/tests/url
Rimas Misevičius a8cbbbe3c3 Bug 1637701 [wpt PR 23572] - URL: forbid <, >, and ^ in hosts, a=testonly
Automatic update from web-platform-tests
URL: forbid <, >, and ^ in hosts

Follows https://github.com/whatwg/url/pull/459.
--

wpt-commits: 9ffe8f26432649d02eb81add2816dd5394f57a8c
wpt-pr: 23572
2020-05-25 14:32:43 +00:00
..
resources Bug 1637701 [wpt PR 23572] - URL: forbid <, >, and ^ in hosts, a=testonly 2020-05-25 14:32:43 +00:00
a-element-origin-xhtml.xhtml
a-element-origin.html
a-element-xhtml.xhtml
a-element.html
data-uri-fragment.html
failure.html
historical.any.js
idlharness.any.js
META.yml
README.md
toascii.window.js
url-constructor.html
url-origin.html
url-searchparams.any.js
url-setters-stripping.any.js Bug 1633415 [wpt PR 23265] - URL: stripping of tab and newlines in setters, a=testonly 2020-05-04 18:11:52 +00:00
url-setters.html
url-tojson.any.js
urlencoded-parser.any.js
urlsearchparams-append.any.js
urlsearchparams-constructor.any.js Bug 1635078 [wpt PR 23382] - Add test for passing a FormData into URLSearchParams, a=testonly 2020-05-20 10:27:59 +00:00
urlsearchparams-delete.any.js
urlsearchparams-foreach.any.js
urlsearchparams-get.any.js
urlsearchparams-getall.any.js
urlsearchparams-has.any.js
urlsearchparams-set.any.js
urlsearchparams-sort.any.js
urlsearchparams-stringifier.any.js

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 URLs API should return the corresponding value.

      The origin key may be missing. In that case, the APIs 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.