Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

"use strict";
function makeURL(spec) {
return Services.io.newURI(spec).QueryInterface(Ci.nsIURL);
}
// Checks that nsIURL::GetRelativeSpec does what it claims to do.
function run_test() {
// Elements of tests have the form [this.spec, aURIToCompare.spec, expectedResult].
let tests = [
[
],
[
],
];
for (var i = 0; i < tests.length; i++) {
let url1 = makeURL(tests[i][0]);
let url2 = makeURL(tests[i][1]);
let expected = tests[i][2];
Assert.equal(expected, url1.getRelativeSpec(url2));
}
}