Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

/* 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";
// Verify Cu.import and ChromeUtils.import works for JSM URL even after
// ESM-ification, and any not-in-tree consumer doesn't break.
//
// This test modules that's commonly used by not-in-tree consumers, such as
// privilege extensions and AutoConfigs.
const JSMs = [
];
if (AppConstants.platform === "win") {
}
add_task(async function test_chrome_utils_import() {
for (const file of JSMs) {
try {
ChromeUtils.import(file);
ok(true, `Imported ${file}`);
} catch (e) {
ok(false, `Failed to import ${file}`);
}
}
});
add_task(async function test_cu_import() {
for (const file of JSMs) {
try {
// eslint-disable-next-line mozilla/use-chromeutils-import
Cu.import(file, {});
ok(true, `Imported ${file}`);
} catch (e) {
ok(false, `Failed to import ${file}`);
}
}
});