Bug 1218291 - Extension manifest version is not returned when installed from marketplace or WebIDE r=ferjm

This commit is contained in:
Fabrice Desré 2015-10-27 08:10:43 -07:00
parent 26526f36fa
commit 329f1ab1f0
4 changed files with 11 additions and 0 deletions

View File

@ -130,6 +130,7 @@ function _setAppProperties(aObj, aApp) {
aObj.kind = aApp.kind;
aObj.enabled = aApp.enabled !== undefined ? aApp.enabled : true;
aObj.sideloaded = aApp.sideloaded;
aObj.extensionVersion = aApp.extensionVersion;
#ifdef MOZ_B2GDROID
aObj.android_packagename = aApp.android_packagename;
aObj.android_classname = aApp.android_classname;

View File

@ -138,6 +138,10 @@ this.UserCustomizations = {
result.icons = aManifest.icons;
}
if (aManifest.version) {
result.version = aManifest.version;
}
// chrome extension manifests have a single 'author' property, that we
// map to 'developer.name'.
// Note that it has to match the one in the mini-manifest.

View File

@ -3812,6 +3812,10 @@ this.DOMApplicationRegistry = {
throw "INVALID_MANIFEST";
}
newManifest = UserCustomizations.convertManifest(newManifest);
// Keep track of the add-on version, to use for blocklisting.
if (newManifest.version) {
aNewApp.extensionVersion = newManifest.version;
}
}
if (!AppsUtils.checkManifest(newManifest, aOldApp)) {

View File

@ -79,10 +79,12 @@ function installApp(manifestURL, expectedError) {
apps.push(req.result);
is(req.result.manifestURL, manifestURL, "app installed");
if (req.result.installState == "installed") {
is(req.result.manifest.version, "1.0", "correct version");
is(req.result.installState, "installed", "app downloaded");
continueTest();
} else {
req.result.ondownloadapplied = function() {
is(req.result.manifest.version, "1.0", "correct version");
is(req.result.installState, "installed", "app downloaded");
continueTest();
}