• Home
Name Date Size #Lines LOC

..--

resources/12-May-2024-8,7738,759

META.ymlD12-May-2024120 87

README.mdD12-May-20242.4 KiB5440

a-element-origin-xhtml.xhtmlD12-May-2024448 1614

a-element-origin.htmlD12-May-2024281 97

a-element-xhtml.xhtmlD12-May-2024441 1614

a-element.htmlD12-May-2024274 97

data-uri-fragment.htmlD12-May-20241.2 KiB3529

failure.htmlD12-May-20241.6 KiB4940

historical.any.jsD12-May-2024939 3226

idlharness.any.jsD12-May-2024290 1410

toascii.window.jsD12-May-20241.8 KiB5552

url-constructor.htmlD12-May-20241.6 KiB4540

url-origin.htmlD12-May-2024784 2521

url-searchparams.any.jsD12-May-20242.5 KiB7357

url-setters.htmlD12-May-20241.7 KiB4947

url-tojson.any.jsD12-May-2024123 54

urlencoded-parser.any.jsD12-May-20242.6 KiB6461

urlsearchparams-append.any.jsD12-May-20241.4 KiB4036

urlsearchparams-constructor.any.jsD12-May-20247.7 KiB184158

urlsearchparams-delete.any.jsD12-May-20241.8 KiB4642

urlsearchparams-foreach.any.jsD12-May-20242.3 KiB7767

urlsearchparams-get.any.jsD12-May-20241 KiB2220

urlsearchparams-getall.any.jsD12-May-20241.3 KiB2624

urlsearchparams-has.any.jsD12-May-2024998 2523

urlsearchparams-set.any.jsD12-May-2024986 2321

urlsearchparams-sort.any.jsD12-May-20241.8 KiB6360

urlsearchparams-stringifier.any.jsD12-May-20243.7 KiB124107

README.md

1## urltestdata.json
2
3These tests are for browsers, but the data for
4`a-element.html`, `url-constructor.html`, `a-element-xhtml.xhtml`, and `failure.html`
5is in `resources/urltestdata.json` and can be re-used by non-browser implementations.
6This file contains a JSON array of comments as strings and test cases as objects.
7The keys for each test case are:
8
9* `base`: an absolute URL as a string whose [parsing] without a base of its own must succeed.
10  This key is always present,
11  and may have a value like `"about:blank"` when `input` is an absolute URL.
12* `input`: an URL as a string to be [parsed][parsing] with `base` as its base URL.
13* Either:
14  * `failure` with the value `true`, indicating that parsing `input` should return failure,
15  * or `href`, `origin`, `protocol`, `username`, `password`, `host`, `hostname`, `port`,
16    `pathname`, `search`, and `hash` with string values;
17    indicating that parsing `input` should return an URL record
18    and that the getters of each corresponding attribute in that URL’s [API]
19    should return the corresponding value.
20
21    The `origin` key may be missing.
22    In that case, the API’s `origin` attribute is not tested.
23
24In addition to testing that parsing `input` against `base` gives the result, a test harness for the
25`URL` constructor (or similar APIs) should additionally test the following pattern: if `failure` is
26true, parsing `about:blank` against `input` must give failure. This tests that the logic for
27converting base URLs into strings properly fails the whole parsing algorithm if the base URL cannot
28be parsed.
29
30## setters_tests.json
31
32`resources/setters_tests.json` is self-documented.
33
34## toascii.json
35
36`resources/toascii.json` is a JSON resource containing an array where each item is an object
37consisting of an optional `comment` field and mandatory `input` and `output` fields. `input` is the
38domain to be parsed according to the rules of UTS #46 (as stipulated by the URL Standard). `output`
39gives the expected output of the parser after serialization. An `output` of `null` means parsing is
40expected to fail.
41
42## URL parser's encoding argument
43
44Tests in `/encoding` and `/html/infrastructure/urls/resolving-urls/query-encoding/` cover the
45encoding argument to the URL parser.
46
47## Specification
48
49The tests in this directory assert conformance with [the URL Standard][URL].
50
51[parsing]: https://url.spec.whatwg.org/#concept-basic-url-parser
52[API]: https://url.spec.whatwg.org/#api
53[URL]: https://url.spec.whatwg.org/
54