servo/tests/wpt/web-platform-tests/url
2017-04-22 14:17:10 +02:00
..
a-element-origin-xhtml.xhtml Update web-platform-tests and CSS tests. 2017-02-06 22:38:29 +01:00
a-element-origin.html Update web-platform-tests and CSS tests. 2017-02-06 22:38:29 +01:00
a-element-origin.js Update web-platform-tests to revision 3137d1d2d7757366a69f8a449b458b5057e0e81e 2016-12-28 11:34:21 +01:00
a-element-xhtml.xhtml Update web-platform-tests and CSS tests. 2017-02-06 22:38:29 +01:00
a-element.html Update web-platform-tests and CSS tests. 2017-02-06 22:38:29 +01:00
a-element.js Update web-platform-tests to revision 3137d1d2d7757366a69f8a449b458b5057e0e81e 2016-12-28 11:34:21 +01:00
failure.html Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444 2017-04-22 14:17:10 +02:00
historical.html Remove URL.domainToASCII and URL.domainToUnicode 2016-10-25 19:05:57 -04:00
historical.worker.js Remove URL.domainToASCII and URL.domainToUnicode 2016-10-25 19:05:57 -04:00
interfaces.html Update web-platform-tests to revision 7a767a52741f628430ffbbed46e7f3df68ba3534 2017-02-20 13:52:41 +01:00
OWNERS Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444 2017-04-22 14:17:10 +02:00
README.md Update web-platform-tests to revision 7ed49cff4d031720f829c01df837ed7a09ad5c60 2016-02-24 11:04:43 +01:00
setters_tests.json Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444 2017-04-22 14:17:10 +02:00
url-constructor.html Update web-platform-tests to revision 3137d1d2d7757366a69f8a449b458b5057e0e81e 2016-12-28 11:34:21 +01:00
url-origin.html Update web-platform-tests to revision 3137d1d2d7757366a69f8a449b458b5057e0e81e 2016-12-28 11:34:21 +01:00
url-setters.html Update web-platform-tests to revision e8bfc205e36ad699601212cd50083870bad9a75d 2016-11-15 09:35:34 +01: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 and CSS tests. 2017-02-06 22:38:29 +01:00
urlsearchparams-delete.html Update web-platform-tests and CSS tests. 2017-02-06 22:38:29 +01:00
urlsearchparams-foreach.html Make URLSearchParams iterable. 2016-10-07 17:35:54 +02: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 and CSS tests. 2017-02-06 22:38:29 +01:00
urlsearchparams-stringifier.html Update web-platform-tests and CSS tests. 2017-02-06 22:38:29 +01:00
urltestdata.json Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444 2017-04-22 14:17:10 +02:00

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