Bug 1139697 - Fix add-ons manager warnings during app update tests. r=spohl

This commit is contained in:
Robert Strong 2015-03-04 22:54:31 -08:00
parent 098efbc58a
commit c6d5e3d98e
2 changed files with 19 additions and 14 deletions

View File

@ -220,26 +220,26 @@ function parseQueryString(aQueryString) {
*/
function getUpdateRDF(aParams) {
let addonVersion;
let maxVersion;
let addonID = aParams.addonID;
let addonUpdateType = addonID.split("_")[0];
let maxVersion = aParams.platformVersion;
switch (addonUpdateType) {
case "updatecompatibility":
// Use "1.0" for the add-on version for the compatibility update case since
// the tests create all add-ons with "1.0" for the version.
addonVersion = "1.0";
maxVersion = aParams.newerPlatformVersion;
break;
case "updateversion":
// Use "2.0" for the add-on version for the version update case since the
// tests create all add-ons with "1.0" for the version.
addonVersion = "2.0";
maxVersion = aParams.newerPlatformVersion;
break;
default:
return "<?xml version=\"1.0\"?>\n" +
"<RDF:RDF xmlns:RDF=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" " +
" xmlns:em=\"http://www.mozilla.org/2004/em-rdf#\">\n" +
"</RDF:RDF>\n";
addonVersion = "1.0";
maxVersion = aParams.platformVersion;
}
return "<?xml version=\"1.0\"?>\n" +

View File

@ -925,7 +925,8 @@ function setupPrefs() {
gExtUpdateURL = Services.prefs.getCharPref(PREF_EXTENSIONS_UPDATE_URL);
}
let extUpdateUrl = URL_HTTP_UPDATE_XML + "?addonID=%ITEM_ID%" +
"&platformVersion=" + getNewerPlatformVersion();
"&platformVersion=" + Services.appinfo.platformVersion +
"&newerPlatformVersion=" + getNewerPlatformVersion();
Services.prefs.setCharPref(PREF_EXTENSIONS_UPDATE_URL, extUpdateUrl);
Services.prefs.setIntPref(PREF_APP_UPDATE_IDLETIME, 0);
@ -1124,17 +1125,21 @@ function setupAddons(aCallback) {
function setNoUpdateAddonsDisabledState() {
AddonManager.getAllAddons(function(aAddons) {
aAddons.forEach(function(aAddon) {
if (aAddon.name.indexOf("noupdate") != 0) {
return;
}
if (gDisableNoUpdateAddon) {
if (aAddon.name.indexOf("appdisabled") == 0) {
if (!aAddon.userDisabled) {
aAddon.userDisabled = true;
}
} else {
if (aAddon.userDisabled) {
aAddon.userDisabled = false;
}
if (aAddon.name.indexOf("noupdate") == 0) {
if (gDisableNoUpdateAddon) {
if (!aAddon.userDisabled) {
aAddon.userDisabled = true;
}
} else {
if (aAddon.userDisabled) {
aAddon.userDisabled = false;
}
}
}
});