Backed out 6 changesets (bug 1816934, bug 1817182, bug 1817179, bug 1817183) for causing dt failures in browser_jsterm_autocomplete_null.js CLOSED TREE

Backed out changeset 17d4c013ed92 (bug 1817183)
Backed out changeset cfed8d9c23f3 (bug 1817183)
Backed out changeset 62fe2f589efe (bug 1817182)
Backed out changeset 557bd773fb85 (bug 1817179)
Backed out changeset 7f8a7865868b (bug 1816934)
Backed out changeset d6c1d4c0d2a0 (bug 1816934)
This commit is contained in:
Cristian Tuns 2023-02-17 10:51:33 -05:00
parent b68aa6d75c
commit b3bf09cc0d
179 changed files with 770 additions and 544 deletions

View file

@ -183,7 +183,7 @@ services/common/kinto-http-client.js
services/common/kinto-offline-client.js
# Webpack-bundled library
services/fxaccounts/FxAccountsPairingChannel.sys.mjs
services/fxaccounts/FxAccountsPairingChannel.js
# Servo is imported.
servo/

View file

@ -21,8 +21,8 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
});
XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {
return ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
return ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton();
});

View file

@ -9,10 +9,17 @@ const { UIState } = ChromeUtils.importESModule(
"resource://services-sync/UIState.sys.mjs"
);
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",
SyncedTabs: "resource://services-sync/SyncedTabs.sys.mjs",
Weave: "resource://services-sync/main.sys.mjs",
});

View file

@ -104,8 +104,8 @@ XPCOMUtils.defineLazyModuleGetters(this, {
});
XPCOMUtils.defineLazyGetter(this, "fxAccounts", () => {
return ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
return ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton();
});

View file

