servo/tests/wpt/web-platform-tests/url
2018-06-08 22:44:24 -04:00
..
resources Update web-platform-tests to revision 132d12daea699ce266324e79eecbe59b10e56502 2018-06-08 22:44:24 -04:00
a-element-origin-xhtml.xhtml Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64 2018-05-29 23:08:06 -04:00
a-element-origin.html Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64 2018-05-29 23:08:06 -04:00
a-element-xhtml.xhtml Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64 2018-05-29 23:08:06 -04:00
a-element.html Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64 2018-05-29 23:08:06 -04:00
data-uri-fragment.html Update web-platform-tests to revision 44702f2bc8ea98bc32b5b244f2fe63c6ce66d49d 2017-11-15 12:47:30 -05:00
failure.html Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64 2018-05-29 23:08:06 -04:00
historical.any.js Update web-platform-tests to revision a46616a5b18e83587ddbbed756c7b96cbb4b015d 2017-10-05 00:42:13 +02:00
interfaces.any.js Update web-platform-tests to revision 9817f7f027fe1e92cc2fce31d6002c4d669918e8 2018-03-09 08:47:07 -05:00
OWNERS Update web-platform-tests to revision 44702f2bc8ea98bc32b5b244f2fe63c6ce66d49d 2017-11-15 12:47:30 -05:00
README.md Update web-platform-tests to revision ee82278e15570e573d87fb80179ff8231b6db61a 2018-06-03 22:45:23 -04:00
toascii.window.js Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64 2018-05-29 23:08:06 -04:00
url-constructor.html Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64 2018-05-29 23:08:06 -04:00
url-origin.html Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64 2018-05-29 23:08:06 -04:00
url-setters.html Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64 2018-05-29 23:08:06 -04:00
url-tojson.html Update web-platform-tests to revision 7a767a52741f628430ffbbed46e7f3df68ba3534 2017-02-20 13:52:41 +01:00
urlencoded-parser.html Update web-platform-tests and CSS tests. 2017-02-06 22:38:29 +01:00
urlsearchparams-append.html Update web-platform-tests and CSS tests. 2017-02-06 22:38:29 +01:00
urlsearchparams-constructor.html Update web-platform-tests to revision 8a2ceb5f18911302b7a5c1cd2791f4ab50ad4326 2017-10-12 12:36:21 -04:00
urlsearchparams-delete.html Update web-platform-tests to revision 8a2ceb5f18911302b7a5c1cd2791f4ab50ad4326 2017-10-12 12:36:21 -04:00
urlsearchparams-foreach.html Update web-platform-tests to revision 81962ac8802223d038b188b6f9cb88a0a9c5beee 2018-05-18 23:55:46 -04:00
urlsearchparams-get.html Update web-platform-tests and CSS tests. 2017-02-06 22:38:29 +01:00
urlsearchparams-getall.html Update web-platform-tests and CSS tests. 2017-02-06 22:38:29 +01:00
urlsearchparams-has.html Update web-platform-tests and CSS tests. 2017-02-06 22:38:29 +01:00
urlsearchparams-set.html Update web-platform-tests and CSS tests. 2017-02-06 22:38:29 +01:00
urlsearchparams-sort.html Update web-platform-tests to revision 8a2ceb5f18911302b7a5c1cd2791f4ab50ad4326 2017-10-12 12:36:21 -04:00
urlsearchparams-stringifier.html Update web-platform-tests to revision 44702f2bc8ea98bc32b5b244f2fe63c6ce66d49d 2017-11-15 12:47:30 -05:00

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.