Bug 1249074: Don't offer existing sideloaded add-ons to users when creating a new profile. r=rhelmer

MozReview-Commit-ID: 7pnZhEvGRfj
This commit is contained in:
Dave Townsend 2016-02-17 11:06:00 -08:00
parent 718c1f90fb
commit e5fd70477e
4 changed files with 47 additions and 1 deletions

View File

@ -1723,7 +1723,10 @@ this.XPIDatabaseReconcile = {
logger.warn("Disabling foreign installed add-on " + aNewAddon.id + " in "
+ aInstallLocation.name);
aNewAddon.userDisabled = true;
aNewAddon.seen = false;
// If we don't have an old app version then this is a new profile in
// which case just mark any sideloaded add-ons as already seen.
aNewAddon.seen = !aOldAppVersion;
}
}

View File

@ -0,0 +1,41 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
const ID = "bootstrap1@tests.mozilla.org";
Services.prefs.setIntPref("extensions.enabledScopes",
AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_SYSTEM);
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
BootstrapMonitor.init();
const globalDir = gProfD.clone();
globalDir.append("extensions2");
globalDir.append(gAppInfo.ID);
registerDirectory("XRESysSExtPD", globalDir.parent);
const profileDir = gProfD.clone();
profileDir.append("extensions");
// By default disable add-ons from the system
Services.prefs.setIntPref("extensions.autoDisableScopes", AddonManager.SCOPE_SYSTEM);
// When new add-ons already exist in a system location when starting with a new
// profile they should be marked as already seen.
add_task(function*() {
manuallyInstall(do_get_addon("test_bootstrap1_1"), globalDir, ID);
startupManager();
let addon = yield promiseAddonByID(ID);
do_check_true(addon.foreignInstall);
do_check_true(addon.seen);
do_check_true(addon.userDisabled);
do_check_false(addon.isActive);
BootstrapMonitor.checkAddonInstalled(ID);
BootstrapMonitor.checkAddonNotStarted(ID);
yield promiseShutdownManager();
});

View File

@ -285,6 +285,7 @@ skip-if = os == "android"
run-sequentially = Uses hardcoded ports in xpi files.
[test_json_updatecheck.js]
[test_seen.js]
[test_seen_newprofile.js]
[test_updateid.js]
# Bug 676992: test consistently hangs on Android
skip-if = os == "android"

View File

@ -32,4 +32,5 @@ skip-if = appname != "firefox"
[test_temporary.js]
[test_proxy.js]
[include:xpcshell-shared.ini]