Bug 1486761 - Add installTelemetryInfo to addon installed from EnterprisePolicies. r=mkaply

Differential Revision: https://phabricator.services.mozilla.com/D5549

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Luca Greco 2018-09-11 16:22:24 +00:00
parent 0b01108591
commit e5063cc5ef
2 changed files with 5 additions and 1 deletions

View File

@ -433,7 +433,8 @@ var Policies = {
}
url = Services.io.newFileURI(xpiFile).spec;
}
AddonManager.getInstallForURL(url, "application/x-xpinstall").then(install => {
AddonManager.getInstallForURL(url, "application/x-xpinstall", null, null, null, null, null,
{source: "enterprise-policy"}).then(install => {
if (install.addon && install.addon.appDisabled) {
log.error(`Incompatible add-on - ${location}`);
install.cancel();

View File

@ -21,6 +21,9 @@ add_task(async function test_addon_install() {
await installPromise;
let addon = await AddonManager.getAddonByID(addonID);
isnot(addon, null, "Addon not installed.");
Assert.deepEqual(addon.installTelemetryInfo, {source: "enterprise-policy"},
"Got the expected addon.installTelemetryInfo");
});
add_task(async function test_addon_locked() {