diff options
Diffstat (limited to 'LayoutTests/fast/url/script-tests/relative-unix.js')
-rw-r--r-- | LayoutTests/fast/url/script-tests/relative-unix.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/LayoutTests/fast/url/script-tests/relative-unix.js b/LayoutTests/fast/url/script-tests/relative-unix.js new file mode 100644 index 0000000..0002485 --- /dev/null +++ b/LayoutTests/fast/url/script-tests/relative-unix.js @@ -0,0 +1,28 @@ +description("Test resolution of relative UNIX-like URLs."); + +cases = [ + // Format: [baseURL, relativeURL, expectedURL], + // On Unix we fall back to relative behavior since there's nothing else + // reasonable to do. + ["http://host/a", "\\\\\\\\Another\\\\path", "http://another/path"], + + // Even on Windows, we don't allow relative drive specs when the base + // is not file. + ["http://host/a", "/c:\\\\foo", "http://host/c:/foo"], + ["http://host/a", "//c:\\\\foo", "http://c/foo"], +]; + +var originalBaseURL = canonicalize("."); + +for (var i = 0; i < cases.length; ++i) { + baseURL = cases[i][0]; + relativeURL = cases[i][1]; + expectedURL = cases[i][2]; + setBaseURL(baseURL); + shouldBe("canonicalize('" + relativeURL + "')", + "'" + expectedURL + "'"); +} + +setBaseURL(originalBaseURL); + +var successfullyParsed = true; |