diff --git a/testing/firefox-ui/tests/functional/safebrowsing/test_notification.py b/testing/firefox-ui/tests/functional/safebrowsing/test_notification.py index 7619f4b863a7..6c24ae5025ea 100644 --- a/testing/firefox-ui/tests/functional/safebrowsing/test_notification.py +++ b/testing/firefox-ui/tests/functional/safebrowsing/test_notification.py @@ -75,9 +75,6 @@ class TestSafeBrowsingNotificationBar(WindowManagerMixin, MarionetteTestCase): with self.marionette.using_context("chrome"): self.marionette.execute_script( """ - const { Services } = ChromeUtils.import( - "resource://gre/modules/Services.jsm" - ); let uri = Services.io.newURI(arguments[0], null, null); let principal = Services.scriptSecurityManager.createContentPrincipal(uri, {}); Services.perms.removeFromPrincipal(principal, arguments[1]); diff --git a/testing/firefox-ui/tests/functional/safebrowsing/test_warning_pages.py b/testing/firefox-ui/tests/functional/safebrowsing/test_warning_pages.py index a3f0f6359039..22893c26b162 100644 --- a/testing/firefox-ui/tests/functional/safebrowsing/test_warning_pages.py +++ b/testing/firefox-ui/tests/functional/safebrowsing/test_warning_pages.py @@ -78,9 +78,6 @@ class TestSafeBrowsingWarningPages(WindowManagerMixin, MarionetteTestCase): with self.marionette.using_context("chrome"): self.marionette.execute_script( """ - const { Services } = ChromeUtils.import( - "resource://gre/modules/Services.jsm" - ); let uri = Services.io.newURI(arguments[0], null, null); let principal = Services.scriptSecurityManager.createContentPrincipal(uri, {}); Services.perms.removeFromPrincipal(principal, arguments[1]); @@ -101,9 +98,6 @@ class TestSafeBrowsingWarningPages(WindowManagerMixin, MarionetteTestCase): with self.marionette.using_context("chrome"): url = self.marionette.execute_script( """ - const { Services } = ChromeUtils.import( - "resource://gre/modules/Services.jsm" - ); return Services.urlFormatter.formatURLPref("app.support.baseURL") + "phishing-malware"; """ diff --git a/testing/marionette/harness/marionette_harness/runner/mixins/window_manager.py b/testing/marionette/harness/marionette_harness/runner/mixins/window_manager.py index 7bfdfead7937..c3bb6e3e7a8d 100644 --- a/testing/marionette/harness/marionette_harness/runner/mixins/window_manager.py +++ b/testing/marionette/harness/marionette_harness/runner/mixins/window_manager.py @@ -96,9 +96,6 @@ class WindowManagerMixin(object): with self.marionette.using_context("chrome"): return self.marionette.execute_script( """ - const { Services } = ChromeUtils.import( - "resource://gre/modules/Services.jsm" - ); const { windowManager } = ChromeUtils.import( "chrome://remote/content/shared/WindowManager.jsm" ); diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_modal_dialogs.py b/testing/marionette/harness/marionette_harness/tests/unit/test_modal_dialogs.py index ccf58252937a..7cb6955abcfa 100644 --- a/testing/marionette/harness/marionette_harness/tests/unit/test_modal_dialogs.py +++ b/testing/marionette/harness/marionette_harness/tests/unit/test_modal_dialogs.py @@ -55,8 +55,6 @@ class TestModalDialogs(WindowManagerMixin, MarionetteTestCase): with self.marionette.using_context("chrome"): self.marionette.execute_script( """ - const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); - const [ modalType, browsingContextId, delay ] = arguments; const modalTypes = { diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py b/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py index 1d0377dc7fa4..7ccaf2b80308 100644 --- a/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py +++ b/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py @@ -85,9 +85,6 @@ class BaseNavigationTestCase(WindowManagerMixin, MarionetteTestCase): let win = null; if (AppConstants.MOZ_APP_NAME == "fennec") { - const { Services } = ChromeUtils.import( - "resource://gre/modules/Services.jsm" - ); win = Services.wm.getMostRecentWindow("navigator:browser"); } else { const { BrowserWindowTracker } = ChromeUtils.import( diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_quit_restart.py b/testing/marionette/harness/marionette_harness/tests/unit/test_quit_restart.py index 3a6b864b8a6f..d1221e4976d1 100644 --- a/testing/marionette/harness/marionette_harness/tests/unit/test_quit_restart.py +++ b/testing/marionette/harness/marionette_harness/tests/unit/test_quit_restart.py @@ -114,9 +114,6 @@ class TestQuitRestart(MarionetteTestCase): with self.marionette.using_context("chrome"): return self.marionette.execute_script( """ - const { Services } = ChromeUtils.import( - "resource://gre/modules/Services.jsm" - ); return Services.appinfo.inSafeMode; """ ) @@ -125,9 +122,6 @@ class TestQuitRestart(MarionetteTestCase): self.marionette.set_context("chrome") self.marionette.execute_script( """ - const { Services } = ChromeUtils.import( - "resource://gre/modules/Services.jsm" - ); let flags = Ci.nsIAppStartup.eAttemptQuit; if (arguments[0]) { flags |= Ci.nsIAppStartup.eRestart; diff --git a/testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_content.py b/testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_content.py index 5751ed9d71ea..311b06246e1c 100644 --- a/testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_content.py +++ b/testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_content.py @@ -49,9 +49,6 @@ class TestSwitchToWindowContent(WindowManagerMixin, MarionetteTestCase): let win = null; if (AppConstants.MOZ_APP_NAME == "fennec") { - const { Services } = ChromeUtils.import( - "resource://gre/modules/Services.jsm" - ); win = Services.wm.getMostRecentWindow("navigator:browser"); } else { const { BrowserWindowTracker } = ChromeUtils.import( diff --git a/testing/mozharness/scripts/android_emulator_pgo.py b/testing/mozharness/scripts/android_emulator_pgo.py index 38a9cfd658c3..b68aec772783 100644 --- a/testing/mozharness/scripts/android_emulator_pgo.py +++ b/testing/mozharness/scripts/android_emulator_pgo.py @@ -267,9 +267,6 @@ class AndroidProfileRun(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin): driver.set_context("chrome") driver.execute_script( """ - const { Services } = ChromeUtils.import( - "resource://gre/modules/Services.jsm" - ); let cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"] .createInstance(Components.interfaces.nsISupportsPRBool); Services.obs.notifyObservers(cancelQuit, "quit-application-requested", null); @@ -278,9 +275,6 @@ class AndroidProfileRun(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin): ) driver.execute_script( """ - const { Services } = ChromeUtils.import( - "resource://gre/modules/Services.jsm" - ); Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit) """ ) diff --git a/testing/xpcshell/selftest.py b/testing/xpcshell/selftest.py index d4daa7398606..47d69ace1914 100755 --- a/testing/xpcshell/selftest.py +++ b/testing/xpcshell/selftest.py @@ -28,7 +28,6 @@ SIMPLE_PASSING_TEST = "function run_test() { Assert.ok(true); }" SIMPLE_FAILING_TEST = "function run_test() { Assert.ok(false); }" SIMPLE_PREFCHECK_TEST = """ function run_test() { - const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); Assert.ok(Services.prefs.getBoolPref("fake.pref.to.test")); } """ diff --git a/toolkit/components/telemetry/tests/integration/tests/conftest.py b/toolkit/components/telemetry/tests/integration/tests/conftest.py index 3b1c2f6fdd79..8b02a8b3728a 100644 --- a/toolkit/components/telemetry/tests/integration/tests/conftest.py +++ b/toolkit/components/telemetry/tests/integration/tests/conftest.py @@ -110,9 +110,6 @@ class Browser(object): """ script = """\ - let { Services } = ChromeUtils.import( - "resource://gre/modules/Services.jsm" - ); Services.telemetry.setEventRecordingEnabled("navigation", true); """ diff --git a/toolkit/components/telemetry/tests/marionette/tests/client/test_fog_deletion_request_ping.py b/toolkit/components/telemetry/tests/marionette/tests/client/test_fog_deletion_request_ping.py index f956e857e1d8..133a04e31f18 100644 --- a/toolkit/components/telemetry/tests/marionette/tests/client/test_fog_deletion_request_ping.py +++ b/toolkit/components/telemetry/tests/marionette/tests/client/test_fog_deletion_request_ping.py @@ -38,7 +38,6 @@ class TestDeletionRequestPing(FOGTestCase): debug_tag = "my-test-tag" tagging_script = """\ - const {{ Services }} = ChromeUtils.import("resource://gre/modules/Services.jsm"); Services.fog.setTagPings("{}"); """.format( debug_tag diff --git a/toolkit/xre/test/marionette/test_exitcode.py b/toolkit/xre/test/marionette/test_exitcode.py index 32fd3d2bc01c..bf1c8a3d7c3f 100644 --- a/toolkit/xre/test/marionette/test_exitcode.py +++ b/toolkit/xre/test/marionette/test_exitcode.py @@ -8,7 +8,6 @@ class TestFissionAutostart(MarionetteTestCase): def call_quit(): self.marionette.execute_script( """ - const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit); """, sandbox="system", @@ -23,7 +22,6 @@ class TestFissionAutostart(MarionetteTestCase): def call_quit(): self.marionette.execute_script( """ - const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit, 5); """, sandbox="system", diff --git a/toolkit/xre/test/marionette/test_fission_autostart.py b/toolkit/xre/test/marionette/test_fission_autostart.py index a65af0e1d9ef..afbe33fdb5d6 100644 --- a/toolkit/xre/test/marionette/test_fission_autostart.py +++ b/toolkit/xre/test/marionette/test_fission_autostart.py @@ -133,8 +133,6 @@ class TestFissionAutostart(MarionetteTestCase): // We're running in a function, in a sandbox, that inherits from an // X-ray wrapped window. Anything we want to be globally available // needs to be defined on that window. - let { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); - window.Services = Services; window.env = Cc["@mozilla.org/process/environment;1"] .getService(Ci.nsIEnvironment); """ diff --git a/toolkit/xre/test/marionette/test_win32k_enrollment.py b/toolkit/xre/test/marionette/test_win32k_enrollment.py index c8ecace538b8..a2e5e7c16e92 100644 --- a/toolkit/xre/test/marionette/test_win32k_enrollment.py +++ b/toolkit/xre/test/marionette/test_win32k_enrollment.py @@ -141,8 +141,6 @@ class TestWin32kAutostart(MarionetteTestCase): // We're running in a function, in a sandbox, that inherits from an // X-ray wrapped window. Anything we want to be globally available // needs to be defined on that window. - let { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); - window.Services = Services; window.env = Cc["@mozilla.org/process/environment;1"] .getService(Ci.nsIEnvironment); """ diff --git a/toolkit/xre/test/marionette/test_win32k_enrollment.template.py b/toolkit/xre/test/marionette/test_win32k_enrollment.template.py index b9912407beb7..04cfebe4a4cf 100644 --- a/toolkit/xre/test/marionette/test_win32k_enrollment.template.py +++ b/toolkit/xre/test/marionette/test_win32k_enrollment.template.py @@ -141,8 +141,6 @@ class TestWin32kAutostart(MarionetteTestCase): // We're running in a function, in a sandbox, that inherits from an // X-ray wrapped window. Anything we want to be globally available // needs to be defined on that window. - let { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); - window.Services = Services; window.env = Cc["@mozilla.org/process/environment;1"] .getService(Ci.nsIEnvironment); """