Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / url / script-tests / port.js
blob55658e655e97e93931b26a57f5d9311e6d00602a
1 description("Test URLs that have a port number.");
3 cases = [
4 // Invalid input should be copied w/ failure.
5 ["as df", ":as%20df"],
6 ["-2", ":-2"],
7 // Default port should be omitted.
8 ["80", ""],
9 ["8080", ":8080"],
10 // Empty ports (just a colon) should also be removed
11 ["", ""],
12 // Code point with a numeric value U+1369 ETHIOPIC DIGIT ONE
13 ["\u1369", ":%E1%8D%A9"],
14 // Code point with a numerical mapping and value U+1D7D6 MATHEMATICAL BOLD DIGIT EIGHT
15 ["\uD835\uDFD6", ":%F0%9D%9F%96"],
18 for (var i = 0; i < cases.length; ++i) {
19 shouldBe("canonicalize('http://www.example.com:" + cases[i][0] + "/')",
20 "'http://www.example.com" + cases[i][1] + "/'");
23 // Unspecified port should mean always keep the port.
24 shouldBe("canonicalize('foobar://www.example.com:80/')",
25 "'foobar://www.example.com:80/'");