| <script src="../../resources/js-test-pre.js"></script> |
| <script src="resources/utilities.js"></script> |
| description("Test resolution of relative UNIX-like URLs."); |
| // Format: [baseURL, relativeURL, expectedURL], |
| // On Unix we fall back to relative behavior since there's nothing else |
| ["http://host/a", "\\\\\\\\Another\\\\path", "http://another/path"], |
| // Even on Windows, we don't allow relative drive specs when the base |
| ["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) { |
| relativeURL = cases[i][1]; |
| expectedURL = cases[i][2]; |
| shouldBe("canonicalize('" + relativeURL + "')", |
| "'" + expectedURL + "'"); |
| setBaseURL(originalBaseURL); |
| <script src="../../resources/js-test-post.js"></script> |