From c9b0aa74c1c1106273851c4340c56868045e886b Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Thu, 8 Sep 2022 14:40:07 +0000 Subject: [PATCH] Bug 1789254 - Migrate enterprisepolicies consumers to use ESM imports directly. r=mkaply,necko-reviewers,application-update-reviewers,nalexander Differential Revision: https://phabricator.services.mozilla.com/D156464 --- browser/base/content/browser.js | 2 +- browser/base/content/test/pageActions/head.js | 4 ++-- .../browser_protectionsUI_dfpi_rollout_phase2.js | 4 ++-- .../doh/test/browser/browser_policyOverride.js | 4 ++-- .../test/browser/browser_download_opens_policy.js | 4 ++-- .../test/browser/browser_ext_tabs_create_url.js | 7 +++++-- .../browser_unified_extensions_context_menu.js | 4 ++-- .../xpcshell/test_ASRouterTargeting_attribution.js | 4 ++-- .../tests/browser_connection_dnsoverhttps.js | 7 +++++-- .../preferences/tests/browser_moreFromMozilla.js | 4 ++-- .../tests/browser_moreFromMozilla_locales.js | 4 ++-- .../tests/browser_site_login_exceptions_policy.js | 4 ++-- .../browser/browser_quicksuggest_configuration.js | 4 ++-- netwerk/test/unit/test_trr_enterprise_policy.js | 4 ++-- .../tests/BackgroundTask_policies.jsm | 4 ++-- .../tests/xpcshell/test_backgroundtask_policies.js | 4 ++-- .../EnterprisePoliciesParent.sys.mjs | 2 +- .../tests/EnterprisePolicyTesting.sys.mjs | 8 ++++---- .../tests/browser/browser_policies_basic_tests.js | 4 ++-- .../browser/browser_policies_enterprise_only.js | 4 ++-- .../tests/browser/browser_policies_gpo.js | 12 ++++++------ .../test/xpcshell/test_ext_storage_managed_policy.js | 4 ++-- toolkit/modules/tests/xpcshell/test_BrowserUtils.js | 4 ++-- .../browser/browser_unknownContentType_policy.js | 4 ++-- .../test/browser/browser_webapi_install.js | 4 ++-- .../xpcshell/test_system_update_enterprisepolicy.js | 4 ++-- .../test_backgroundupdate_reason_update.js | 4 ++-- 27 files changed, 64 insertions(+), 58 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 99f7bb35f8e4..52a3cc0aa80e 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -27,6 +27,7 @@ ChromeUtils.defineESModuleGetters(this, { UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.sys.mjs", UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs", UrlbarValueFormatter: "resource:///modules/UrlbarValueFormatter.sys.mjs", + WebsiteFilter: "resource:///modules/policies/WebsiteFilter.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(this, { @@ -96,7 +97,6 @@ XPCOMUtils.defineLazyModuleGetters(this, { Weave: "resource://services-sync/main.js", WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.jsm", webrtcUI: "resource:///modules/webrtcUI.jsm", - WebsiteFilter: "resource:///modules/policies/WebsiteFilter.jsm", ZoomUI: "resource:///modules/ZoomUI.jsm", }); diff --git a/browser/base/content/test/pageActions/head.js b/browser/base/content/test/pageActions/head.js index 80c639562474..82160aecf5d4 100644 --- a/browser/base/content/test/pageActions/head.js +++ b/browser/base/content/test/pageActions/head.js @@ -2,12 +2,12 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ ChromeUtils.defineESModuleGetters(this, { + EnterprisePolicyTesting: + "resource://testing-common/EnterprisePolicyTesting.sys.mjs", PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(this, { - EnterprisePolicyTesting: - "resource://testing-common/EnterprisePolicyTesting.jsm", ExtensionCommon: "resource://gre/modules/ExtensionCommon.jsm", sinon: "resource://testing-common/Sinon.jsm", TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.jsm", diff --git a/browser/base/content/test/protectionsUI/browser_protectionsUI_dfpi_rollout_phase2.js b/browser/base/content/test/protectionsUI/browser_protectionsUI_dfpi_rollout_phase2.js index 8d20e0d3bac8..830cf04ca939 100644 --- a/browser/base/content/test/protectionsUI/browser_protectionsUI_dfpi_rollout_phase2.js +++ b/browser/base/content/test/protectionsUI/browser_protectionsUI_dfpi_rollout_phase2.js @@ -9,8 +9,8 @@ const { ExperimentFakes } = ChromeUtils.import( "resource://testing-common/NimbusTestUtils.jsm" ); -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); ChromeUtils.defineModuleGetter( diff --git a/browser/components/doh/test/browser/browser_policyOverride.js b/browser/components/doh/test/browser/browser_policyOverride.js index e93c4632b903..25fd2c037ebe 100644 --- a/browser/components/doh/test/browser/browser_policyOverride.js +++ b/browser/components/doh/test/browser/browser_policyOverride.js @@ -6,8 +6,8 @@ add_task(setup); -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); add_task(async function testPolicyOverride() { diff --git a/browser/components/downloads/test/browser/browser_download_opens_policy.js b/browser/components/downloads/test/browser/browser_download_opens_policy.js index 649575e721be..69d5c71ef5dd 100644 --- a/browser/components/downloads/test/browser/browser_download_opens_policy.js +++ b/browser/components/downloads/test/browser/browser_download_opens_policy.js @@ -3,8 +3,8 @@ "use strict"; -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); ChromeUtils.defineModuleGetter( diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_create_url.js b/browser/components/extensions/test/browser/browser_ext_tabs_create_url.js index c7de614d2cfd..c001418cffad 100644 --- a/browser/components/extensions/test/browser/browser_ext_tabs_create_url.js +++ b/browser/components/extensions/test/browser/browser_ext_tabs_create_url.js @@ -3,8 +3,11 @@ "use strict"; async function runWithDisabledPrivateBrowsing(callback) { - const { EnterprisePolicyTesting, PoliciesPrefTracker } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" + const { + EnterprisePolicyTesting, + PoliciesPrefTracker, + } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); PoliciesPrefTracker.start(); diff --git a/browser/components/extensions/test/browser/browser_unified_extensions_context_menu.js b/browser/components/extensions/test/browser/browser_unified_extensions_context_menu.js index a7b7f78cd868..cb9ad85caba7 100644 --- a/browser/components/extensions/test/browser/browser_unified_extensions_context_menu.js +++ b/browser/components/extensions/test/browser/browser_unified_extensions_context_menu.js @@ -11,8 +11,8 @@ ChromeUtils.defineModuleGetter( "resource://gre/modules/AbuseReporter.jsm" ); -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); const { TelemetryTestUtils } = ChromeUtils.import( "resource://testing-common/TelemetryTestUtils.jsm" diff --git a/browser/components/newtab/test/xpcshell/test_ASRouterTargeting_attribution.js b/browser/components/newtab/test/xpcshell/test_ASRouterTargeting_attribution.js index dba95a550b21..201366c05ad2 100644 --- a/browser/components/newtab/test/xpcshell/test_ASRouterTargeting_attribution.js +++ b/browser/components/newtab/test/xpcshell/test_ASRouterTargeting_attribution.js @@ -13,8 +13,8 @@ const { ASRouterTargeting } = ChromeUtils.import( const { MacAttribution } = ChromeUtils.import( "resource:///modules/MacAttribution.jsm" ); -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); add_task(async function check_attribution_data() { diff --git a/browser/components/preferences/tests/browser_connection_dnsoverhttps.js b/browser/components/preferences/tests/browser_connection_dnsoverhttps.js index 75eb2cbe7bcf..71d7814fd8b7 100644 --- a/browser/components/preferences/tests/browser_connection_dnsoverhttps.js +++ b/browser/components/preferences/tests/browser_connection_dnsoverhttps.js @@ -5,8 +5,11 @@ requestLongerTimeout(4); -const { EnterprisePolicyTesting, PoliciesPrefTracker } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { + EnterprisePolicyTesting, + PoliciesPrefTracker, +} = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); ChromeUtils.defineModuleGetter( diff --git a/browser/components/preferences/tests/browser_moreFromMozilla.js b/browser/components/preferences/tests/browser_moreFromMozilla.js index 26c4f5318e6c..a91609b39210 100644 --- a/browser/components/preferences/tests/browser_moreFromMozilla.js +++ b/browser/components/preferences/tests/browser_moreFromMozilla.js @@ -3,8 +3,8 @@ "use strict"; -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); let { TelemetryTestUtils } = ChromeUtils.import( diff --git a/browser/components/preferences/tests/browser_moreFromMozilla_locales.js b/browser/components/preferences/tests/browser_moreFromMozilla_locales.js index 1f1106613700..00d05125ad7d 100644 --- a/browser/components/preferences/tests/browser_moreFromMozilla_locales.js +++ b/browser/components/preferences/tests/browser_moreFromMozilla_locales.js @@ -3,8 +3,8 @@ "use strict"; -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); let { Region } = ChromeUtils.import("resource://gre/modules/Region.jsm"); diff --git a/browser/components/preferences/tests/browser_site_login_exceptions_policy.js b/browser/components/preferences/tests/browser_site_login_exceptions_policy.js index 499fd28222a0..4d95992bf524 100644 --- a/browser/components/preferences/tests/browser_site_login_exceptions_policy.js +++ b/browser/components/preferences/tests/browser_site_login_exceptions_policy.js @@ -3,8 +3,8 @@ "use strict"; -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); const PERMISSIONS_URL = diff --git a/browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_configuration.js b/browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_configuration.js index a2d74dc7ec2a..50788852c12e 100644 --- a/browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_configuration.js +++ b/browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_configuration.js @@ -8,12 +8,12 @@ */ ChromeUtils.defineESModuleGetters(this, { + EnterprisePolicyTesting: + "resource://testing-common/EnterprisePolicyTesting.sys.mjs", UrlbarQuickSuggest: "resource:///modules/UrlbarQuickSuggest.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(this, { - EnterprisePolicyTesting: - "resource://testing-common/EnterprisePolicyTesting.jsm", sinon: "resource://testing-common/Sinon.jsm", }); diff --git a/netwerk/test/unit/test_trr_enterprise_policy.js b/netwerk/test/unit/test_trr_enterprise_policy.js index 352216af6cc2..d7562991da62 100644 --- a/netwerk/test/unit/test_trr_enterprise_policy.js +++ b/netwerk/test/unit/test_trr_enterprise_policy.js @@ -24,8 +24,8 @@ updateAppInfo({ platformVersion: "48", }); -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); // This initializes the policy engine for xpcshell tests diff --git a/toolkit/components/backgroundtasks/tests/BackgroundTask_policies.jsm b/toolkit/components/backgroundtasks/tests/BackgroundTask_policies.jsm index 50261549766d..1fdb890d3b25 100644 --- a/toolkit/components/backgroundtasks/tests/BackgroundTask_policies.jsm +++ b/toolkit/components/backgroundtasks/tests/BackgroundTask_policies.jsm @@ -8,8 +8,8 @@ var EXPORTED_SYMBOLS = ["runBackgroundTask"]; const { Checker } = ChromeUtils.import( "resource://gre/modules/UpdateService.jsm" ); -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); async function runBackgroundTask(commandLine) { diff --git a/toolkit/components/backgroundtasks/tests/xpcshell/test_backgroundtask_policies.js b/toolkit/components/backgroundtasks/tests/xpcshell/test_backgroundtask_policies.js index bf4f6199e347..7bbfa3509195 100644 --- a/toolkit/components/backgroundtasks/tests/xpcshell/test_backgroundtask_policies.js +++ b/toolkit/components/backgroundtasks/tests/xpcshell/test_backgroundtask_policies.js @@ -18,8 +18,8 @@ updateAppInfo({ platformVersion: "48", }); -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); // This initializes the policy engine for xpcshell tests diff --git a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs index 13a5366f1cbc..ed2e89ab3ef7 100644 --- a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs +++ b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs @@ -11,13 +11,13 @@ const { AppConstants } = ChromeUtils.import( const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { + Policies: "resource:///modules/policies/Policies.sys.mjs", WindowsGPOParser: "resource://gre/modules/policies/WindowsGPOParser.sys.mjs", macOSPoliciesParser: "resource://gre/modules/policies/macOSPoliciesParser.sys.mjs", }); XPCOMUtils.defineLazyModuleGetters(lazy, { - Policies: "resource:///modules/policies/Policies.jsm", JsonSchemaValidator: "resource://gre/modules/components-utils/JsonSchemaValidator.jsm", }); diff --git a/toolkit/components/enterprisepolicies/tests/EnterprisePolicyTesting.sys.mjs b/toolkit/components/enterprisepolicies/tests/EnterprisePolicyTesting.sys.mjs index 9565e497c99f..fea2de26918e 100644 --- a/toolkit/components/enterprisepolicies/tests/EnterprisePolicyTesting.sys.mjs +++ b/toolkit/components/enterprisepolicies/tests/EnterprisePolicyTesting.sys.mjs @@ -102,8 +102,8 @@ export var PoliciesPrefTracker = { _originalValues: new Map(), start() { - let { PoliciesUtils } = ChromeUtils.import( - "resource:///modules/policies/Policies.jsm" + let { PoliciesUtils } = ChromeUtils.importESModule( + "resource:///modules/policies/Policies.sys.mjs" ); this._originalFunc = PoliciesUtils.setDefaultPref; PoliciesUtils.setDefaultPref = this.hoistedSetDefaultPref.bind(this); @@ -112,8 +112,8 @@ export var PoliciesPrefTracker = { stop() { this.restoreDefaultValues(); - let { PoliciesUtils } = ChromeUtils.import( - "resource:///modules/policies/Policies.jsm" + let { PoliciesUtils } = ChromeUtils.importESModule( + "resource:///modules/policies/Policies.sys.mjs" ); PoliciesUtils.setDefaultPref = this._originalFunc; this._originalFunc = null; diff --git a/toolkit/components/enterprisepolicies/tests/browser/browser_policies_basic_tests.js b/toolkit/components/enterprisepolicies/tests/browser/browser_policies_basic_tests.js index 419c1039f3ed..5d57240d6979 100644 --- a/toolkit/components/enterprisepolicies/tests/browser/browser_policies_basic_tests.js +++ b/toolkit/components/enterprisepolicies/tests/browser/browser_policies_basic_tests.js @@ -4,8 +4,8 @@ "use strict"; add_task(async function test_simple_policies() { - let { Policies } = ChromeUtils.import( - "resource:///modules/policies/Policies.jsm" + let { Policies } = ChromeUtils.importESModule( + "resource:///modules/policies/Policies.sys.mjs" ); let policy0Ran = false, diff --git a/toolkit/components/enterprisepolicies/tests/browser/browser_policies_enterprise_only.js b/toolkit/components/enterprisepolicies/tests/browser/browser_policies_enterprise_only.js index 85bec8191f3f..3da3d250c60d 100644 --- a/toolkit/components/enterprisepolicies/tests/browser/browser_policies_enterprise_only.js +++ b/toolkit/components/enterprisepolicies/tests/browser/browser_policies_enterprise_only.js @@ -6,8 +6,8 @@ const PREF_DISALLOW_ENTERPRISE = "browser.policies.testing.disallowEnterprise"; add_task(async function test_enterprise_only_policies() { - let { Policies } = ChromeUtils.import( - "resource:///modules/policies/Policies.jsm" + let { Policies } = ChromeUtils.importESModule( + "resource:///modules/policies/Policies.sys.mjs" ); let normalPolicyRan = false, diff --git a/toolkit/components/enterprisepolicies/tests/browser/browser_policies_gpo.js b/toolkit/components/enterprisepolicies/tests/browser/browser_policies_gpo.js index 693c951486be..decf158d4505 100644 --- a/toolkit/components/enterprisepolicies/tests/browser/browser_policies_gpo.js +++ b/toolkit/components/enterprisepolicies/tests/browser/browser_policies_gpo.js @@ -12,8 +12,8 @@ add_task(async function setup_preferences() { }); add_task(async function test_gpo_policies() { - let { Policies } = ChromeUtils.import( - "resource:///modules/policies/Policies.jsm" + let { Policies } = ChromeUtils.importESModule( + "resource:///modules/policies/Policies.sys.mjs" ); let gpoPolicyRan = false; @@ -68,8 +68,8 @@ add_task(async function test_gpo_policies() { }); add_task(async function test_gpo_json_policies() { - let { Policies } = ChromeUtils.import( - "resource:///modules/policies/Policies.jsm" + let { Policies } = ChromeUtils.importESModule( + "resource:///modules/policies/Policies.sys.mjs" ); let gpoPolicyRan = false; @@ -154,8 +154,8 @@ add_task(async function test_gpo_json_policies() { }); add_task(async function test_gpo_broken_json_policies() { - let { Policies } = ChromeUtils.import( - "resource:///modules/policies/Policies.jsm" + let { Policies } = ChromeUtils.importESModule( + "resource:///modules/policies/Policies.sys.mjs" ); let gpoPolicyRan = false; diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_storage_managed_policy.js b/toolkit/components/extensions/test/xpcshell/test_ext_storage_managed_policy.js index d99956671d21..658cea56471b 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_storage_managed_policy.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_storage_managed_policy.js @@ -4,8 +4,8 @@ const PREF_DISABLE_SECURITY = "security.turn_off_all_security_so_that_" + "viruses_can_take_over_this_computer"; -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); // Setting PREF_DISABLE_SECURITY tells the policy engine that we are in testing diff --git a/toolkit/modules/tests/xpcshell/test_BrowserUtils.js b/toolkit/modules/tests/xpcshell/test_BrowserUtils.js index aa8da3b6e4c8..d58d341520c1 100644 --- a/toolkit/modules/tests/xpcshell/test_BrowserUtils.js +++ b/toolkit/modules/tests/xpcshell/test_BrowserUtils.js @@ -9,8 +9,8 @@ const { BrowserUtils } = ChromeUtils.import( "resource://gre/modules/BrowserUtils.jsm" ); -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); const { Region } = ChromeUtils.import("resource://gre/modules/Region.jsm"); diff --git a/toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_policy.js b/toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_policy.js index 34e13a6a3238..158a35956ec3 100644 --- a/toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_policy.js +++ b/toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_policy.js @@ -3,8 +3,8 @@ "use strict"; -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); const TEST_PATH = getRootDirectory(gTestPath).replace( diff --git a/toolkit/mozapps/extensions/test/browser/browser_webapi_install.js b/toolkit/mozapps/extensions/test/browser/browser_webapi_install.js index 6940676285e5..dcc725be4c90 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_webapi_install.js +++ b/toolkit/mozapps/extensions/test/browser/browser_webapi_install.js @@ -8,8 +8,8 @@ const { AddonTestUtils } = ChromeUtils.import( "resource://testing-common/AddonTestUtils.jsm" ); -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); const TESTPATH = "webapi_checkavailable.html"; diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_system_update_enterprisepolicy.js b/toolkit/mozapps/extensions/test/xpcshell/test_system_update_enterprisepolicy.js index a4ebf9afc317..1746628a41ff 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_system_update_enterprisepolicy.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_system_update_enterprisepolicy.js @@ -5,8 +5,8 @@ // This test verifies that system addon updates are correctly blocked by the // DisableSystemAddonUpdate enterprise policy. -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); // Setting PREF_DISABLE_SECURITY tells the policy engine that we are in testing diff --git a/toolkit/mozapps/update/tests/unit_background_update/test_backgroundupdate_reason_update.js b/toolkit/mozapps/update/tests/unit_background_update/test_backgroundupdate_reason_update.js index 33a4cb9200fc..81b708640183 100644 --- a/toolkit/mozapps/update/tests/unit_background_update/test_backgroundupdate_reason_update.js +++ b/toolkit/mozapps/update/tests/unit_background_update/test_backgroundupdate_reason_update.js @@ -11,8 +11,8 @@ const { BackgroundUpdate } = ChromeUtils.import( ); let reasons = () => BackgroundUpdate._reasonsToNotUpdateInstallation(); let REASON = BackgroundUpdate.REASON; -const { EnterprisePolicyTesting } = ChromeUtils.import( - "resource://testing-common/EnterprisePolicyTesting.jsm" +const { EnterprisePolicyTesting } = ChromeUtils.importESModule( + "resource://testing-common/EnterprisePolicyTesting.sys.mjs" ); const { UpdateService } = ChromeUtils.import( "resource://gre/modules/UpdateService.jsm"