Bug 1698158 - part 3.2 - Remove unnecessary imports from testharness addons experimental API. r=mixedpuppy
authorLuca Greco <lgreco@mozilla.com>
Tue, 16 Mar 2021 18:15:41 +0000
changeset 571460 8a98d844e248731c157be30df87ad240ae41967e
parent 571459 05ef06f4180d9f03928776979c5061d16bfa8059
child 571461 f65a4978d75e02fcbf35c4cf9b7d55385b5483be
push id38293
push usermalexandru@mozilla.com
push dateWed, 17 Mar 2021 09:53:31 +0000
treeherdermozilla-central@9ad67cd4d216 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy
bugs1698158
milestone88.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1698158 - part 3.2 - Remove unnecessary imports from testharness addons experimental API. r=mixedpuppy Differential Revision: https://phabricator.services.mozilla.com/D108229
browser/tools/mozscreenshots/mozscreenshots/extension/api.js
layout/tools/reftest/api.js
mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/test-api.js
testing/mochitest/api.js
testing/specialpowers/api.js
tools/quitter/parent.js
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/api.js
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/api.js
@@ -1,21 +1,16 @@
 /* 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";
 
 /* globals ExtensionAPI */
 
-const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const { XPCOMUtils } = ChromeUtils.import(
-  "resource://gre/modules/XPCOMUtils.jsm"
-);
-
 XPCOMUtils.defineLazyServiceGetter(
   this,
   "resProto",
   "@mozilla.org/network/protocol;1?name=resource",
   "nsISubstitutingProtocolHandler"
 );
 
 this.mozscreenshots = class extends ExtensionAPI {
--- a/layout/tools/reftest/api.js
+++ b/layout/tools/reftest/api.js
@@ -1,18 +1,14 @@
 /* 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/. */
 
 const Cm = Components.manager;
 
-const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const { XPCOMUtils } = ChromeUtils.import(
-  "resource://gre/modules/XPCOMUtils.jsm"
-);
 var OnRefTestLoad, OnRefTestUnload;
 
 XPCOMUtils.defineLazyServiceGetter(
   this,
   "resProto",
   "@mozilla.org/network/protocol;1?name=resource",
   "nsISubstitutingProtocolHandler"
 );
--- a/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/test-api.js
+++ b/mobile/android/geckoview/src/androidTest/assets/web_extensions/test-support/test-api.js
@@ -1,21 +1,22 @@
 /* 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";
 
+/* globals Services */
+
 const { E10SUtils } = ChromeUtils.import(
   "resource://gre/modules/E10SUtils.jsm"
 );
 const { Preferences } = ChromeUtils.import(
   "resource://gre/modules/Preferences.jsm"
 );
-const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function linkColorFrameScript() {
   addMessageListener("HistoryDelegateTest:GetLinkColor", function onMessage(
     message
   ) {
     const { selector, uri } = message.data;
 
     if (content.document.documentURI != uri) {
--- a/testing/mochitest/api.js
+++ b/testing/mochitest/api.js
@@ -1,18 +1,13 @@
 /* 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/. */
 
-/* globals ExtensionAPI */
-
-const { AppConstants } = ChromeUtils.import(
-  "resource://gre/modules/AppConstants.jsm"
-);
-const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+/* globals AppConstants, ExtensionAPI, Services */
 
 function loadChromeScripts(win) {
   Services.scriptloader.loadSubScript(
     "chrome://mochikit/content/chrome-harness.js",
     win
   );
   Services.scriptloader.loadSubScript(
     "chrome://mochikit/content/mochitest-e10s-utils.js",
--- a/testing/specialpowers/api.js
+++ b/testing/specialpowers/api.js
@@ -1,18 +1,14 @@
 /* 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/. */
 
-/* globals ExtensionAPI */
+/* globals ExtensionAPI, Services, XPCOMUtils */
 
-const { XPCOMUtils } = ChromeUtils.import(
-  "resource://gre/modules/XPCOMUtils.jsm"
-);
-const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const { FileUtils } = ChromeUtils.import(
   "resource://gre/modules/FileUtils.jsm"
 );
 
 XPCOMUtils.defineLazyServiceGetter(
   this,
   "resProto",
   "@mozilla.org/network/protocol;1?name=resource",
--- a/tools/quitter/parent.js
+++ b/tools/quitter/parent.js
@@ -1,17 +1,15 @@
 /* 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";
 
-/* globals ExtensionAPI */
-
-const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+/* globals ExtensionAPI, Services */
 
 this.quitter = class extends ExtensionAPI {
   getAPI(context) {
     return {
       quitter: {
         async quit() {
           let browserWindow = Services.wm.getMostRecentWindow(
             "navigator:browser"