1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 // Verify Cu.import and ChromeUtils.import works for JSM URL even after
9 // ESM-ification, and any not-in-tree consumer doesn't break.
11 // This test modules that's commonly used by not-in-tree consumers, such as
12 // privilege extensions and AutoConfigs.
15 "resource:///modules/AboutNewTab.jsm",
16 "resource:///modules/CustomizableUI.jsm",
17 "resource:///modules/UITour.jsm",
18 "resource:///modules/distribution.js",
19 "resource://gre/modules/AddonManager.jsm",
20 "resource://gre/modules/AppConstants.jsm",
21 "resource://gre/modules/AsyncShutdown.jsm",
22 "resource://gre/modules/Console.jsm",
23 "resource://gre/modules/FileUtils.jsm",
24 "resource://gre/modules/LightweightThemeManager.jsm",
25 "resource://gre/modules/NetUtil.jsm",
26 "resource://gre/modules/PlacesUtils.jsm",
27 "resource://gre/modules/PrivateBrowsingUtils.jsm",
28 "resource://gre/modules/Timer.jsm",
29 "resource://gre/modules/XPCOMUtils.jsm",
30 "resource://gre/modules/addons/XPIDatabase.jsm",
31 "resource://gre/modules/addons/XPIProvider.jsm",
32 "resource://gre/modules/addons/XPIInstall.jsm",
33 "resource:///modules/BrowserWindowTracker.jsm",
36 if (AppConstants.platform === "win") {
37 JSMs.push("resource:///modules/WindowsJumpLists.jsm");
40 add_task(async function test_chrome_utils_import() {
41 for (const file of JSMs) {
43 ChromeUtils.import(file);
44 ok(true, `Imported ${file}`);
46 ok(false, `Failed to import ${file}`);
51 add_task(async function test_cu_import() {
52 for (const file of JSMs) {
54 // eslint-disable-next-line mozilla/use-chromeutils-import
56 ok(true, `Imported ${file}`);
58 ok(false, `Failed to import ${file}`);