Bug 1795322 - Update toolkit modules references in update code. r=application-update-reviewers,bytesized

Differential Revision: https://phabricator.services.mozilla.com/D160028
This commit is contained in:
Mark Banner 2022-10-25 19:49:25 +00:00
parent 7efc75ed17
commit 49bf99096b
4 changed files with 14 additions and 8 deletions

View file

@ -37,7 +37,7 @@ XPCOMUtils.defineLazyGetter(lazy, "log", () => {
);
let consoleOptions = {
// tip: set maxLogLevel to "debug" and use log.debug() to create detailed
// messages during development. See LOG_LEVELS in Console.jsm for details.
// messages during development. See LOG_LEVELS in Console.sys.mjs for details.
maxLogLevel: "error",
maxLogLevelPref: "app.update.background.loglevel",
prefix: "BackgroundUpdate",
@ -198,7 +198,7 @@ export async function runBackgroundTask(commandLine) {
lazy.log.error(`${SLUG}: backgroundupdate`);
// Help debugging. This is a pared down version of
// `dataProviders.application` in `Troubleshoot.jsm`. When adding to this
// `dataProviders.application` in `Troubleshoot.sys.mjs`. When adding to this
// debugging data, try to follow the form from that module.
let data = {
name: Services.appinfo.name,

View file

@ -38,7 +38,7 @@ XPCOMUtils.defineLazyGetter(lazy, "log", () => {
);
let consoleOptions = {
// tip: set maxLogLevel to "debug" and use log.debug() to create detailed
// messages during development. See LOG_LEVELS in Console.jsm for details.
// messages during development. See LOG_LEVELS in Console.sys.mjs for details.
maxLogLevel: "error",
maxLogLevelPref: "app.update.background.loglevel",
prefix: "BackgroundUpdate",
@ -661,7 +661,7 @@ var BackgroundUpdate = {
// Persist.
snapshot.saveSoon();
// Continue persisting periodically. `JSONFile.jsm` will also persist one
// Continue persisting periodically. `JSONFile.sys.mjs` will also persist one
// last time before shutdown.
this._targetingSnapshottingTimer = Cc[
"@mozilla.org/timer;1"

View file

@ -190,7 +190,7 @@ update directory:
.. code::
ChromeUtils.import("resource://gre/modules/FileUtils.jsm").FileUtils.getDir("UpdRootD", [], false).path
ChromeUtils.importESModules("resource://gre/modules/FileUtils.sys.mjs").FileUtils.getDir("UpdRootD", [], false).path
Once you have determined the update directory, close Firefox, browse to
the directory and remove the subdirectory called ``updates``.

View file

@ -46,7 +46,9 @@ class TestNoWindowUpdateRestart(MarionetteTestCase):
Services.prefs.setIntPref("app.update.noWindowAutoRestart.delayMs", 1000);
Services.prefs.clearUserPref("testing.no_window_update_restart.silent_restart_env");
let { UpdateUtils } = ChromeUtils.import("resource://gre/modules/UpdateUtils.jsm");
let { UpdateUtils } = ChromeUtils.importESModule(
"resource://gre/modules/UpdateUtils.sys.mjs"
);
let origAppUpdateAuto = await UpdateUtils.getAppUpdateAutoEnabled();
await UpdateUtils.setAppUpdateAutoEnabled(true);
@ -100,7 +102,9 @@ class TestNoWindowUpdateRestart(MarionetteTestCase):
Services.prefs.clearUserPref("app.update.noWindowAutoRestart.delayMs");
Services.prefs.clearUserPref("testing.no_window_update_restart.silent_restart_env");
let { UpdateUtils } = ChromeUtils.import("resource://gre/modules/UpdateUtils.jsm");
let { UpdateUtils } = ChromeUtils.importESModule(
"resource://gre/modules/UpdateUtils.sys.mjs"
);
await UpdateUtils.setAppUpdateAutoEnabled(origAppUpdateAuto);
})().then(resolve);
""",
@ -163,7 +167,9 @@ class TestNoWindowUpdateRestart(MarionetteTestCase):
let { UpdateListener } = ChromeUtils.import("resource://gre/modules/UpdateListener.jsm");
UpdateListener.reset();
let { AppMenuNotifications } = ChromeUtils.import("resource://gre/modules/AppMenuNotifications.jsm");
let { AppMenuNotifications } = ChromeUtils.importESModule(
"resource://gre/modules/AppMenuNotifications.sys.mjs"
);
AppMenuNotifications.removeNotification(/.*/);
// Remove old update files so that they don't interfere with tests.