Mypal/testing/web-platform/tests/url
Fedor 277045c132 ooops, some files where missed 2019-03-12 18:31:25 +03:00
..
OWNERS ooops, some files where missed 2019-03-12 18:31:25 +03:00
README.md basic source 2019-03-11 13:26:37 +03:00
a-element-xhtml.xhtml basic source 2019-03-11 13:26:37 +03:00
a-element.html basic source 2019-03-11 13:26:37 +03:00
a-element.js basic source 2019-03-11 13:26:37 +03:00
historical.html basic source 2019-03-11 13:26:37 +03:00
historical.worker.js basic source 2019-03-11 13:26:37 +03:00
interfaces.html basic source 2019-03-11 13:26:37 +03:00
setters_tests.json basic source 2019-03-11 13:26:37 +03:00
url-constructor.html basic source 2019-03-11 13:26:37 +03:00
url-domainToUnicode.html basic source 2019-03-11 13:26:37 +03:00
url-setters.html basic source 2019-03-11 13:26:37 +03:00
urlsearchparams-append.html basic source 2019-03-11 13:26:37 +03:00
urlsearchparams-constructor.html basic source 2019-03-11 13:26:37 +03:00
urlsearchparams-delete.html basic source 2019-03-11 13:26:37 +03:00
urlsearchparams-get.html basic source 2019-03-11 13:26:37 +03:00
urlsearchparams-getall.html basic source 2019-03-11 13:26:37 +03:00
urlsearchparams-has.html basic source 2019-03-11 13:26:37 +03:00
urlsearchparams-set.html basic source 2019-03-11 13:26:37 +03:00
urlsearchparams-stringifier.html basic source 2019-03-11 13:26:37 +03:00
urltestdata.json basic source 2019-03-11 13:26:37 +03:00

README.md

These tests are for browsers, but the data for a-element.html, url-constructor.html, and a-element-xhtml.xhtml is in 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 should 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.

annevk/url hosts some other files that might be of interest if you want to create additional tests.

Similar to a-element.html it would be trivial to add more tests for other objects that expose links (e.g. URL and <area>). There's also room for enhancement and bits that require independent tests:

  • The encoding part of the URL parser
  • The state override part of the URL parser (setting individual properties of a URL)
  • Origin serialization
  • application/x-www-form-urlencoded