mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 06:45:42 +00:00
Backed out changeset 9c05226e2248 (bug 1405174) for failing browser-chrome's toolkit/components/addoncompat/tests/browser/browser_addonShims.js and netwerk/test/browser/browser_child_resource.js. r=backout
This commit is contained in:
parent
be4fbc10e3
commit
ebd4a79eb5
@ -425,19 +425,7 @@ SubstitutingProtocolHandler::ResolveURI(nsIURI *uri, nsACString &result)
|
||||
rv = baseURI->GetSpec(result);
|
||||
} else {
|
||||
// Make sure we always resolve the path as file-relative to our target URI.
|
||||
// When the baseURI doesn't end with a /, a file-relative resolution is going
|
||||
// to pick something in the parent directory, so we resolve using an absolute
|
||||
// path derived from the full path of the baseURI in that case.
|
||||
nsAutoCString basePath;
|
||||
rv = baseURI->GetFilePath(basePath);
|
||||
if (NS_SUCCEEDED(rv) && !StringEndsWith(basePath, NS_LITERAL_CSTRING("/"))) {
|
||||
// Cf. the assertion above, path already starts with a /, so prefixing
|
||||
// with a string that doesn't end with one will leave us wit the right
|
||||
// amount of /.
|
||||
path.Insert(basePath, 0);
|
||||
} else {
|
||||
path.Insert('.', 0);
|
||||
}
|
||||
path.Insert('.', 0);
|
||||
rv = baseURI->Resolve(path, result);
|
||||
}
|
||||
|
||||
|
@ -94,15 +94,9 @@ function run_test() {
|
||||
let rootFile = Services.dirsvc.get("GreD", Ci.nsIFile);
|
||||
let rootURI = Services.io.newFileURI(rootFile);
|
||||
|
||||
let inexistentFile = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
|
||||
inexistentFile.initWithPath("/this/directory/does/not/exist");
|
||||
let inexistentURI = Services.io.newFileURI(inexistentFile);
|
||||
|
||||
resProto.setSubstitution("res-test", rootURI);
|
||||
resProto.setSubstitution("res-inexistent", inexistentURI);
|
||||
do_register_cleanup(() => {
|
||||
resProto.setSubstitution("res-test", null);
|
||||
resProto.setSubstitution("res-inexistent", null);
|
||||
});
|
||||
|
||||
let baseRoot = resProto.resolveURI(Services.io.newURI("resource:///"));
|
||||
@ -110,7 +104,6 @@ function run_test() {
|
||||
|
||||
for (var spec of specs) {
|
||||
check_safe_resolution(spec, rootURI.spec);
|
||||
check_safe_resolution(spec.replace("res-test", "res-inexistent"), inexistentURI.spec);
|
||||
check_safe_resolution(spec.replace("res-test", ""), baseRoot);
|
||||
check_safe_resolution(spec.replace("res-test", "gre"), greRoot);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user