Fix tests (AddonManager is now inside lazy on BrowserGlue.jsm) (#401)
This commit is contained in:
Родитель
2479ad739e
Коммит
61295c474e
|
@ -2,19 +2,19 @@
|
|||
// based on its preference.
|
||||
_monitorTranslationsPref() {
|
||||
const PREF = "extensions.translations.disabled";
|
||||
const ID = "firefox-translations@mozilla.org";
|
||||
const ID = "firefox-translations-addon@mozilla.org";
|
||||
const oldID = "firefox-infobar-ui-bergamot-browser-extension@browser.mt";
|
||||
|
||||
// First, try to uninstall the old extension, if exists.
|
||||
(async () => {
|
||||
let addon = await AddonManager.getAddonByID(oldID);
|
||||
let addon = await lazy.AddonManager.getAddonByID(oldID);
|
||||
if (addon) {
|
||||
addon.uninstall().catch(Cu.reportError);
|
||||
}
|
||||
})();
|
||||
|
||||
const _checkTranslationsPref = async () => {
|
||||
let addon = await AddonManager.getAddonByID(ID);
|
||||
let addon = await lazy.AddonManager.getAddonByID(ID);
|
||||
let disabled = Services.prefs.getBoolPref(PREF, false);
|
||||
if (!addon && disabled) {
|
||||
// not installed, bail out early.
|
||||
|
@ -23,7 +23,7 @@
|
|||
if (!disabled) {
|
||||
// first time install of addon and install on firefox update
|
||||
addon =
|
||||
(await AddonManager.maybeInstallBuiltinAddon(
|
||||
(await lazy.AddonManager.maybeInstallBuiltinAddon(
|
||||
ID,
|
||||
{version},
|
||||
"resource://builtin-addons/translations/"
|
||||
|
|
Загрузка…
Ссылка в новой задаче