Bug 1167603 - Use string to replace nsIURI in aApps.widgetPages. r=fabrice

This commit is contained in:
Junior Hsu 2015-05-27 00:59:00 -04:00
parent 8178e86ed2
commit 8f5273f47d
3 changed files with 4 additions and 3 deletions

View File

@ -66,7 +66,8 @@ mozIApplication.prototype = {
let uri = Services.io.newURI(aPageURL, null, null);
let filepath = AppsUtils.getFilePath(uri.path);
let eliminatedUri = Services.io.newURI(uri.prePath + filepath, null, null);
let equalCriterion = aUri => aUri.equals(eliminatedUri);
let equalCriterion = aUrl => Services.io.newURI(aUrl, null, null)
.equals(eliminatedUri);
return this.widgetPages.find(equalCriterion) !== undefined;
},

View File

@ -396,7 +396,7 @@ this.DOMApplicationRegistry = {
if (aManifest.widgetPages) {
let resolve = (aPage)=>{
let filepath = AppsUtils.getFilePath(aPage);
return Services.io.newURI(aManifest.resolveURL(filepath), null, null);
return aManifest.resolveURL(filepath);
};
aDestApp.widgetPages = aManifest.widgetPages.map(resolve);
} else {

View File

@ -13,7 +13,7 @@ add_test(function test_has_widget_criterion() {
let resolve = (aPage)=>{
let filepath = AppsUtils.getFilePath(aPage);
return Services.io.newURI(baseUri.resolve(filepath), null, null);
return baseUri.resolve(filepath);
};
let widgetPages = ['/widget.html',