Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / url / script-tests / relative-unix.js
blobbb6ed6a7bb91395633fa6313c41a3a1e880f7c48
1 description("Test resolution of relative UNIX-like URLs.");
3 cases = [
4 // Format: [baseURL, relativeURL, expectedURL],
5 // On Unix we fall back to relative behavior since there's nothing else
6 // reasonable to do.
7 ["http://host/a", "\\\\\\\\Another\\\\path", "http://another/path"],
9 // Even on Windows, we don't allow relative drive specs when the base
10 // is not file.
11 ["http://host/a", "/c:\\\\foo", "http://host/c:/foo"],
12 ["http://host/a", "//c:\\\\foo", "http://c/foo"],
15 var originalBaseURL = canonicalize(".");
17 for (var i = 0; i < cases.length; ++i) {
18 baseURL = cases[i][0];
19 relativeURL = cases[i][1];
20 expectedURL = cases[i][2];
21 setBaseURL(baseURL);
22 shouldBe("canonicalize('" + relativeURL + "')",
23 "'" + expectedURL + "'");
26 setBaseURL(originalBaseURL);