Find file History
Latest commit e32ff14 Feb 22, 2017 @watilde watilde committed with jgraham Add blob URLs into urltestdata.json
Related link:
+ nodejs/node#11426
Permalink
..
Failed to load latest commit information.
OWNERS Help out with Fetch, URL, and XMLHttpRequest test review Feb 21, 2017
README.md Remove origin tests for `file:` URLs. Feb 17, 2016
a-element-origin-xhtml.xhtml More tests for file URL Window drive letter quirk Jan 11, 2017
a-element-origin.html More tests for file URL Window drive letter quirk Jan 11, 2017
a-element-origin.js Move URL origin tests to new file Nov 18, 2016
a-element-xhtml.xhtml More tests for file URL Window drive letter quirk Jan 11, 2017
a-element.html More tests for file URL Window drive letter quirk Jan 11, 2017
a-element.js Move URL origin tests to new file Nov 18, 2016
failure.html URL: parser failure consistency Feb 23, 2017
historical.html Remove URL.domainToASCII and URL.domainToUnicode Oct 31, 2016
historical.worker.js Remove URL.domainToASCII and URL.domainToUnicode Oct 31, 2016
interfaces.html Basic URL toJSON() test Feb 8, 2017
setters_tests.json URL: test setters with javascript URLs Feb 22, 2017
url-constructor.html Move URL origin tests to new file Nov 18, 2016
url-origin.html Move URL origin tests to new file Nov 18, 2016
url-setters.html Test URL setters on <a> and <area> too Oct 20, 2016
url-tojson.html Basic URL toJSON() test Feb 8, 2017
urlencoded-parser.html application/x-www-form-urlencoded parser tests Jan 17, 2017
urlsearchparams-append.html Remove more testharness-extras.js references Jan 12, 2017
urlsearchparams-constructor.html Fix URLSearchParams constructor test Feb 2, 2017
urlsearchparams-delete.html Remove more testharness-extras.js references Jan 12, 2017
urlsearchparams-foreach.html Make URLSearchParams iterable. Oct 31, 2016
urlsearchparams-get.html Remove more testharness-extras.js references Jan 12, 2017
urlsearchparams-getall.html Remove more testharness-extras.js references Jan 12, 2017
urlsearchparams-has.html Remove more testharness-extras.js references Jan 12, 2017
urlsearchparams-set.html Remove more testharness-extras.js references Jan 12, 2017
urlsearchparams-sort.html Make sure stable sort is used for URLSearchParams's sort() Jan 19, 2017
urlsearchparams-stringifier.html Remove more testharness-extras.js references Jan 12, 2017
urltestdata.json Add blob URLs into urltestdata.json Feb 23, 2017

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 URL’s API should return the corresponding value.

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