Bug 1795322 - Update toolkit modules references in toolkit code. r=mossop

Differential Revision: https://phabricator.services.mozilla.com/D160033
This commit is contained in:
Mark Banner
2022-10-26 08:06:36 +00:00
parent df03438371
commit 202eb0e802
38 changed files with 77 additions and 81 deletions

View File

@@ -25,7 +25,7 @@ class AboutHttpsOnlyErrorChild extends RemotePageChild {
actorCreated() {
super.actorCreated();
// If you add a new function, remember to add it to RemotePageAccessManager.jsm
// If you add a new function, remember to add it to RemotePageAccessManager.sys.mjs
// to allow content-privileged about:httpsonlyerror to use it.
const exportableFunctions = [
"RPMTryPingSecureWWWLink",

View File

@@ -13,7 +13,7 @@ class NetErrorChild extends RemotePageChild {
actorCreated() {
super.actorCreated();
// If you add a new function, remember to add it to RemotePageAccessManager.jsm
// If you add a new function, remember to add it to RemotePageAccessManager.sys.mjs
// to allow content-privileged about:neterror or about:certerror to use it.
const exportableFunctions = [
"RPMGetAppBuildID",

View File

@@ -17,7 +17,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: "toolkit.backgroundtasks.loglevel",
prefix: "BackgroundTasksManager",

View File

@@ -13,7 +13,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: "toolkit.backgroundtasks.loglevel",
prefix: "BackgroundTasksUtils",

View File

@@ -471,7 +471,7 @@ add_task(async function test_extensionId_trimmed_in_telemetry_event() {
// can't be successfully migrated to the new storage backend, then:
// - the new storage backend for that extension is still initialized and enabled
// - any new data is being stored in the new backend
// - the old file is being renamed (with the `.corrupted` suffix that JSONFile.jsm
// - the old file is being renamed (with the `.corrupted` suffix that JSONFile.sys.mjs
// adds when it fails to load the data file) and still available on disk.
add_task(async function test_storage_local_corrupted_data_migration() {
const EXTENSION_ID = "extension-corrupted-data-migration@mozilla.org";

View File

@@ -359,7 +359,7 @@ const Rule kFirefoxRules[] = {
{RegexKey::YEAR, "year"},
{RegexKey::MMYY, "mm\\s*(/|\\\\)\\s*yy"},
{RegexKey::VISA_CHECKOUT, "visa(-|\\s)checkout"},
// This should be a union of NETWORK_NAMES in CreditCard.jsm
// This should be a union of NETWORK_NAMES in CreditCard.sys.mjs
{RegexKey::CREDIT_CARD_NETWORK_LONG,
"american express|master card|union pay"},
// Please also update CREDIT_CARD_NETWORK_EXACT_MATCH while updating

View File

@@ -18,7 +18,7 @@ var LogManager = {
* Configure the root logger for the Recipe Client. Must be called at
* least once before using any loggers created via getLogger.
* @param {Number} loggingLevel
* Logging level to use as defined in Log.jsm
* Logging level to use as defined in Log.sys.mjs
*/
configure(loggingLevel) {
if (!rootLogger) {

View File

@@ -162,7 +162,7 @@ class LoginManagerPrompter {
}
/**
* Displays the PopupNotifications.jsm doorhanger for password save or change.
* Displays the PopupNotifications.sys.mjs doorhanger for password save or change.
*
* @param {Element} browser
* The browser to show the doorhanger on.

View File

@@ -38,7 +38,7 @@ nsresult GetGpuTimeSinceProcessStartInMs(uint64_t* aResult);
// WebIDLProcType, ChromeUtils::RequestProcInfo and ProcTypeToWebIDL to
// mirror the changes.
enum class ProcType {
// These must match the ones in RemoteType.h, and E10SUtils.jsm
// These must match the ones in RemoteType.h, and E10SUtils.sys.mjs
Web,
WebIsolated,
File,

View File

@@ -792,11 +792,11 @@ var DB = {
* notification is fired.
*
* @returns {Promise}
* @resolves An Sqlite.jsm connection to the database.
* @resolves An Sqlite.sys.mjs connection to the database.
* @rejects If connecting to the database, or migrating the database
* failed after MAX_ATTEMPTS attempts (where each attempt
* backs up and deletes the old database), this will reject
* with the Sqlite.jsm error.
* with the Sqlite.sys.mjs error.
*/
get conn() {
delete this.conn;
@@ -828,8 +828,8 @@ var DB = {
* The optional number of the attempt that is being made to connect
* to the database. Defaults to 0.
* @returns {Promise}
* @resolves An Sqlite.jsm connection to the database.
* @rejects After MAX_ATTEMPTS, this will reject with the Sqlite.jsm
* @resolves An Sqlite.sys.mjs connection to the database.
* @rejects After MAX_ATTEMPTS, this will reject with the Sqlite.mjs
* error.
*/
async _establishConn(attemptNum = 0) {

View File

@@ -33,7 +33,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: "toolkit.components.taskscheduler.loglevel",
prefix: "TaskScheduler",

View File

@@ -341,7 +341,7 @@ nsresult nsTypeAheadFind::FindItNow(uint32_t aMode, bool aIsLinksOnly,
if (!aDontIterateFrames) {
// The use of GetInProcessSameTypeRootTreeItem (and later in this method) is
// OK here as out-of-process frames are handled externally by
// FinderParent.jsm, which will end up only calling this method with
// FinderParent.sys.mjs, which will end up only calling this method with
// aDontIterateFrames set to true.
startingDocShell->GetInProcessSameTypeRootTreeItem(
getter_AddRefs(rootContentTreeItem));

View File

@@ -28,7 +28,7 @@ XPCOMUtils.defineLazyGetter(lazy, "log", () => {
return new ConsoleAPI({
prefix: "JsonSchemaValidator.jsm",
// 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",
});
});

View File

@@ -86,7 +86,7 @@ function toFluentID(str) {
.toLowerCase();
}
// Each property in this object corresponds to a property in Troubleshoot.jsm's
// Each property in this object corresponds to a property in Troubleshoot.sys.mjs's
// snapshot data. Each function is passed its property's corresponding data,
// and it's the function's job to update the page with it.
var snapshotFormatters = {
@@ -604,7 +604,7 @@ var snapshotFormatters = {
// graphics-failures-tbody tbody
if ("failures" in data) {
// If indices is there, it should be the same length as failures,
// (see Troubleshoot.jsm) but we check anyway:
// (see Troubleshoot.sys.mjs) but we check anyway:
if ("indices" in data && data.failures.length == data.indices.length) {
let combined = [];
for (let i = 0; i < data.failures.length; i++) {

View File

@@ -97,7 +97,7 @@
}
/**
* Please keep in sync with toolkit/modules/FindBarContent.jsm
* Please keep in sync with toolkit/modules/FindBarContent.sys.mjs
*/
this.FIND_NORMAL = 0;

View File

@@ -114,10 +114,12 @@ export var BrowserUtils = {
},
isFindbarVisible(docShell) {
const FINDER_JSM = "resource://gre/modules/Finder.jsm";
const FINDER_SYS_MJS = "resource://gre/modules/Finder.sys.mjs";
return (
Cu.isModuleLoaded(FINDER_JSM) &&
ChromeUtils.import(FINDER_JSM).Finder.isFindbarVisible(docShell)
Cu.isESModuleLoaded(FINDER_SYS_MJS) &&
ChromeUtils.importESModule(FINDER_SYS_MJS).Finder.isFindbarVisible(
docShell
)
);
},

View File

@@ -157,10 +157,10 @@ function mockAnonymousContentNode(domNode) {
let gWindows = new WeakMap();
/**
* FinderHighlighter class that is used by Finder.jsm to take care of the
* FinderHighlighter class that is used by Finder.sys.mjs to take care of the
* 'Highlight All' feature, which can highlight all find occurrences in a page.
*
* @param {Finder} finder Finder.jsm instance
* @param {Finder} finder Finder.sys.mjs instance
* @param {boolean} useTop check and use top-level windows for rectangle
* computation, if possible.
*/
@@ -818,7 +818,7 @@ FinderHighlighter.prototype = {
* Utility; returns the bounds of the page relative to the viewport.
* If the pages is part of a frameset or inside an iframe of any kind, its
* offset is accounted for.
* Geometry.jsm takes care of the DOMRect calculations.
* Geometry.sys.mjs takes care of the DOMRect calculations.
*
* @param {nsIDOMWindow} window Window to read the boundary rect from
* @param {Boolean} [includeScroll] Whether to ignore the scroll offset,

View File

@@ -202,7 +202,7 @@ FinderParent.prototype = {
onResultFound(aResponse) {
this._foundSearchString = aResponse.searchString;
// The rect stops being a Geometry.jsm:Rect over IPC.
// The rect stops being a Geometry.sys.mjs:Rect over IPC.
if (aResponse.rect) {
aResponse.rect = lazy.Rect.fromRect(aResponse.rect);
}

View File

@@ -60,7 +60,7 @@ export var FirstStartup = {
Promise.all(promises).then(() => (initialized = true));
this.elapsed = 0;
Services.tm.spinEventLoopUntil("FirstStartup.jsm:init", () => {
Services.tm.spinEventLoopUntil("FirstStartup.sys.mjs:init", () => {
this.elapsed = Date.now() - startingTime;
if (this.elapsed >= timeout) {
this._state = this.TIMED_OUT;

View File

@@ -23,7 +23,7 @@ export function percentEncode(aString) {
* parameters: the responseText and the XHR object.
* onError, a function handle to call when an error occcurs, it takes three
* parameters: the error, the responseText and the XHR object.
* logger, an object that implements the debug and log methods (e.g. log.jsm).
* logger, an object that implements the debug and log methods (e.g. Log.sys.mjs).
*
* Headers or post data are given as an array of arrays, for each each inner
* array the first value is the key and the second is the value, e.g.

View File

@@ -206,7 +206,7 @@ JSONFile.prototype = {
} catch (ex) {
// If an exception occurs because the file does not exist or it cannot be read,
// we do two things.
// 1. For consumers of JSONFile.jsm that have configured a `backupTo` path option,
// 1. For consumers of JSONFile.sys.mjs that have configured a `backupTo` path option,
// we try to look for and use backed up json files first. If the backup
// is also not found or if the backup is unreadable, we then start with an empty file.
// 2. If a consumer does not configure a `backupTo` path option, we just start
@@ -316,7 +316,7 @@ JSONFile.prototype = {
} catch (ex) {
// If an exception occurs because the file does not exist or it cannot be read,
// we do two things.
// 1. For consumers of JSONFile.jsm that have configured a `backupTo` path option,
// 1. For consumers of JSONFile.sys.mjs that have configured a `backupTo` path option,
// we try to look for and use backed up json files first. If the backup
// is also not found or if the backup is unreadable, we then start with an empty file.
// 2. If a consumer does not configure a `backupTo` path option, we just start

View File

@@ -87,7 +87,7 @@ XPCOMUtils.defineLazyServiceGetter(
);
const log = console.createInstance({
prefix: "Region.jsm",
prefix: "Region.sys.mjs",
maxLogLevel: lazy.loggingEnabled ? "All" : "Warn",
});
@@ -134,7 +134,7 @@ class RegionDetector {
_retryCount = 0;
// Let tests wait for init to complete.
_initPromise = null;
// Topic for Observer events fired by Region.jsm.
// Topic for Observer events fired by Region.sys.mjs.
REGION_TOPIC = "browser-region-updated";
// Values for telemetry.
TELEMETRY = {

View File

@@ -13,7 +13,7 @@
* This module may be used from both the child and parent process.
*
* Please note that prefs that one wants to update need to be
* explicitly allowed within AsyncPrefs.jsm.
* explicitly allowed within AsyncPrefs.sys.mjs.
*/
export let RemotePageAccessManager = {
/* The accessMap lists the permissions that are allowed per page.

View File

@@ -33,7 +33,7 @@ var likeSqlRegex = /\bLIKE\b\s(?![@:?])/i;
var connectionCounters = new Map();
// Tracks identifiers of wrapped connections, that are Storage connections
// opened through mozStorage and then wrapped by Sqlite.jsm to use its syntactic
// opened through mozStorage and then wrapped by Sqlite.sys.mjs to use its syntactic
// sugar API. Since these connections have an unknown origin, we use this set
// to differentiate their behavior.
var wrappedConnections = new Set();
@@ -147,19 +147,19 @@ function convertStorageErrorResult(result) {
}
}
/**
* Barriers used to ensure that Sqlite.jsm is shutdown after all
* Barriers used to ensure that Sqlite.sys.mjs is shutdown after all
* its clients.
*/
XPCOMUtils.defineLazyGetter(lazy, "Barriers", () => {
let Barriers = {
/**
* Public barrier that clients may use to add blockers to the
* shutdown of Sqlite.jsm. Triggered by profile-before-change.
* shutdown of Sqlite.sys.mjs. Triggered by profile-before-change.
* Once all blockers of this barrier are lifted, we close the
* ability to open new connections.
*/
shutdown: new lazy.AsyncShutdown.Barrier(
"Sqlite.jsm: wait until all clients have completed their task"
"Sqlite.sys.mjs: wait until all clients have completed their task"
),
/**
@@ -168,7 +168,7 @@ XPCOMUtils.defineLazyGetter(lazy, "Barriers", () => {
* set to `true`.
*/
connections: new lazy.AsyncShutdown.Barrier(
"Sqlite.jsm: wait until all connections are closed"
"Sqlite.sys.mjs: wait until all connections are closed"
),
};
@@ -202,13 +202,13 @@ XPCOMUtils.defineLazyGetter(lazy, "Barriers", () => {
Services.obs.addObserver(finalizationObserver, "sqlite-finalization-witness");
/**
* Ensure that Sqlite.jsm:
* Ensure that Sqlite.sys.mjs:
* - informs its clients before shutting down;
* - lets clients open connections during shutdown, if necessary;
* - waits for all connections to be closed before shutdown.
*/
lazy.AsyncShutdown.profileBeforeChange.addBlocker(
"Sqlite.jsm shutdown blocker",
"Sqlite.sys.mjs shutdown blocker",
async function() {
await Barriers.shutdown.wait();
// At this stage, all clients have had a chance to open (and close)
@@ -271,7 +271,7 @@ XPCOMUtils.defineLazyGetter(lazy, "Barriers", () => {
*/
function ConnectionData(connection, identifier, options = {}) {
this._log = lazy.Log.repository.getLoggerWithMessagePrefix(
"Sqlite.jsm",
"Sqlite.sys.mjs",
`Connection ${identifier}: `
);
this._log.manageLevelFromPref("toolkit.sqlitejsm.loglevel");
@@ -391,7 +391,7 @@ ConnectionData.prototype = Object.freeze({
*
* @param {string} name A human-readable name for the ongoing operation, used
* for logging and debugging purposes.
* @param {function(db)} task A function that takes as argument a Sqlite.jsm
* @param {function(db)} task A function that takes as argument a Sqlite.sys.mjs
* db and returns a Promise.
*/
executeBeforeShutdown(parent, name, task) {
@@ -541,7 +541,7 @@ ConnectionData.prototype = Object.freeze({
// function and asyncClose() finishing. See also bug 726990.
this._open = false;
// We must always close the connection at the Sqlite.jsm-level, not
// We must always close the connection at the Sqlite.sys.mjs-level, not
// necessarily at the mozStorage-level.
let markAsClosed = () => {
this._log.debug("Closed");
@@ -691,7 +691,7 @@ ConnectionData.prototype = Object.freeze({
} catch (ex) {
// Unfortunately, if we are wrapping an existing connection, a
// transaction could have been started by a client of the same
// connection that doesn't use Sqlite.jsm (e.g. C++ consumer).
// connection that doesn't use Sqlite.sys.mjs (e.g. C++ consumer).
// The best we can do is proceed without a transaction and hope
// things won't break.
if (wrappedConnections.has(this._identifier)) {
@@ -1093,7 +1093,7 @@ ConnectionData.prototype = Object.freeze({
*/
function openConnection(options) {
let log = lazy.Log.repository.getLoggerWithMessagePrefix(
"Sqlite.jsm",
"Sqlite.sys.mjs",
`ConnectionOpener: `
);
log.manageLevelFromPref("toolkit.sqlitejsm.loglevel");
@@ -1104,7 +1104,8 @@ function openConnection(options) {
if (isClosed) {
throw new Error(
"Sqlite.jsm has been shutdown. Cannot open connection to: " + options.path
"Sqlite.sys.mjs has been shutdown. Cannot open connection to: " +
options.path
);
}
@@ -1239,7 +1240,7 @@ function openConnection(options) {
*/
function cloneStorageConnection(options) {
let log = lazy.Log.repository.getLoggerWithMessagePrefix(
"Sqlite.jsm",
"Sqlite.sys.mjs",
`ConnectionCloner: `
);
log.manageLevelFromPref("toolkit.sqlitejsm.loglevel");
@@ -1254,7 +1255,7 @@ function cloneStorageConnection(options) {
if (isClosed) {
throw new Error(
"Sqlite.jsm has been shutdown. Cannot clone connection to: " +
"Sqlite.sys.mjs has been shutdown. Cannot clone connection to: " +
source.databaseFile.path
);
}
@@ -1299,11 +1300,11 @@ function cloneStorageConnection(options) {
}
/**
* Wraps an existing and open Storage connection with Sqlite.jsm API. The
* Wraps an existing and open Storage connection with Sqlite.sys.mjs API. The
* wrapped connection clone has the same underlying characteristics of the
* original connection and is returned in form of an OpenedConnection handle.
*
* Clients are responsible for closing both the Sqlite.jsm wrapper and the
* Clients are responsible for closing both the Sqlite.sys.mjs wrapper and the
* underlying mozStorage connection.
*
* The following parameters can control the wrapped connection:
@@ -1318,7 +1319,7 @@ function cloneStorageConnection(options) {
*/
function wrapStorageConnection(options) {
let log = lazy.Log.repository.getLoggerWithMessagePrefix(
"Sqlite.jsm",
"Sqlite.sys.mjs",
`ConnectionCloner: `
);
log.manageLevelFromPref("toolkit.sqlitejsm.loglevel");
@@ -1330,7 +1331,7 @@ function wrapStorageConnection(options) {
if (isClosed) {
throw new Error(
"Sqlite.jsm has been shutdown. Cannot wrap connection to: " +
"Sqlite.sys.mjs has been shutdown. Cannot wrap connection to: " +
connection.databaseFile.path
);
}
@@ -1443,13 +1444,13 @@ OpenedConnection.prototype = Object.freeze({
/**
* Returns a handle to the underlying `mozIStorageAsyncConnection`. This is
* ⚠️ **extremely unsafe** ⚠️ because `Sqlite.jsm` continues to manage the
* ⚠️ **extremely unsafe** ⚠️ because `Sqlite.sys.mjs` continues to manage the
* connection's lifecycle, including transactions and shutdown blockers.
* Misusing the raw connection can easily lead to data loss, memory leaks,
* and errors.
*
* Consumers of the raw connection **must not** close or re-wrap it,
* and should not run statements concurrently with `Sqlite.jsm`.
* and should not run statements concurrently with `Sqlite.sys.mjs`.
*
* It's _much_ safer to open a `mozIStorage{Async}Connection` yourself,
* and access it from JavaScript via `Sqlite.wrapStorageConnection`.
@@ -1644,7 +1645,7 @@ OpenedConnection.prototype = Object.freeze({
* Whether a transaction is currently in progress.
*
* Note that this is true if a transaction is active on the connection,
* regardless of whether it was started by `Sqlite.jsm` or another consumer.
* regardless of whether it was started by `Sqlite.sys.mjs` or another consumer.
* See the explanation above `mozIStorageConnection.transactionInProgress` for
* why this distinction matters.
*/

View File

@@ -161,8 +161,8 @@ Example 4: A service with both internal and external dependencies
let { AsyncShutdown } = ChromeUtils.import(
"resource://gre/modules/AsyncShutdown.jsm"
);
let { PromiseUtils } = ChromeUtils.import(
"resource://gre/modules/PromiseUtils.jsm"
let { PromiseUtils } = ChromeUtils.importESModule(
"resource://gre/modules/PromiseUtils.sys.mjs"
);
this.exports = ["FooService2"];

View File

@@ -11,7 +11,7 @@ interface nsIURI;
/**
* C++ exposed interface for the `E10SUtils` object from the
* `resource://gre/modules/E10SUtils.jsm` module.
* `resource://gre/modules/E10SUtils.sys.mjs` module.
*/
[scriptable, uuid(1e18680e-052d-4509-a17e-678f5c495e02)]
interface nsIE10SUtils : nsISupports {

View File

@@ -26,13 +26,6 @@ add_setup(function() {
registerCleanupFunction(async () => {
OSKeyStore.__defineGetter__("isLoggedIn", oldGetters.isLoggedIn);
await OSKeyStoreTestUtils.cleanup();
// CreditCard.jsm, OSKeyStore.jsm, and OSKeyStoreTestUtils.jsm are imported
// into the global scope -- the window -- above. If they're not deleted,
// they outlive the test and are reported as a leak.
delete window.OSKeyStore;
delete window.CreditCard;
delete window.OSKeyStoreTestUtils;
});
});

View File

@@ -45,7 +45,7 @@ function test() {
}
registerCleanupFunction(function() {
// Troubleshoot.jsm is imported into the global scope -- the window -- above.
// Troubleshoot.sys.mjs is imported into the global scope -- the window -- above.
// If it's not deleted, it outlives the test and is reported as a leak.
delete window.Troubleshoot;
});

View File

@@ -502,7 +502,7 @@ var gTests = [
desc:
"WebChannel errors handling the message are delivered back to content",
async run() {
const ERRNO_UNKNOWN_ERROR = 999; // WebChannel.jsm doesn't export this.
const ERRNO_UNKNOWN_ERROR = 999; // WebChannel.sys.mjs doesn't export this.
// The channel where we purposely fail responding to a command.
let channel = new WebChannel("error", Services.io.newURI(HTTP_PATH));
@@ -542,7 +542,7 @@ var gTests = [
desc:
"WebChannel errors due to an invalid channel are delivered back to content",
async run() {
const ERRNO_NO_SUCH_CHANNEL = 2; // WebChannel.jsm doesn't export this.
const ERRNO_NO_SUCH_CHANNEL = 2; // WebChannel.sys.mjs doesn't export this.
// The channel where we see the response when the content sees the error
let echoChannel = new WebChannel("echo", Services.io.newURI(HTTP_PATH));

View File

@@ -2,7 +2,7 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
/*
* Internal module used to test the generation of Integration.jsm getters.
* Internal module used to test the generation of Integration.sys.mjs getters.
*/
"use strict";

View File

@@ -2,7 +2,7 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* This file tests the DeferredTask.jsm module.
* This file tests the DeferredTask.sys.mjs module.
*/
// Globals

View File

@@ -2,7 +2,7 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
/*
* Tests the Integration.jsm module.
* Tests the Integration.sys.mjs module.
*/
"use strict";

View File

@@ -14,7 +14,7 @@ const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/PromiseTestUtils.jsm"
);
// Tests for PromiseUtils.jsm
// Tests for PromiseUtils.sys.mjs
// Tests for PromiseUtils.defer()

View File

@@ -27,7 +27,7 @@ const histogram = Services.telemetry.getHistogramById(
"SEARCH_SERVICE_COUNTRY_FETCH_RESULT"
);
// Region.jsm will call init() on startup and sent a background
// Region.sys.mjs will call init() on startup and sent a background
// task to fetch the region, ensure we have completed this before
// running the rest of the tests.
add_task(async function test_startup() {

View File

@@ -1,5 +1,5 @@
/**
* Tests of OSKeyStore.jsm
* Tests of OSKeyStore.sys.mjs
*/
"use strict";

View File

@@ -38,7 +38,7 @@ function sleep(ms) {
});
}
// When testing finalization, use this to tell Sqlite.jsm to not throw
// When testing finalization, use this to tell Sqlite.sys.mjs to not throw
// an uncatchable `Promise.reject`
function failTestsOnAutoClose(enabled) {
Sqlite.failTestsOnAutoClose(enabled);

View File

@@ -56,10 +56,10 @@ function sleep(ms) {
}
//
// ----------- Don't add a test after this one, as it shuts down Sqlite.jsm
// ----------- Don't add a test after this one, as it shuts down Sqlite.sys.mjs
//
add_task(async function test_shutdown_clients() {
info("Ensuring that Sqlite.jsm doesn't shutdown before its clients");
info("Ensuring that Sqlite.sys.mjs doesn't shutdown before its clients");
let assertions = [];
@@ -89,14 +89,14 @@ add_task(async function test_shutdown_clients() {
async function() {
let db = await getDummyDatabase("opened during shutdown");
dbOpened = true;
db.close().then(() => (dbClosed = true)); // Don't wait for this task to complete, Sqlite.jsm must wait automatically
db.close().then(() => (dbClosed = true)); // Don't wait for this task to complete, Sqlite.sys.mjs must wait automatically
}
);
assertions.push({ name: "dbOpened", value: () => dbOpened });
assertions.push({ name: "dbClosed", value: () => dbClosed });
info("Now shutdown Sqlite.jsm synchronously");
info("Now shutdown Sqlite.sys.mjs synchronously");
Services.prefs.setBoolPref("toolkit.asyncshutdown.testing", true);
AsyncShutdown.profileBeforeChange._trigger();
Services.prefs.clearUserPref("toolkit.asyncshutdown.testing");
@@ -114,5 +114,5 @@ add_task(async function test_shutdown_clients() {
exn = ex;
}
Assert.ok(!!exn);
Assert.ok(exn.message.includes("Sqlite.jsm has been shutdown"));
Assert.ok(exn.message.includes("Sqlite.sys.mjs has been shutdown"));
});

View File

@@ -3,7 +3,7 @@
"use strict";
// Tests exports from Timer.jsm
// Tests exports from Timer.sys.mjs
var imported = ChromeUtils.importESModule(
"resource://gre/modules/Timer.sys.mjs"