From e029583d2aca9c03975a4e8a919e4b575136d598 Mon Sep 17 00:00:00 2001 From: Martin Giger Date: Tue, 21 Feb 2023 21:33:49 +1100 Subject: [PATCH] Bug 1817743 - Port bug 1817183: Convert imports of services/fxaccounts to es modules. r=darktrojan Differential Revision: https://phabricator.services.mozilla.com/D170331 --HG-- extra : rebase_source : a5bd46e83cc3be4fb7b0498f502722f3e10f92cd --- mail/base/content/sync.js | 17 +++++------------ mail/base/test/performance/browser_startup.js | 6 +++--- mail/components/preferences/sync.js | 4 ++-- .../preferences/test/browser/browser_sync.js | 4 ++-- 4 files changed, 12 insertions(+), 19 deletions(-) diff --git a/mail/base/content/sync.js b/mail/base/content/sync.js index e3805598ef..2a53e10856 100644 --- a/mail/base/content/sync.js +++ b/mail/base/content/sync.js @@ -8,17 +8,10 @@ /* import-globals-from utilityOverlay.js */ -ChromeUtils.defineModuleGetter( - this, - "FxAccounts", - "resource://gre/modules/FxAccounts.jsm" -); -ChromeUtils.defineModuleGetter( - this, - "EnsureFxAccountsWebChannel", - "resource://gre/modules/FxAccountsWebChannel.jsm" -); ChromeUtils.defineESModuleGetters(this, { + EnsureFxAccountsWebChannel: + "resource://gre/modules/FxAccountsWebChannel.sys.mjs", + FxAccounts: "resource://gre/modules/FxAccounts.sys.mjs", UIState: "resource://services-sync/UIState.sys.mjs", Weave: "resource://services-sync/main.sys.mjs", }); @@ -142,8 +135,8 @@ var gSync = { } } - let fxAccounts = ChromeUtils.import( - "resource://gre/modules/FxAccounts.jsm" + let fxAccounts = ChromeUtils.importESModule( + "resource://gre/modules/FxAccounts.sys.mjs" ).getFxAccountsSingleton(); if (disconnectAccount) { diff --git a/mail/base/test/performance/browser_startup.js b/mail/base/test/performance/browser_startup.js index f42b031332..4e9664ca47 100644 --- a/mail/base/test/performance/browser_startup.js +++ b/mail/base/test/performance/browser_startup.js @@ -120,10 +120,10 @@ const startupPhases = { "resource:///modules/mimeParser.jsm", "resource://gre/modules/BookmarkHTMLUtils.sys.mjs", "resource://gre/modules/Bookmarks.sys.mjs", - "resource://gre/modules/ContextualIdentityService.jsm", + "resource://gre/modules/ContextualIdentityService.sys.mjs", "resource://gre/modules/CrashSubmit.jsm", - "resource://gre/modules/FxAccounts.jsm", - "resource://gre/modules/FxAccountsStorage.jsm", + "resource://gre/modules/FxAccounts.sys.mjs", + "resource://gre/modules/FxAccountsStorage.sys.mjs", "resource://gre/modules/PlacesBackups.sys.mjs", "resource://gre/modules/PlacesSyncUtils.sys.mjs", "resource://gre/modules/PushComponents.jsm", diff --git a/mail/components/preferences/sync.js b/mail/components/preferences/sync.js index aa253f1a6a..7d74a34837 100644 --- a/mail/components/preferences/sync.js +++ b/mail/components/preferences/sync.js @@ -9,8 +9,8 @@ ChromeUtils.defineESModuleGetters(this, { Weave: "resource://services-sync/main.sys.mjs", }); -var { FxAccounts, getFxAccountsSingleton } = ChromeUtils.import( - "resource://gre/modules/FxAccounts.jsm" +var { FxAccounts, getFxAccountsSingleton } = ChromeUtils.importESModule( + "resource://gre/modules/FxAccounts.sys.mjs" ); var fxAccounts = getFxAccountsSingleton(); diff --git a/mail/components/preferences/test/browser/browser_sync.js b/mail/components/preferences/test/browser/browser_sync.js index 2eb4157ea9..885b6b17ff 100644 --- a/mail/components/preferences/test/browser/browser_sync.js +++ b/mail/components/preferences/test/browser/browser_sync.js @@ -6,8 +6,8 @@ const { MockRegistrar } = ChromeUtils.importESModule( "resource://testing-common/MockRegistrar.sys.mjs" ); -const { FxAccounts } = ChromeUtils.import( - "resource://gre/modules/FxAccounts.jsm" +const { FxAccounts } = ChromeUtils.importESModule( + "resource://gre/modules/FxAccounts.sys.mjs" ); FxAccounts.config.promiseConnectAccountURI = entryPoint => `https://example.org/?page=connect&entryPoint=${entryPoint}`;