• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1description("Canonicalization of URL schemes.");
2
3cases = [
4  ["http", "http"],
5  ["HTTP", "http"],
6  // These tests trigger the relative URL resolving behavior of
7  // HTMLAnchorElement.href.  In order to test absolute URL parsing, we'd need
8  // an API that always maps to absolute URLs.  If you know of one, please
9  // enable these tests!
10  // [" HTTP ", "%20http%20"],
11  // ["htt: ", "htt%3A%20"],
12  // ["\xe4\xbd\xa0\xe5\xa5\xbdhttp", "%E4%BD%A0%E5%A5%BDhttp"],
13  // ["ht%3Atp", "ht%3atp"],
14];
15
16for (var i = 0; i < cases.length; ++i) {
17  test_vector = cases[i][0];
18  expected_result = cases[i][1];
19  shouldBe("canonicalize('" + test_vector + "://example.com/')",
20           "'" + expected_result + "://example.com/'");
21}
22var successfullyParsed = true;
23