Backed out 2 changesets (bug 1472286) for Browser chrome failures on toolkit/mozapps/extensions/test/browser/browser_legacy_themes.js

Backed out changeset 914241e649a0 (bug 1472286)
Backed out changeset dc9cfde75af6 (bug 1472286)
This commit is contained in:
Dorel Luca 2018-06-30 03:38:37 +03:00
parent 1b2c511d72
commit 22b6094620
2 changed files with 30 additions and 4 deletions

View File

@ -735,7 +735,7 @@ AddonWrapper.prototype = {
function _getInternalID(id) {
if (!id)
return null;
if (LightweightThemeManager._builtInThemes.has(id))
if (id == DEFAULT_THEME_ID)
return id;
let len = id.length - ID_SUFFIX.length;
if (len > 0 && id.substring(len) == ID_SUFFIX)
@ -744,7 +744,7 @@ function _getInternalID(id) {
}
function _getExternalID(id) {
if (LightweightThemeManager._builtInThemes.has(id))
if (id == DEFAULT_THEME_ID)
return id;
return id + ID_SUFFIX;
}

View File

@ -240,7 +240,13 @@ function isLegacyExtension(addon) {
legacy = true;
}
if (addon.type == "theme") {
legacy = false;
// The logic here is kind of clunky but we want to mark complete
// themes as legacy. There's no explicit flag for complete
// themes so explicitly check for new style themes (for which
// isWebExtension is true) or lightweight themes (which have
// ids that end with @personas.mozilla.org)
legacy = !(addon.isWebExtension || addon.id.endsWith("@personas.mozilla.org") ||
addon.id == "default-theme@mozilla.org");
}
if (legacy && (addon.hidden || addon.signedState == AddonManager.SIGNEDSTATE_PRIVILEGED)) {
@ -2577,7 +2583,27 @@ var gDetailView = {
let legacy = false;
if (!aAddon.install) {
legacy = isLegacyExtension(aAddon);
if (aAddon.type == "extension" && !aAddon.isWebExtension) {
legacy = true;
}
if (aAddon.type == "theme") {
// The logic here is kind of clunky but we want to mark complete
// themes as legacy. There's no explicit flag for complete
// themes so explicitly check for new style themes (for which
// isWebExtension is true) or lightweight themes (which have
// ids that end with @personas.mozilla.org)
legacy = !(aAddon.isWebExtension || aAddon.id.endsWith("@personas.mozilla.org"));
}
if (legacy && aAddon.signedState == AddonManager.SIGNEDSTATE_PRIVILEGED) {
legacy = false;
}
// Exceptions that can slip through above: the default theme plus
// test pilot addons until we get SIGNEDSTATE_PRIVILEGED deployed.
if (legacy && legacyWarningExceptions.includes(aAddon.id)) {
legacy = false;
}
}
this.node.setAttribute("legacy", legacy);
document.getElementById("detail-legacy-warning").href = SUPPORT_URL + "webextensions";