Bug 1204012: Lightweight themes are disabled if any add-ons are detected or modified during startup. r=rhelmer

When a lightweight theme is active the default theme is the selected skin but
the default theme's addon object is marked as inactive (to deal with the horror
of only allowing the user to select a single theme through the UI).

During startup we should only switch back to the default theme if there is a
non-default skin selected that we didn't see.
This commit is contained in:
Dave Townsend 2015-09-11 10:38:35 -07:00
parent a4ebe821fd
commit 35eedaa625
2 changed files with 49 additions and 3 deletions

View File

@ -2118,8 +2118,10 @@ this.XPIDatabaseReconcile = {
}
}
// None of the active add-ons match the selected theme, enable the default.
if (!sawActiveTheme) {
// If a custom theme is selected and it wasn't seen in the new list of
// active add-ons then enable the default theme
if (XPIProvider.selectedSkin != XPIProvider.defaultSkin && !sawActiveTheme) {
logger.info("Didn't see selected skin " + XPIProvider.selectedSkin);
XPIProvider.enableDefaultTheme();
}

View File

@ -1089,7 +1089,51 @@ function run_test_21() {
p1.userDisabled = false;
ensure_test_completed();
end_test();
run_test_22();
});
}));
}
// Detecting a new add-on during the startup file check should not disable an
// active lightweight theme
function run_test_22() {
restartManager();
AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
"1@personas.mozilla.org"], function([d, p1]) {
do_check_true(d.userDisabled);
do_check_false(d.appDisabled);
do_check_false(d.isActive);
do_check_false(p1.userDisabled);
do_check_false(p1.appDisabled);
do_check_true(p1.isActive);
writeInstallRDFForExtension({
id: "theme3@tests.mozilla.org",
version: "1.0",
name: "Test 3",
internalName: "theme3/1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "2"
}]
}, profileDir);
restartManager();
AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
"1@personas.mozilla.org"], function([d, p1]) {
do_check_true(d.userDisabled);
do_check_false(d.appDisabled);
do_check_false(d.isActive);
do_check_false(p1.userDisabled);
do_check_false(p1.appDisabled);
do_check_true(p1.isActive);
end_test();
});
});
}