@ -83,8 +83,8 @@ const startupPhases = {
"resource://gre/modules/BookmarkHTMLUtils.sys.mjs",
"resource://gre/modules/Bookmarks.sys.mjs",
"resource://gre/modules/ContextualIdentityService.sys.mjs",
"resource://gre/modules/FxAccounts.sys.mjs",
"resource://gre/modules/FxAccountsStorage.sys.mjs",
"resource://gre/modules/FxAccounts.jsm",
"resource://gre/modules/FxAccountsStorage.jsm",
"resource://gre/modules/PlacesBackups.sys.mjs",
"resource://gre/modules/PlacesExpiration.sys.mjs",
"resource://gre/modules/PlacesSyncUtils.sys.mjs",

View file

@ -10,8 +10,8 @@ ChromeUtils.defineESModuleGetters(this, {
WebChannel: "resource://gre/modules/WebChannel.sys.mjs",
});
var { FxAccountsWebChannel } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsWebChannel.sys.mjs"
var { FxAccountsWebChannel } = ChromeUtils.import(
"resource://gre/modules/FxAccountsWebChannel.jsm"
);
// eslint-disable-next-line @microsoft/sdl/no-insecure-url

View file

@ -27,7 +27,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
"resource:///modules/DownloadsViewableInternally.sys.mjs",
E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs",
FxAccounts: "resource://gre/modules/FxAccounts.sys.mjs",
Integration: "resource://gre/modules/Integration.sys.mjs",
Interactions: "resource:///modules/Interactions.sys.mjs",
Log: "resource://gre/modules/Log.sys.mjs",
@ -42,7 +41,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
QuickSuggest: "resource:///modules/QuickSuggest.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
ScreenshotsUtils: "resource:///modules/ScreenshotsUtils.sys.mjs",
SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.sys.mjs",
SessionStartup: "resource:///modules/sessionstore/SessionStartup.sys.mjs",
@ -76,6 +74,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm",
ExtensionsUI: "resource:///modules/ExtensionsUI.jsm",
FeatureGate: "resource://featuregates/FeatureGate.jsm",
FxAccounts: "resource://gre/modules/FxAccounts.jsm",
HomePage: "resource:///modules/HomePage.jsm",
NetUtil: "resource://gre/modules/NetUtil.jsm",
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
@ -90,6 +89,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
PluralForm: "resource://gre/modules/PluralForm.jsm",
ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm",
PublicSuffixList: "resource://gre/modules/netwerk-dns/PublicSuffixList.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js",
RemoteSecuritySettings:
"resource://gre/modules/psm/RemoteSecuritySettings.jsm",

View file

@ -11,14 +11,10 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
RemoteSettingsClient:
"resource://services-settings/RemoteSettingsClient.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
LoginHelper: "resource://gre/modules/LoginHelper.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js",
RemoteSettingsClient: "resource://services-settings/RemoteSettingsClient.jsm",
});
export const LoginBreaches = {

View file

@ -4,8 +4,8 @@
let { LoginBreaches } = ChromeUtils.importESModule(
"resource:///modules/LoginBreaches.sys.mjs"
);
let { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
let { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
let { _AboutLogins } = ChromeUtils.importESModule(
"resource:///actors/AboutLoginsParent.sys.mjs"

View file

@ -4,8 +4,8 @@
"use strict";
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
// Initializing BrowserGlue requires a profile on Windows.

View file

@ -6,8 +6,8 @@
requestLongerTimeout(2);
const { FxAccounts } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
let { SyncedTabs } = ChromeUtils.importESModule(
"resource://services-sync/SyncedTabs.sys.mjs"

View file

@ -8,8 +8,9 @@
* sourced from either Remote Settings or pref values, with Remote Settings
* being preferred.
*/
import { RemoteSettings } from "resource://services-settings/remote-settings.sys.mjs";
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
const lazy = {};

View file

@ -4,8 +4,13 @@
const lazy = {};
ChromeUtils.defineModuleGetter(
lazy,
"RemoteSettings",
"resource://services-settings/remote-settings.js"
);
ChromeUtils.defineESModuleGetters(lazy, {
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
TestUtils: "resource://testing-common/TestUtils.sys.mjs",
});

View file

@ -7,11 +7,11 @@ ChromeUtils.defineESModuleGetters(this, {
Preferences: "resource://gre/modules/Preferences.sys.mjs",
Region: "resource://gre/modules/Region.sys.mjs",
RegionTestUtils: "resource://testing-common/RegionTestUtils.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
ASRouter: "resource://activity-stream/lib/ASRouter.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js",
});
XPCOMUtils.defineLazyServiceGetter(

View file

@ -7,12 +7,12 @@ const { AddonTestUtils } = ChromeUtils.import(
);
ChromeUtils.defineESModuleGetters(this, {
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
HomePage: "resource:///modules/HomePage.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js",
sinon: "resource://testing-common/Sinon.jsm",
});

View file

@ -8,12 +8,12 @@ const { AddonTestUtils } = ChromeUtils.import(
ChromeUtils.defineESModuleGetters(this, {
PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
AddonManager: "resource://gre/modules/AddonManager.jsm",
HomePage: "resource:///modules/HomePage.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js",
sinon: "resource://testing-common/Sinon.jsm",
});

View file

@ -15,8 +15,8 @@ const { SearchUtils } = ChromeUtils.importESModule(
"resource://gre/modules/SearchUtils.sys.mjs"
);
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");

View file

@ -24,8 +24,8 @@ XPCOMUtils.defineLazyGetter(lazy, "syncUtils", () => {
});
XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {
return ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
return ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton();
});

View file

@ -15,8 +15,8 @@ const { AddonManager } = ChromeUtils.import(
"resource://gre/modules/AddonManager.jsm"
);
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
const { TelemetryController } = ChromeUtils.importESModule(

View file

@ -15,13 +15,13 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs",
BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs",
FxAccounts: "resource://gre/modules/FxAccounts.sys.mjs",
PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs",
Region: "resource://gre/modules/Region.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
AddonManager: "resource://gre/modules/AddonManager.jsm",
FxAccounts: "resource://gre/modules/FxAccounts.jsm",
MigrationUtils: "resource:///modules/MigrationUtils.jsm",
SpecialMessageActions:
"resource://messaging-system/lib/SpecialMessageActions.jsm",

View file

@ -11,12 +11,6 @@ const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Downloader: "resource://services-settings/Attachments.sys.mjs",
MacAttribution: "resource:///modules/MacAttribution.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
SnippetsTestMessageProvider:
"resource://activity-stream/lib/SnippetsTestMessageProvider.jsm",
@ -34,6 +28,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
ASRouterTriggerListeners:
"resource://activity-stream/lib/ASRouterTriggerListeners.jsm",
KintoHttpClient: "resource://services-common/kinto-http-client.js",
Downloader: "resource://services-settings/Attachments.jsm",
RemoteImages: "resource://activity-stream/lib/RemoteImages.jsm",
RemoteL10n: "resource://activity-stream/lib/RemoteL10n.jsm",
ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm",
@ -44,6 +39,9 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
TargetingContext: "resource://messaging-system/targeting/Targeting.jsm",
Utils: "resource://services-settings/Utils.jsm",
});
ChromeUtils.defineESModuleGetters(lazy, {
MacAttribution: "resource:///modules/MacAttribution.sys.mjs",
});
XPCOMUtils.defineLazyServiceGetters(lazy, {
BrowserHandler: ["@mozilla.org/browser/clh;1", "nsIBrowserHandler"],
});
@ -57,8 +55,8 @@ const { CFRMessageProvider } = ChromeUtils.import(
const { OnboardingMessageProvider } = ChromeUtils.import(
"resource://activity-stream/lib/OnboardingMessageProvider.jsm"
);
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
const { CFRPageActions } = ChromeUtils.import(
"resource://activity-stream/lib/CFRPageActions.jsm"

View file

@ -48,8 +48,8 @@ ChromeUtils.defineModuleGetter(
);
XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {
return ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
return ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton();
});

View file

@ -7,8 +7,12 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs",
Region: "resource://gre/modules/Region.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"RemoteSettings",
"resource://services-settings/remote-settings.js"
);
ChromeUtils.defineModuleGetter(
lazy,
"pktApi",

View file

@ -9,8 +9,8 @@ const { actionTypes: at } = ChromeUtils.importESModule(
const { getDomain } = ChromeUtils.import(
"resource://activity-stream/lib/TippyTopProvider.jsm"
);
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
const lazy = {};

View file

@ -5,10 +5,11 @@
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"RemoteSettings",
"resource://services-settings/remote-settings.js"
);
ChromeUtils.defineModuleGetter(
lazy,
@ -16,6 +17,10 @@ ChromeUtils.defineModuleGetter(
"resource://services-settings/Utils.jsm"
);
ChromeUtils.defineESModuleGetters(lazy, {
NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs",
});
const { BasePromiseWorker } = ChromeUtils.import(
"resource://gre/modules/PromiseWorker.jsm"
);

View file

@ -9,15 +9,17 @@ const { JSONFile } = ChromeUtils.importESModule(
const { PromiseUtils } = ChromeUtils.importESModule(
"resource://gre/modules/PromiseUtils.sys.mjs"
);
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Downloader: "resource://services-settings/Attachments.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"Downloader",
"resource://services-settings/Attachments.jsm"
);
ChromeUtils.defineModuleGetter(
lazy,

View file

@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
// Returns whether the passed in params match the criteria.

View file

@ -53,7 +53,6 @@ ChromeUtils.defineModuleGetter(
ChromeUtils.defineESModuleGetters(lazy, {
NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs",
Region: "resource://gre/modules/Region.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
@ -65,6 +64,11 @@ ChromeUtils.defineModuleGetter(
"PageThumbs",
"resource://gre/modules/PageThumbs.jsm"
);
ChromeUtils.defineModuleGetter(
lazy,
"RemoteSettings",
"resource://services-settings/remote-settings.js"
);
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
const { Logger } = ChromeUtils.import(

View file

@ -13,8 +13,8 @@ const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
const { RemoteL10n } = ChromeUtils.import(
"resource://activity-stream/lib/RemoteL10n.jsm"
);
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
// This pref is used to override the Remote Settings server URL in tests.

View file

@ -1,5 +1,5 @@
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
const { ASRouter } = ChromeUtils.import(
"resource://activity-stream/lib/ASRouter.jsm"

View file

@ -1,8 +1,8 @@
const { ASRouter } = ChromeUtils.import(
"resource://activity-stream/lib/ASRouter.jsm"
);
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
const { CFRMessageProvider } = ChromeUtils.import(
"resource://activity-stream/lib/CFRMessageProvider.jsm"

View file

@ -1,8 +1,8 @@
const { ASRouter } = ChromeUtils.import(
"resource://activity-stream/lib/ASRouter.jsm"
);
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
const { CFRMessageProvider } = ChromeUtils.import(
"resource://activity-stream/lib/CFRMessageProvider.jsm"

View file

@ -4,8 +4,8 @@ const { PanelTestProvider } = ChromeUtils.import(
const { MomentsPageHub } = ChromeUtils.import(
"resource://activity-stream/lib/MomentsPageHub.jsm"
);
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
const { ASRouter } = ChromeUtils.import(
"resource://activity-stream/lib/ASRouter.jsm"

View file

@ -9,8 +9,8 @@ const { ASRouter } = ChromeUtils.import(
const { BrowserUtils } = ChromeUtils.importESModule(
"resource://gre/modules/BrowserUtils.sys.mjs"
);
const { Downloader } = ChromeUtils.importESModule(
"resource://services-settings/Attachments.sys.mjs"
const { Downloader } = ChromeUtils.import(
"resource://services-settings/Attachments.jsm"
);
const { ExperimentFakes } = ChromeUtils.import(
"resource://testing-common/NimbusTestUtils.jsm"
@ -26,8 +26,8 @@ const {
const { RemoteImagesTestUtils, RemoteSettingsServer } = ChromeUtils.import(
"resource://testing-common/RemoteImagesTestUtils.jsm"
);
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
const { RemoteSettingsExperimentLoader } = ChromeUtils.import(
"resource://nimbus/lib/RemoteSettingsExperimentLoader.jsm"

View file

@ -7,6 +7,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
CFRMessageProvider: "resource://activity-stream/lib/CFRMessageProvider.jsm",
ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm",
ExperimentFakes: "resource://testing-common/NimbusTestUtils.jsm",
FxAccounts: "resource://gre/modules/FxAccounts.jsm",
HomePage: "resource:///modules/HomePage.jsm",
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
QueryCache: "resource://activity-stream/lib/ASRouterTargeting.jsm",
@ -17,7 +18,6 @@ ChromeUtils.defineESModuleGetters(this, {
AppConstants: "resource://gre/modules/AppConstants.sys.mjs",
AttributionCode: "resource:///modules/AttributionCode.sys.mjs",
BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs",
FxAccounts: "resource://gre/modules/FxAccounts.sys.mjs",
NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs",
PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs",
ProfileAge: "resource://gre/modules/ProfileAge.sys.mjs",

View file

@ -14,8 +14,8 @@ ChromeUtils.defineModuleGetter(
"resource://activity-stream/lib/ASRouterTargeting.jsm"
);
// eslint-disable-next-line no-unused-vars
const { FxAccounts } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
// We import sinon here to make it available across all mochitest test files
// eslint-disable-next-line no-unused-vars

View file

@ -17,9 +17,11 @@ ChromeUtils.defineModuleGetter(
"AddonRepository",
"resource://gre/modules/addons/AddonRepository.jsm"
);
ChromeUtils.defineESModuleGetters(this, {
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
});
ChromeUtils.defineModuleGetter(
this,
"RemoteSettings",
"resource://services-settings/remote-settings.js"
);
ChromeUtils.defineModuleGetter(
this,
"SelectionChangedMenulist",

View file

@ -5,8 +5,8 @@
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { FxAccounts } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const { Weave } = ChromeUtils.importESModule(
"resource://services-sync/main.sys.mjs"
@ -14,9 +14,11 @@ const { Weave } = ChromeUtils.importESModule(
ChromeUtils.defineESModuleGetters(this, {
EventEmitter: "resource://gre/modules/EventEmitter.sys.mjs",
FxAccountsPairingFlow: "resource://gre/modules/FxAccountsPairing.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
FxAccountsPairingFlow: "resource://gre/modules/FxAccountsPairing.jsm",
});
const { require } = ChromeUtils.importESModule(
"resource://devtools/shared/loader/Loader.sys.mjs"
);

View file

@ -42,8 +42,8 @@ var { Weave } = ChromeUtils.importESModule(
"resource://services-sync/main.sys.mjs"
);
var { FxAccounts, getFxAccountsSingleton } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
var { FxAccounts, getFxAccountsSingleton } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
var fxAccounts = getFxAccountsSingleton();

View file

@ -6,8 +6,8 @@
const { UIState } = ChromeUtils.importESModule(
"resource://services-sync/UIState.sys.mjs"
);
const { FxAccountsPairingFlow } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsPairing.sys.mjs"
const { FxAccountsPairingFlow } = ChromeUtils.import(
"resource://gre/modules/FxAccountsPairing.jsm"
);
// Use sinon for mocking.

View file

@ -8,10 +8,13 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
RemoteSettings: "resource://services-settings/remote-settings.js",
});
// The various histograms and scalars that we report to.
const SEARCH_CONTENT_SCALAR_BASE = "browser.search.content.";
const SEARCH_WITH_ADS_SCALAR_BASE = "browser.search.withads.";

View file

@ -16,7 +16,6 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
AboutReaderParent: "resource:///actors/AboutReaderParent.sys.mjs",
BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs",
FxAccounts: "resource://gre/modules/FxAccounts.sys.mjs",
ProfileAge: "resource://gre/modules/ProfileAge.sys.mjs",
ResetProfile: "resource://gre/modules/ResetProfile.sys.mjs",
TelemetryController: "resource://gre/modules/TelemetryController.sys.mjs",
@ -27,12 +26,13 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
AddonManager: "resource://gre/modules/AddonManager.jsm",
BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm",
CustomizableUI: "resource:///modules/CustomizableUI.jsm",
FxAccounts: "resource://gre/modules/FxAccounts.jsm",
PanelMultiView: "resource:///modules/PanelMultiView.jsm",
});
XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {
return ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
return ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton();
});

View file

@ -8,8 +8,8 @@ const { UIState } = ChromeUtils.importESModule(
);
XPCOMUtils.defineLazyGetter(this, "fxAccounts", () => {
return ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
return ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton();
});

View file

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { BaseFeature } from "resource:///modules/urlbar/private/BaseFeature.sys.mjs";
const lazy = {};
@ -9,11 +10,14 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
EventEmitter: "resource://gre/modules/EventEmitter.sys.mjs",
QuickSuggest: "resource:///modules/QuickSuggest.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
TaskQueue: "resource:///modules/UrlbarUtils.sys.mjs",
UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
RemoteSettings: "resource://services-settings/remote-settings.js",
});
const RS_COLLECTION = "quicksuggest";
// Categories that should show "Firefox Suggest" instead of "Sponsored"

View file

@ -8,12 +8,10 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
ChromeUtils.defineESModuleGetters(this, {
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
HomePage: "resource:///modules/HomePage.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js",
// RemoteSettingsClient: "resource://services-settings/RemoteSettingsClient.jsm",
sinon: "resource://testing-common/Sinon.jsm",
});

View file

@ -9,12 +9,12 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
);
ChromeUtils.defineESModuleGetters(this, {
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
HomePage: "resource:///modules/HomePage.jsm",
RemoteSettings: "resource://services-settings/remote-settings.js",
sinon: "resource://testing-common/Sinon.jsm",
});

View file

@ -4,8 +4,8 @@
"use strict";
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
const TARGET_BROWSER_ID = [

View file

@ -9,8 +9,8 @@ const L10N = new LocalizationHelper(
"devtools/client/locales/device.properties"
);
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
loader.lazyRequireGetter(

View file

@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
const FileUtils = ChromeUtils.importESModule(
"resource://gre/modules/FileUtils.sys.mjs"

View file

@ -6,9 +6,11 @@ function UrlClassifierExceptionListService() {}
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"RemoteSettings",
"resource://services-settings/remote-settings.js"
);
const COLLECTION_NAME = "url-classifier-skip-urls";

View file

@ -5,8 +5,8 @@
const EXPORTED_SYMBOLS = ["RemoteSecuritySettings"];
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
const { XPCOMUtils } = ChromeUtils.importESModule(

View file

@ -3,8 +3,8 @@
do_get_profile();
const { Utils } = ChromeUtils.import("resource://services-settings/Utils.jsm");
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
const { RemoteSettings } = ChromeUtils.import(
"resource://services-settings/remote-settings.js"
);
const { RemoteSecuritySettings } = ChromeUtils.import(
"resource://gre/modules/psm/RemoteSecuritySettings.jsm"

View file

@ -0,0 +1,17 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
module.exports = {
env: {
browser: true,
},
rules: {
"no-unused-vars": [
"error",
{ args: "none", varsIgnorePattern: "^EXPORTED_SYMBOLS|^Sync" },
],
},
};

View file

@ -32,8 +32,6 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
FxAccountsClient: "resource://gre/modules/FxAccountsClient.sys.mjs",
FxAccountsConfig: "resource://gre/modules/FxAccountsConfig.sys.mjs",
Log: "resource://gre/modules/Log.sys.mjs",
Svc: "resource://services-sync/util.sys.mjs",
Weave: "resource://services-sync/main.sys.mjs",
@ -41,9 +39,14 @@ ChromeUtils.defineESModuleGetters(lazy, {
setTimeout: "resource://gre/modules/Timer.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
FxAccountsClient: "resource://gre/modules/FxAccountsClient.jsm",
FxAccountsConfig: "resource://gre/modules/FxAccountsConfig.jsm",
});
XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {
return ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
return ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton();
});

View file

@ -3,7 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files("**"):
BUG_COMPONENT = ("Firefox", "Sync")
BUG_COMPONENT = ("Firefox", "Services Automation")
EXTRA_COMPONENTS += [
"AutomationComponents.manifest",

View file

@ -21,8 +21,8 @@ const { RESTRequest } = ChromeUtils.import(
const { CommonUtils } = ChromeUtils.import(
"resource://services-common/utils.js"
);
const { Credentials } = ChromeUtils.importESModule(
"resource://gre/modules/Credentials.sys.mjs"
const { Credentials } = ChromeUtils.import(
"resource://gre/modules/Credentials.jsm"
);
const lazy = {};

View file

@ -9,8 +9,13 @@
* See https://github.com/mozilla/fxa-auth-server/wiki/onepw-protocol
*/
import { Log } from "resource://gre/modules/Log.sys.mjs";
"use strict";
var EXPORTED_SYMBOLS = ["Credentials"];
const { Log } = ChromeUtils.importESModule(
"resource://gre/modules/Log.sys.mjs"
);
const { CryptoUtils } = ChromeUtils.import(
"resource://services-crypto/utils.js"
);
@ -40,7 +45,7 @@ var log = Log.repository.getLogger("Identity.FxAccounts");
log.level = LOG_LEVEL;
log.addAppender(new Log.ConsoleAppender(new Log.BasicFormatter()));
export var Credentials = Object.freeze({
var Credentials = Object.freeze({
/**
* Make constants accessible to tests
*/

View file

@ -1,17 +1,23 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
import { PromiseUtils } from "resource://gre/modules/PromiseUtils.sys.mjs";
const { PromiseUtils } = ChromeUtils.importESModule(
"resource://gre/modules/PromiseUtils.sys.mjs"
);
const { CryptoUtils } = ChromeUtils.import(
"resource://services-crypto/utils.js"
);
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { clearTimeout, setTimeout } from "resource://gre/modules/Timer.sys.mjs";
import { FxAccountsStorageManager } from "resource://gre/modules/FxAccountsStorage.sys.mjs";
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { clearTimeout, setTimeout } = ChromeUtils.importESModule(
"resource://gre/modules/Timer.sys.mjs"
);
const { FxAccountsStorageManager } = ChromeUtils.import(
"resource://gre/modules/FxAccountsStorage.jsm"
);
const {
ERRNO_INVALID_AUTH_TOKEN,
ERROR_AUTH_ERROR,
@ -41,16 +47,47 @@ const {
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
FxAccountsClient: "resource://gre/modules/FxAccountsClient.sys.mjs",
FxAccountsCommands: "resource://gre/modules/FxAccountsCommands.sys.mjs",
FxAccountsConfig: "resource://gre/modules/FxAccountsConfig.sys.mjs",
FxAccountsDevice: "resource://gre/modules/FxAccountsDevice.sys.mjs",
FxAccountsKeys: "resource://gre/modules/FxAccountsKeys.sys.mjs",
FxAccountsProfile: "resource://gre/modules/FxAccountsProfile.sys.mjs",
FxAccountsTelemetry: "resource://gre/modules/FxAccountsTelemetry.sys.mjs",
Preferences: "resource://gre/modules/Preferences.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsClient",
"resource://gre/modules/FxAccountsClient.jsm"
);
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsConfig",
"resource://gre/modules/FxAccountsConfig.jsm"
);
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsCommands",
"resource://gre/modules/FxAccountsCommands.js"
);
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsDevice",
"resource://gre/modules/FxAccountsDevice.jsm"
);
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsKeys",
"resource://gre/modules/FxAccountsKeys.jsm"
);
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsProfile",
"resource://gre/modules/FxAccountsProfile.jsm"
);
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsTelemetry",
"resource://gre/modules/FxAccountsTelemetry.jsm"
);
XPCOMUtils.defineLazyGetter(lazy, "mpLocked", () => {
return ChromeUtils.importESModule("resource://services-sync/util.sys.mjs")
@ -62,6 +99,10 @@ XPCOMUtils.defineLazyGetter(lazy, "ensureMPUnlocked", () => {
.Utils.ensureMPUnlocked;
});
ChromeUtils.defineESModuleGetters(lazy, {
Preferences: "resource://gre/modules/Preferences.sys.mjs",
});
XPCOMUtils.defineLazyPreferenceGetter(
lazy,
"FXA_ENABLED",
@ -88,7 +129,7 @@ XPCOMUtils.defineLazyPreferenceGetter(
// }
// If the state has changed between the function being called and the promise
// being resolved, the .resolve() call will actually be rejected.
export function AccountState(storageManager) {
function AccountState(storageManager) {
this.storageManager = storageManager;
this.inFlightTokenRequests = new Map();
this.promiseInitialized = this.storageManager
@ -334,7 +375,7 @@ function copyObjectProperties(from, to, thisObj, keys) {
* (although |./mach doc| is broken on windows (bug 1232403) and on Linux for
* markh (some obscure npm issue he gave up on) - so later...)
*/
export class FxAccounts {
class FxAccounts {
constructor(mocks = null) {
this._internal = new FxAccountsInternal();
if (mocks) {
@ -1604,8 +1645,7 @@ FxAccountsInternal.prototype = {
};
let fxAccountsSingleton = null;
export function getFxAccountsSingleton() {
function getFxAccountsSingleton() {
if (fxAccountsSingleton) {
return fxAccountsSingleton;
}
@ -1620,3 +1660,4 @@ export function getFxAccountsSingleton() {
}
// `AccountState` is exported for tests.
var EXPORTED_SYMBOLS = ["getFxAccountsSingleton", "FxAccounts", "AccountState"];

View file

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var EXPORTED_SYMBOLS = ["FxAccountsClient"];
const { CommonUtils } = ChromeUtils.import(
"resource://services-common/utils.js"
);
@ -23,7 +25,9 @@ const {
ERRNO_INVALID_AUTH_TOKEN,
log,
} = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
import { Credentials } from "resource://gre/modules/Credentials.sys.mjs";
const { Credentials } = ChromeUtils.import(
"resource://gre/modules/Credentials.jsm"
);
const HOST_PREF = "identity.fxaccounts.auth.uri";
@ -32,9 +36,7 @@ const SIGNUP = "/account/create";
// Devices older than this many days will not appear in the devices list
const DEVICES_FILTER_DAYS = 21;
export var FxAccountsClient = function(
host = Services.prefs.getCharPref(HOST_PREF)
) {
var FxAccountsClient = function(host = Services.prefs.getCharPref(HOST_PREF)) {
this.host = host;
// The FxA auth server expects requests to certain endpoints to be authorized

View file

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const EXPORTED_SYMBOLS = ["SendTab", "FxAccountsCommands"];
const {
COMMAND_SENDTAB,
COMMAND_SENDTAB_TAIL,
@ -14,8 +16,9 @@ ChromeUtils.defineModuleGetter(
"PushCrypto",
"resource://gre/modules/PushCrypto.jsm"
);
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { Observers } = ChromeUtils.import(
"resource://services-common/observers.js"
);
@ -36,7 +39,7 @@ XPCOMUtils.defineLazyPreferenceGetter(
}
);
export class FxAccountsCommands {
class FxAccountsCommands {
constructor(fxAccountsInternal) {
this._fxai = fxAccountsInternal;
this.sendTab = new SendTab(this, fxAccountsInternal);
@ -245,7 +248,7 @@ export class FxAccountsCommands {
* the push keys to deliver the tabs using same mechanism we use for web-push.
* However, clients use the send-tab keys for end-to-end encryption.
*/
export class SendTab {
class SendTab {
constructor(commands, fxAccountsInternal) {
this._commands = commands;
this._fxai = fxAccountsInternal;

View file

@ -1,6 +1,8 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = ["FxAccountsConfig"];
const { RESTRequest } = ChromeUtils.import(
"resource://services-common/rest.js"
@ -8,20 +10,23 @@ const { RESTRequest } = ChromeUtils.import(
const { log } = ChromeUtils.import(
"resource://gre/modules/FxAccountsCommon.js"
);
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {};
XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {
return ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
return ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton();
});
ChromeUtils.defineESModuleGetters(lazy, {
EnsureFxAccountsWebChannel:
"resource://gre/modules/FxAccountsWebChannel.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"EnsureFxAccountsWebChannel",
"resource://gre/modules/FxAccountsWebChannel.jsm"
);
XPCOMUtils.defineLazyPreferenceGetter(
lazy,
@ -52,7 +57,7 @@ const CONFIG_PREFS = [
];
const SYNC_PARAM = "sync";
export var FxAccountsConfig = {
var FxAccountsConfig = {
async promiseEmailURI(email, entrypoint, extraParams = {}) {
return this._buildURL("", {
extraParams: { entrypoint, email, service: SYNC_PARAM, ...extraParams },

View file

@ -1,8 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const {
log,
@ -54,7 +57,7 @@ function sanitizeDeviceName(name) {
}
// Everything to do with FxA devices.
export class FxAccountsDevice {
class FxAccountsDevice {
constructor(fxai) {
this._fxai = fxai;
this._deviceListCache = null;
@ -650,3 +653,5 @@ FxAccountsDevice.prototype.QueryInterface = ChromeUtils.generateQI([
function urlsafeBase64Encode(buffer) {
return ChromeUtils.base64URLEncode(new Uint8Array(buffer), { pad: false });
}
var EXPORTED_SYMBOLS = ["FxAccountsDevice"];

View file

@ -1,9 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
import { PromiseUtils } from "resource://gre/modules/PromiseUtils.sys.mjs";
const { PromiseUtils } = ChromeUtils.importESModule(
"resource://gre/modules/PromiseUtils.sys.mjs"
);
const { CommonUtils } = ChromeUtils.import(
"resource://services-common/utils.js"
);
@ -54,7 +56,7 @@ const DEPRECATED_KEY_SCOPES = [DEPRECATED_SCOPE_ECOSYSTEM_TELEMETRY];
* possible. We intend to remove support for Firefox ever directly handling `kB`
* at some point in the future.
*/
export class FxAccountsKeys {
class FxAccountsKeys {
constructor(fxAccountsInternal) {
this._fxai = fxAccountsInternal;
}
@ -747,3 +749,5 @@ export class FxAccountsKeys {
return CryptoUtils.digestBytes(bytes, hasher);
}
}
var EXPORTED_SYMBOLS = ["FxAccountsKeys"];

View file

@ -2,6 +2,8 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
"use strict";
const {
log,
PREF_REMOTE_PAIRING_URI,
@ -11,19 +13,16 @@ const {
COMMAND_PAIR_HEARTBEAT,
COMMAND_PAIR_COMPLETE,
} = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
import {
getFxAccountsSingleton,
FxAccounts,
} from "resource://gre/modules/FxAccounts.sys.mjs";
const { getFxAccountsSingleton, FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const fxAccounts = getFxAccountsSingleton();
import { setTimeout, clearTimeout } from "resource://gre/modules/Timer.sys.mjs";
const { setTimeout, clearTimeout } = ChromeUtils.importESModule(
"resource://gre/modules/Timer.sys.mjs"
);
ChromeUtils.import("resource://services-common/utils.js");
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
FxAccountsPairingChannel:
"resource://gre/modules/FxAccountsPairingChannel.sys.mjs",
Weave: "resource://services-sync/main.sys.mjs",
});
ChromeUtils.defineModuleGetter(
@ -31,6 +30,11 @@ ChromeUtils.defineModuleGetter(
"jwcrypto",
"resource://services-crypto/jwcrypto.jsm"
);
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsPairingChannel",
"resource://gre/modules/FxAccountsPairingChannel.js"
);
const PAIRING_REDIRECT_URI = "urn:ietf:wg:oauth:2.0:oob:pair-auth-webchannel";
// A pairing flow is not tied to a specific browser window, can also finish in
@ -169,8 +173,7 @@ class Errored extends State {
}
const flows = new Map();
export class FxAccountsPairingFlow {
class FxAccountsPairingFlow {
static get(channelId) {
return flows.get(channelId);
}
@ -515,3 +518,5 @@ export class FxAccountsPairingFlow {
);
}
}
const EXPORTED_SYMBOLS = ["FxAccountsPairingFlow"];

View file

@ -22,14 +22,15 @@
// from Firefox browser code, hence the presence of these privileged browser APIs.
// If you're trying to use this from ordinary web content you're in for a bad time.
import { setTimeout } from "resource://gre/modules/Timer.sys.mjs";
const {setTimeout} = ChromeUtils.importESModule("resource://gre/modules/Timer.sys.mjs");
// We cannot use WebSocket from chrome code without a window,
// see https://bugzilla.mozilla.org/show_bug.cgi?id=784686
const browser = Services.appShell.createWindowlessBrowser(true);
const {WebSocket} = browser.document.ownerGlobal;
export var FxAccountsPairingChannel =
const EXPORTED_SYMBOLS = ["FxAccountsPairingChannel"];
var FxAccountsPairingChannel =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -703,7 +704,7 @@ async function verifyHmac(keyBytes, signature, message) {
hash: { name: 'SHA-256' },
name: 'HMAC',
}, false, ['verify']);
if (! (await crypto.subtle.verify({ name: 'HMAC' }, key, signature, message))) {
if (! await crypto.subtle.verify({ name: 'HMAC' }, key, signature, message)) {
// Yes, we really do throw 'decrypt_error' when failing to verify a HMAC,
// and a 'bad_record_mac' error when failing to decrypt.
throw new TLSError(ALERT_DESCRIPTION.DECRYPT_ERROR);

View file

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/**
* Firefox Accounts Profile helper.
*
@ -10,21 +12,25 @@
* the user's profile in open browser tabs, and cacheing/invalidating profile data.
*/
var EXPORTED_SYMBOLS = ["FxAccountsProfile"];
const { ON_PROFILE_CHANGE_NOTIFICATION, log } = ChromeUtils.import(
"resource://gre/modules/FxAccountsCommon.js"
);
import { getFxAccountsSingleton } from "resource://gre/modules/FxAccounts.sys.mjs";
const { getFxAccountsSingleton } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const fxAccounts = getFxAccountsSingleton();
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
FxAccountsProfileClient:
"resource://gre/modules/FxAccountsProfileClient.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsProfileClient",
"resource://gre/modules/FxAccountsProfileClient.jsm"
);
export var FxAccountsProfile = function(options = {}) {
var FxAccountsProfile = function(options = {}) {
this._currentFetchPromise = null;
this._cachedAt = 0; // when we saved the cached version.
this._isNotifying = false; // are we sending a notification?

View file

@ -7,6 +7,11 @@
*/
"use strict;";
var EXPORTED_SYMBOLS = [
"FxAccountsProfileClient",
"FxAccountsProfileClientError",
];
const {
ERRNO_NETWORK,
ERRNO_PARSE,
@ -20,8 +25,9 @@ const {
SCOPE_PROFILE,
SCOPE_PROFILE_WRITE,
} = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
import { getFxAccountsSingleton } from "resource://gre/modules/FxAccounts.sys.mjs";
const { getFxAccountsSingleton } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const fxAccounts = getFxAccountsSingleton();
const { RESTRequest } = ChromeUtils.import(
"resource://services-common/rest.js"
@ -38,7 +44,7 @@ const { RESTRequest } = ChromeUtils.import(
* The bearer token to access the profile server
* @constructor
*/
export var FxAccountsProfileClient = function(options) {
var FxAccountsProfileClient = function(options) {
if (!options || !options.serverURL) {
throw new Error("Missing 'serverURL' configuration option");
}
@ -238,7 +244,7 @@ FxAccountsProfileClient.prototype = {
* Error message
* @constructor
*/
export var FxAccountsProfileClientError = function(details) {
var FxAccountsProfileClientError = function(details) {
details = details || {};
this.name = "FxAccountsProfileClientError";

View file

@ -26,7 +26,7 @@ const {
* Object, custom options that used for testing
* @constructor
*/
export function FxAccountsPushService(options = {}) {
function FxAccountsPushService(options = {}) {
this.log = log;
if (options.log) {
@ -83,8 +83,8 @@ FxAccountsPushService.prototype = {
if (options.fxai) {
this.fxai = options.fxai;
} else {
const { getFxAccountsSingleton } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
const { getFxAccountsSingleton } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const fxAccounts = getFxAccountsSingleton();
this.fxai = fxAccounts._internal;
@ -312,3 +312,5 @@ FxAccountsPushService.prototype = {
});
},
};
var EXPORTED_SYMBOLS = ["FxAccountsPushService"];

View file

@ -1,6 +1,14 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = [
"FxAccountsStorageManagerCanStoreField",
"FxAccountsStorageManager",
// Exported for tests.
"LoginManagerStorage",
];
const {
DATA_FORMAT_VERSION,
@ -14,7 +22,7 @@ const {
// A helper function so code can check what fields are able to be stored by
// the storage manager without having a reference to a manager instance.
export function FxAccountsStorageManagerCanStoreField(fieldName) {
function FxAccountsStorageManagerCanStoreField(fieldName) {
return (
FXA_PWDMGR_PLAINTEXT_FIELDS.has(fieldName) ||
FXA_PWDMGR_SECURE_FIELDS.has(fieldName)
@ -22,7 +30,7 @@ export function FxAccountsStorageManagerCanStoreField(fieldName) {
}
// The storage manager object.
export var FxAccountsStorageManager = function(options = {}) {
var FxAccountsStorageManager = function(options = {}) {
this.options = {
filename: options.filename || DEFAULT_STORAGE_FILENAME,
baseDir: options.baseDir || Services.dirsvc.get("ProfD", Ci.nsIFile).path,
@ -467,7 +475,6 @@ JSONStorage.prototype = {
};
function StorageLockedError() {}
/**
* LoginManagerStorage constructor that creates instances that set/get
* data stored securely in the nsILoginManager.
@ -475,7 +482,7 @@ function StorageLockedError() {}
* @return instance
*/
export function LoginManagerStorage() {}
function LoginManagerStorage() {}
LoginManagerStorage.prototype = {
STORAGE_LOCKED: StorageLockedError,

View file

@ -2,12 +2,16 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
// FxA Telemetry support. For hysterical raisins, the actual implementation
// is inside "sync". We should move the core implementation somewhere that's
// sanely shared (eg, services-common?), but let's wait and see where we end up
// first...
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {};
@ -30,7 +34,7 @@ XPCOMUtils.defineLazyPreferenceGetter(
""
);
export class FxAccountsTelemetry {
class FxAccountsTelemetry {
constructor(fxai) {
this._fxai = fxai;
Services.telemetry.setEventRecordingEnabled("fxa", true);
@ -172,3 +176,5 @@ export class FxAccountsTelemetry {
}
}
}
var EXPORTED_SYMBOLS = ["FxAccountsTelemetry"];

View file

@ -1,6 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/**
* Firefox Accounts Web Channel.
@ -9,8 +10,16 @@
* about account state changes.
*/
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
var EXPORTED_SYMBOLS = [
"EnsureFxAccountsWebChannel",
// These are exported for tests.
"FxAccountsWebChannel",
"FxAccountsWebChannelHelpers",
];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const {
COMMAND_PROFILE_CHANGE,
COMMAND_LOGIN,
@ -38,23 +47,30 @@ const {
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
FxAccountsPairingFlow: "resource://gre/modules/FxAccountsPairing.sys.mjs",
FxAccountsStorageManagerCanStoreField:
"resource://gre/modules/FxAccountsStorage.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
Weave: "resource://services-sync/main.sys.mjs",
WebChannel: "resource://gre/modules/WebChannel.sys.mjs",
});
XPCOMUtils.defineLazyGetter(lazy, "fxAccounts", () => {
return ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
return ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
).getFxAccountsSingleton();
});
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsStorageManagerCanStoreField",
"resource://gre/modules/FxAccountsStorage.jsm"
);
ChromeUtils.defineModuleGetter(
lazy,
"CryptoUtils",
"resource://services-crypto/utils.js"
);
ChromeUtils.defineModuleGetter(
lazy,
"FxAccountsPairingFlow",
"resource://gre/modules/FxAccountsPairing.jsm"
);
XPCOMUtils.defineLazyPreferenceGetter(
lazy,
"pairingEnabled",
@ -125,7 +141,7 @@ function getErrorDetails(error) {
* Helpers functions. Should only be passed in for testing.
* @constructor
*/
export function FxAccountsWebChannel(options) {
function FxAccountsWebChannel(options) {
if (!options) {
throw new Error("Missing configuration options");
}
@ -390,7 +406,7 @@ FxAccountsWebChannel.prototype = {
},
};
export function FxAccountsWebChannelHelpers(options) {
function FxAccountsWebChannelHelpers(options) {
options = options || {};
this._fxAccounts = options.fxAccounts || lazy.fxAccounts;
@ -727,13 +743,12 @@ FxAccountsWebChannelHelpers.prototype = {
};
var singleton;
// The entry-point for this module, which ensures only one of our channels is
// ever created - we require this because the WebChannel is global in scope
// (eg, it uses the observer service to tell interested parties of interesting
// things) and allowing multiple channels would cause such notifications to be
// sent multiple times.
export var EnsureFxAccountsWebChannel = () => {
var EnsureFxAccountsWebChannel = () => {
let contentUri = Services.urlFormatter.formatURLPref(
"identity.fxaccounts.remote.root"
);

View file

@ -8,7 +8,7 @@ Classes = [
{
'cid': '{1b7db999-2ecd-4abf-bb95-a726896798ca}',
'contract_ids': ['@mozilla.org/fxaccounts/push;1'],
'esModule': 'resource://gre/modules/FxAccountsPush.sys.mjs',
'jsm': 'resource://gre/modules/FxAccountsPush.jsm',
'constructor': 'FxAccountsPushService',
'processes': ProcessSelector.MAIN_PROCESS_ONLY,
'categories': {'push': 'chrome://fxa-device-update'},

View file

@ -14,22 +14,22 @@ BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.ini"]
XPCSHELL_TESTS_MANIFESTS += ["tests/xpcshell/xpcshell.ini"]
EXTRA_JS_MODULES += [
"Credentials.sys.mjs",
"FxAccounts.sys.mjs",
"FxAccountsClient.sys.mjs",
"FxAccountsCommands.sys.mjs",
"Credentials.jsm",
"FxAccounts.jsm",
"FxAccountsClient.jsm",
"FxAccountsCommands.js",
"FxAccountsCommon.js",
"FxAccountsConfig.sys.mjs",
"FxAccountsDevice.sys.mjs",
"FxAccountsKeys.sys.mjs",
"FxAccountsPairing.sys.mjs",
"FxAccountsPairingChannel.sys.mjs",
"FxAccountsProfile.sys.mjs",
"FxAccountsProfileClient.sys.mjs",
"FxAccountsPush.sys.mjs",
"FxAccountsStorage.sys.mjs",
"FxAccountsTelemetry.sys.mjs",
"FxAccountsWebChannel.sys.mjs",
"FxAccountsConfig.jsm",
"FxAccountsDevice.jsm",
"FxAccountsKeys.jsm",
"FxAccountsPairing.jsm",
"FxAccountsPairingChannel.js",
"FxAccountsProfile.jsm",
"FxAccountsProfileClient.jsm",
"FxAccountsPush.jsm",
"FxAccountsStorage.jsm",
"FxAccountsTelemetry.jsm",
"FxAccountsWebChannel.jsm",
]
XPCOM_MANIFESTS += [

View file

@ -1,8 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const { FxAccounts } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const gBrowserGlue = Cc["@mozilla.org/browser/browserglue;1"].getService(

View file

@ -6,11 +6,11 @@
const { CryptoUtils } = ChromeUtils.import(
"resource://services-crypto/utils.js"
);
const { FxAccounts } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const { FxAccountsClient } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsClient.sys.mjs"
const { FxAccountsClient } = ChromeUtils.import(
"resource://gre/modules/FxAccountsClient.jsm"
);
const {
ERRNO_INVALID_AUTH_TOKEN,
@ -27,8 +27,8 @@ const { PromiseUtils } = ChromeUtils.importESModule(
);
// We grab some additional stuff via backstage passes.
var { AccountState } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
var { AccountState } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const MOCK_TOKEN_RESPONSE = {

View file

@ -3,8 +3,8 @@
"use strict";
const { FxAccounts } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
add_task(

View file

@ -3,14 +3,14 @@
"use strict";
const { FxAccounts } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const { FxAccountsClient } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsClient.sys.mjs"
const { FxAccountsClient } = ChromeUtils.import(
"resource://gre/modules/FxAccountsClient.jsm"
);
const { FxAccountsDevice } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsDevice.sys.mjs"
const { FxAccountsDevice } = ChromeUtils.import(
"resource://gre/modules/FxAccountsDevice.jsm"
);
const {
ERRNO_DEVICE_SESSION_CONFLICT,
@ -20,8 +20,8 @@ const {
ON_DEVICE_DISCONNECTED_NOTIFICATION,
ON_DEVICELIST_UPDATED,
} = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
var { AccountState } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
var { AccountState } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
initTestLogging("Trace");

View file

@ -3,8 +3,8 @@
"use strict";
const { FxAccountsClient } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsClient.sys.mjs"
const { FxAccountsClient } = ChromeUtils.import(
"resource://gre/modules/FxAccountsClient.jsm"
);
const FAKE_SESSION_TOKEN =

View file

@ -3,12 +3,12 @@
"use strict";
const { FxAccountsCommands, SendTab } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsCommands.sys.mjs"
const { FxAccountsCommands, SendTab } = ChromeUtils.import(
"resource://gre/modules/FxAccountsCommands.js"
);
const { FxAccountsClient } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsClient.sys.mjs"
const { FxAccountsClient } = ChromeUtils.import(
"resource://gre/modules/FxAccountsClient.jsm"
);
const { COMMAND_SENDTAB, COMMAND_SENDTAB_TAIL } = ChromeUtils.import(

View file

@ -1,8 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const { Credentials } = ChromeUtils.importESModule(
"resource://gre/modules/Credentials.sys.mjs"
const { Credentials } = ChromeUtils.import(
"resource://gre/modules/Credentials.jsm"
);
const { CryptoUtils } = ChromeUtils.import(
"resource://services-crypto/utils.js"

View file

@ -3,8 +3,8 @@
"use strict";
const { getFxAccountsSingleton } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
const { getFxAccountsSingleton } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const fxAccounts = getFxAccountsSingleton();

View file

@ -3,8 +3,8 @@
"use strict";
const { FxAccountsKeys } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsKeys.sys.mjs"
const { FxAccountsKeys } = ChromeUtils.import(
"resource://gre/modules/FxAccountsKeys.jsm"
);
// Ref https://github.com/mozilla/fxa-crypto-relier/ for the details

View file

@ -8,8 +8,8 @@
// See verbose logging from FxAccounts.jsm
Services.prefs.setCharPref("identity.fxaccounts.loglevel", "Trace");
const { FxAccounts } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const { FXA_PWDMGR_HOST, FXA_PWDMGR_REALM } = ChromeUtils.import(
"resource://gre/modules/FxAccountsCommon.js"
@ -17,8 +17,8 @@ const { FXA_PWDMGR_HOST, FXA_PWDMGR_REALM } = ChromeUtils.import(
// Use a backstage pass to get at our LoginManagerStorage object, so we can
// mock the prototype.
var { LoginManagerStorage } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsStorage.sys.mjs"
var { LoginManagerStorage } = ChromeUtils.import(
"resource://gre/modules/FxAccountsStorage.jsm"
);
var isLoggedIn = true;
LoginManagerStorage.prototype.__defineGetter__("_isLoggedIn", () => isLoggedIn);

View file

@ -3,16 +3,16 @@
"use strict";
const { FxAccounts } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const { FxAccountsClient } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsClient.sys.mjs"
const { FxAccountsClient } = ChromeUtils.import(
"resource://gre/modules/FxAccountsClient.jsm"
);
// We grab some additional stuff via backstage passes.
var { AccountState } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
var { AccountState } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
function promiseNotification(topic) {

View file

@ -3,14 +3,14 @@
"use strict";
const { FxAccounts } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
const { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const { FxAccountsClient } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsClient.sys.mjs"
const { FxAccountsClient } = ChromeUtils.import(
"resource://gre/modules/FxAccountsClient.jsm"
);
var { AccountState } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
var { AccountState } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
function promiseNotification(topic) {

View file

@ -3,8 +3,8 @@
"use strict";
const { FxAccountsPairingFlow } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsPairing.sys.mjs"
const { FxAccountsPairingFlow } = ChromeUtils.import(
"resource://gre/modules/FxAccountsPairing.jsm"
);
const { EventEmitter } = ChromeUtils.importESModule(
"resource://gre/modules/EventEmitter.sys.mjs"

View file

@ -6,11 +6,11 @@
const { ON_PROFILE_CHANGE_NOTIFICATION, log } = ChromeUtils.import(
"resource://gre/modules/FxAccountsCommon.js"
);
const { FxAccountsProfileClient } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsProfileClient.sys.mjs"
const { FxAccountsProfileClient } = ChromeUtils.import(
"resource://gre/modules/FxAccountsProfileClient.jsm"
);
const { FxAccountsProfile } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsProfile.sys.mjs"
const { FxAccountsProfile } = ChromeUtils.import(
"resource://gre/modules/FxAccountsProfile.jsm"
);
const { PromiseUtils } = ChromeUtils.importESModule(
"resource://gre/modules/PromiseUtils.sys.mjs"

View file

@ -16,9 +16,7 @@ const {
const {
FxAccountsProfileClient,
FxAccountsProfileClientError,
} = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsProfileClient.sys.mjs"
);
} = ChromeUtils.import("resource://gre/modules/FxAccountsProfileClient.jsm");
const STATUS_SUCCESS = 200;

View file

@ -5,6 +5,7 @@
// Tests for the FxA push service.
/* eslint-disable no-shadow */
/* eslint-disable mozilla/use-chromeutils-generateqi */
const {
@ -21,13 +22,16 @@ const {
log,
} = ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
const { FxAccountsPushService } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsPush.sys.mjs"
let importScope = {};
Services.scriptloader.loadSubScript(
"resource://gre/modules/FxAccountsPush.jsm",
importScope
);
const FxAccountsPushService = importScope.FxAccountsPushService;
XPCOMUtils.defineLazyServiceGetter(
this,
"PushService",
"pushService",
"@mozilla.org/push/Service;1",
"nsIPushService"
);
@ -39,8 +43,8 @@ const MOCK_ENDPOINT = "http://mochi.test:8888";
// tests do not allow external connections, mock the PushService
let mockPushService = {
pushTopic: PushService.pushTopic,
subscriptionChangeTopic: PushService.subscriptionChangeTopic,
pushTopic: pushService.pushTopic,
subscriptionChangeTopic: pushService.subscriptionChangeTopic,
subscribe(scope, principal, cb) {
cb(Cr.NS_OK, {
endpoint: MOCK_ENDPOINT,
@ -212,8 +216,8 @@ add_task(async function observePushTopicDeviceDisconnected_current_device() {
};
let signoutCalled = false;
let { FxAccounts } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
let { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const fxAccountsMock = new FxAccounts({
newAccountState() {
@ -268,8 +272,8 @@ add_task(async function observePushTopicDeviceDisconnected_another_device() {
};
let signoutCalled = false;
let { FxAccounts } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
let { FxAccounts } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const fxAccountsMock = new FxAccounts({
newAccountState() {

View file

@ -5,8 +5,8 @@
// Tests for the FxA storage manager.
const { FxAccountsStorageManager } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsStorage.sys.mjs"
const { FxAccountsStorageManager } = ChromeUtils.import(
"resource://gre/modules/FxAccountsStorage.jsm"
);
const { DATA_FORMAT_VERSION, log } = ChromeUtils.import(
"resource://gre/modules/FxAccountsCommon.js"

View file

@ -3,8 +3,8 @@
"use strict";
const { getFxAccountsSingleton } = ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
const { getFxAccountsSingleton } = ChromeUtils.import(
"resource://gre/modules/FxAccounts.jsm"
);
const fxAccounts = getFxAccountsSingleton();

View file

@ -14,9 +14,7 @@ const { CryptoUtils } = ChromeUtils.import(
const {
FxAccountsWebChannel,
FxAccountsWebChannelHelpers,
} = ChromeUtils.importESModule(
"resource://gre/modules/FxAccountsWebChannel.sys.mjs"
);
} = ChromeUtils.import("resource://gre/modules/FxAccountsWebChannel.jsm");
const URL_STRING = "https://example.com";

View file

@ -2,16 +2,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
var EXPORTED_SYMBOLS = ["Downloader"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
RemoteSettingsWorker:
"resource://services-settings/RemoteSettingsWorker.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
RemoteSettingsWorker: "resource://services-settings/RemoteSettingsWorker.jsm",
Utils: "resource://services-settings/Utils.jsm",
});
@ -94,7 +92,7 @@ class LazyRecordAndBuffer {
}
}
export class Downloader {
class Downloader {
static get DownloadError() {
return DownloadError;
}

View file

@ -2,7 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {};
@ -18,12 +20,14 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
});
XPCOMUtils.defineLazyGetter(lazy, "console", () => lazy.Utils.log);
var EXPORTED_SYMBOLS = ["Database"];
/**
* Database is a tiny wrapper with the objective
* of providing major kinto-offline-client collection API.
* (with the objective of getting rid of kinto-offline-client)
*/
export class Database {
class Database {
static destroy() {
return destroyIDB();
}

View file

@ -2,25 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
"use strict";
import { Downloader } from "resource://services-settings/Attachments.sys.mjs";
var EXPORTED_SYMBOLS = ["RemoteSettingsClient"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const { Downloader } = ChromeUtils.import(
"resource://services-settings/Attachments.jsm"
);
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Database: "resource://services-settings/Database.sys.mjs",
RemoteSettingsWorker:
"resource://services-settings/RemoteSettingsWorker.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
ClientEnvironmentBase:
"resource://gre/modules/components-utils/ClientEnvironment.jsm",
Database: "resource://services-settings/Database.jsm",
IDBHelpers: "resource://services-settings/IDBHelpers.jsm",
KintoHttpClient: "resource://services-common/kinto-http-client.js",
ObjectUtils: "resource://gre/modules/ObjectUtils.jsm",
RemoteSettingsWorker: "resource://services-settings/RemoteSettingsWorker.jsm",
SharedUtils: "resource://services-settings/SharedUtils.jsm",
UptakeTelemetry: "resource://services-common/uptake-telemetry.js",
Utils: "resource://services-settings/Utils.jsm",
@ -262,7 +267,7 @@ class AttachmentDownloader extends Downloader {
}
}
export class RemoteSettingsClient extends EventEmitter {
class RemoteSettingsClient extends EventEmitter {
static get APIError() {
return APIError;
}

View file

@ -1,14 +1,19 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = ["RemoteSettingsTimer"];
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"RemoteSettings",
"resource://services-settings/remote-settings.js"
);
export var RemoteSettingsTimer = function() {};
var RemoteSettingsTimer = function() {};
RemoteSettingsTimer.prototype = {
QueryInterface: ChromeUtils.generateQI(["nsITimerCallback"]),
classID: Components.ID("{5e756573-234a-49ea-bbe4-59ec7a70657d}"),

View file

@ -129,7 +129,7 @@ const Agent = {
/**
* Wrap worker invocations in order to return the `callbackId` along
* the result. This will allow to transform the worker invocations
* into promises in `RemoteSettingsWorker.sys.mjs`.
* into promises in `RemoteSettingsWorker.jsm`.
*/
self.onmessage = event => {
const { callbackId, method, args = [] } = event.data;
@ -157,7 +157,7 @@ let gPendingTransactions = new Set();
*/
async function importDumpIDB(bucket, collection, records, timestamp) {
// Open the DB. It will exist since if we are running this, it means
// we already tried to read the timestamp in `remote-settings.sys.mjs`
// we already tried to read the timestamp in `remote-settings.js`
const db = await IDBHelpers.openIDB(false /* do not allow upgrades */);
// try...finally to ensure we always close the db.

View file

@ -2,12 +2,19 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/**
* Interface to a dedicated thread handling for Remote Settings heavy operations.
*/
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { setTimeout, clearTimeout } = ChromeUtils.importESModule(
"resource://gre/modules/Timer.sys.mjs"
);
import { setTimeout, clearTimeout } from "resource://gre/modules/Timer.sys.mjs";
var EXPORTED_SYMBOLS = ["RemoteSettingsWorker"];
const lazy = {};
@ -233,6 +240,6 @@ try {
gShutdown = true;
}
export var RemoteSettingsWorker = new Worker(
var RemoteSettingsWorker = new Worker(
"resource://services-settings/RemoteSettingsWorker.js"
);

View file

@ -2,7 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {};
@ -10,6 +12,8 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
KeyValueService: "resource://gre/modules/kvstore.jsm",
});
var EXPORTED_SYMBOLS = ["SyncHistory"];
/**
* A helper to keep track of synchronization statuses.
*
@ -17,7 +21,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
* because the eventual goal is to be able to detect `IndexedDB` issues and act
* accordingly.
*/
export class SyncHistory {
class SyncHistory {
// Internal reference to underlying rkv store.
#store;

View file

@ -8,7 +8,7 @@ Classes = [
{
'cid': '{5e756573-234a-49ea-bbe4-59ec7a70657d}',
'contract_ids': ['@mozilla.org/services/settings;1'],
'esModule': 'resource://services-settings/RemoteSettingsComponents.sys.mjs',
'jsm': 'resource://services-settings/RemoteSettingsComponents.jsm',
'constructor': 'RemoteSettingsTimer',
},
]

Some files were not shown because too many files have changed in this diff Show more