Bug 927108 - Fix certified app actor installation r=paul

This commit is contained in:
Alexandre Poirot 2013-10-19 21:03:30 +02:00
parent c3f151ba9c
commit 3ff98d25f0
4 changed files with 22 additions and 7 deletions

View File

@ -14,7 +14,9 @@ MOCHITEST_DATA_FILES = \
data/app-redirect.zip \
data/app-updated.zip \
data/app.zip \
data/app-certified.zip \
$(NULL)
MOCHITEST_DATA_DEST = $(MOCHITEST_DEST)/data
INSTALL_TARGETS += MOCHITEST_DATA
endif

Binary file not shown.

View File

@ -154,6 +154,26 @@ var steps = [
}
);
},
function() {
ok(true, "== TEST == Install certified app");
let appId = "test-certified-id";
let url = SimpleTest.getTestFileURL("data/app-certified.zip");
installTestApp(url, appId,
function (aResponse, aApp) {
ok(true, "Installed");
is(aResponse.appId, appId, "Got same app id");
if ("error" in aResponse) {
ok(false, "Error: " + aResponse.error);
}
if ("message" in aResponse) {
ok(false, "Error message: " + aResponse.message);
}
ok(!("error" in aResponse), "app installed without any error");
is(aApp.manifest.name, "Certified app", "app name is correct");
next();
}
);
},
function() {
ok(true, "all done!\n");
mm.sendAsyncMessage("cleanup");

View File

@ -389,13 +389,6 @@ WebappsActor.prototype = {
let appType = self._getAppType(manifest.type);
// In production builds, don't allow installation of certified apps.
if (!DOMApplicationRegistry.allowSideloadingCertified &&
appType == Ci.nsIPrincipal.APP_STATUS_CERTIFIED) {
self._sendError(deferred, "Installing certified apps is not allowed.", aId);
return;
}
// Privileged and certified packaged apps can setup a custom origin
// via `origin` manifest property
let id = aId;