зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1415483 - Apply the new options to reject-importGlobalProperties across the codebase, remove unnecessary importGlobalProperties. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D13754 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
4d543888a6
Коммит
1abdc8687f
|
@ -50,24 +50,6 @@ const nsIDOMWindow = Ci.nsIDOMWindow;
|
|||
|
||||
const nsIPropertyElement = Ci.nsIPropertyElement;
|
||||
|
||||
// Testing "'Node' in this" doesn't do the right thing because there are cases
|
||||
// when our "this" is not the global even though we're at toplevel. In those
|
||||
// cases, the import could fail because our global is a Window and we in fact
|
||||
// have a Node all along.
|
||||
//
|
||||
// We could get the global via the (function() { return this; })() trick, but
|
||||
// that might break any time if people switch us to strict mode. So let's just
|
||||
// test the thing we care about directly: does bareword Node exist?
|
||||
let needToImportNode = false;
|
||||
try {
|
||||
Node;
|
||||
} catch (e) {
|
||||
needToImportNode = true;
|
||||
}
|
||||
if (needToImportNode) {
|
||||
Cu.importGlobalProperties(["Node"]);
|
||||
}
|
||||
|
||||
// //////////////////////////////////////////////////////////////////////////////
|
||||
// OS detect
|
||||
|
||||
|
|
|
@ -92,7 +92,6 @@ add_task(async function test_displayURI_camera() {
|
|||
|
||||
add_task(async function test_displayURI_geo_blob() {
|
||||
await check(async function() {
|
||||
Cu.importGlobalProperties(["Blob"]);
|
||||
let text = "<script>navigator.geolocation.getCurrentPosition(() => {})</script>";
|
||||
let blob = new Blob([text], {type: "text/html"});
|
||||
let url = content.URL.createObjectURL(blob);
|
||||
|
@ -102,11 +101,9 @@ add_task(async function test_displayURI_geo_blob() {
|
|||
|
||||
add_task(async function test_displayURI_camera_blob() {
|
||||
await check(async function() {
|
||||
Cu.importGlobalProperties(["Blob"]);
|
||||
let text = "<script>navigator.mediaDevices.getUserMedia({video: true, fake: true})</script>";
|
||||
let blob = new Blob([text], {type: "text/html"});
|
||||
let url = content.URL.createObjectURL(blob);
|
||||
content.location.href = url;
|
||||
}, {skipOnExtension: true});
|
||||
});
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ add_task(async function() {
|
|||
"https://example.com") + "dummy_page.html";
|
||||
await BrowserTestUtils.withNewTab(uri, async (browser) => {
|
||||
await ContentTask.spawn(browser, null, async () => {
|
||||
Cu.importGlobalProperties(["Blob", "URL"]);
|
||||
let debug = {hello: "world"};
|
||||
let blob = new Blob([JSON.stringify(debug, null, 2)], {type: "application/json"});
|
||||
let blobUri = URL.createObjectURL(blob);
|
||||
|
|
|
@ -27,8 +27,6 @@ const {PlacesUtils} =
|
|||
const {LiveBookmarkMigrator} =
|
||||
ChromeUtils.import("resource:///modules/LiveBookmarkMigrator.jsm", {});
|
||||
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
|
||||
const kTestData = {
|
||||
guid: PlacesUtils.bookmarks.toolbarGuid,
|
||||
children: [
|
||||
|
@ -164,4 +162,3 @@ add_task(async function check_replace_bookmarks_correctly() {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* eslint-env mozilla/frame-script */
|
||||
// eslint-disable-next-line mozilla/reject-importGlobalProperties
|
||||
Cu.importGlobalProperties(["File", "Directory"]);
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var tmpFile, tmpDir;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* eslint-env mozilla/frame-script */
|
||||
// eslint-disable-next-line mozilla/reject-importGlobalProperties
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
function createProfDFile() {
|
||||
|
|
|
@ -25,8 +25,6 @@ function childFrameScript() {
|
|||
const blobText = blobData.join("");
|
||||
const blobType = "text/plain";
|
||||
|
||||
Cu.importGlobalProperties(["indexedDB", "Blob"]);
|
||||
|
||||
function info(msg) {
|
||||
sendAsyncMessage(mmName, { op: "info", msg });
|
||||
}
|
||||
|
|
|
@ -10,8 +10,6 @@ var { "classes": Cc, "interfaces": Ci, "utils": Cu } = Components;
|
|||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
Cu.importGlobalProperties(["Blob"]);
|
||||
|
||||
if (!("self" in this)) {
|
||||
this.self = this;
|
||||
}
|
||||
|
@ -49,7 +47,7 @@ if (!this.runTest) {
|
|||
enableExperimental();
|
||||
}
|
||||
|
||||
Cu.importGlobalProperties(["indexedDB", "Blob", "File", "FileReader"]);
|
||||
Cu.importGlobalProperties(["indexedDB"]);
|
||||
|
||||
do_test_pending();
|
||||
testGenerator.next();
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/SimpleServiceDiscovery.jsm");
|
||||
|
||||
Cu.importGlobalProperties(["InspectorUtils"]);
|
||||
|
||||
// The chrome window
|
||||
var chromeWin;
|
||||
|
||||
|
|
|
@ -16,8 +16,6 @@ XPCOMUtils.defineLazyGetter(this, "BASE_URL", function() {
|
|||
return "http://localhost:" + srv.identity.primaryPort + "/";
|
||||
});
|
||||
|
||||
Cu.importGlobalProperties(["DOMParser"]);
|
||||
|
||||
function run_test() {
|
||||
createTestDirectory();
|
||||
|
||||
|
|
|
@ -126,8 +126,6 @@ add_task(async function() {
|
|||
|
||||
// Get a list of fonts being used to display the web content.
|
||||
let fontList = await ContentTask.spawn(aBrowser, {}, async function() {
|
||||
Cu.importGlobalProperties(["InspectorUtils"]);
|
||||
|
||||
let window = content.window.wrappedJSObject;
|
||||
let range = window.document.createRange();
|
||||
let contentDiv = window.document.getElementById("content");
|
||||
|
|
|
@ -21,8 +21,6 @@ var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm", {});
|
|||
var { FileUtils } = ChromeUtils.import("resource://gre/modules/FileUtils.jsm", {});
|
||||
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm", {});
|
||||
|
||||
Cu.importGlobalProperties(["XMLHttpRequest"]);
|
||||
|
||||
var gCertDB = Cc["@mozilla.org/security/x509certdb;1"]
|
||||
.getService(Ci.nsIX509CertDB);
|
||||
|
||||
|
|
|
@ -20,8 +20,6 @@ ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|||
ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
Cu.importGlobalProperties(["XMLHttpRequest"]);
|
||||
|
||||
const SOURCE = "https://chromium.googlesource.com/chromium/src/net/+/master/http/transport_security_state_static.json?format=TEXT";
|
||||
const TOOL_SOURCE = "https://hg.mozilla.org/mozilla-central/file/tip/taskcluster/docker/periodic-updates/scripts/getHSTSPreloadList.js";
|
||||
const OUTPUT = "nsSTSPreloadList.inc";
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
* 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/. */
|
||||
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
|
||||
ChromeUtils.import("chrome://marionette/content/navigate.js");
|
||||
|
||||
add_test(function test_isLoadEventExpected() {
|
||||
|
|
|
@ -17,8 +17,6 @@ function loadChromeScripts(win) {
|
|||
|
||||
// ///// Android ///////
|
||||
|
||||
Cu.importGlobalProperties(["TextDecoder"]);
|
||||
|
||||
const windowTracker = {
|
||||
init() {
|
||||
Services.obs.addObserver(this, "chrome-document-global-created");
|
||||
|
|
|
@ -25,8 +25,6 @@ var EXPORTED_SYMBOLS = [
|
|||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Timer.jsm");
|
||||
|
||||
Cu.importGlobalProperties(["Element"]);
|
||||
|
||||
var TestUtils = {
|
||||
executeSoon(callbackFn) {
|
||||
Services.tm.dispatchToMainThread(callbackFn);
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
var EXPORTED_SYMBOLS = ["SpecialPowersObserver"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
|
||||
const CHILD_SCRIPT_API = "resource://specialpowers/specialpowersFrameScript.js";
|
||||
const CHILD_LOGGER_SCRIPT = "resource://specialpowers/MozillaLogger.js";
|
||||
|
|
|
@ -37,14 +37,6 @@ ChromeUtils.defineModuleGetter(this, "ServiceWorkerCleanUp",
|
|||
ChromeUtils.defineModuleGetter(this, "PerTestCoverageUtils",
|
||||
"resource://testing-common/PerTestCoverageUtils.jsm");
|
||||
|
||||
try {
|
||||
Cu.importGlobalProperties(["DOMParser", "File", "InspectorUtils",
|
||||
"NodeFilter", "PromiseDebugging"]);
|
||||
} catch (e) {
|
||||
// We are in window scope hence DOMParser, File, InspectorUtils, NodeFilter,
|
||||
// and PromiseDebugging are already defined, So do nothing.
|
||||
}
|
||||
|
||||
// Allow stuff from this scope to be accessed from non-privileged scopes. This
|
||||
// would crash if used outside of automation.
|
||||
Cu.forcePermissiveCOWs();
|
||||
|
@ -517,7 +509,6 @@ SpecialPowersAPI.prototype = {
|
|||
var mc = new window.MessageChannel();
|
||||
sb.port = mc.port1;
|
||||
try {
|
||||
Cu.importGlobalProperties(["URL", "Blob"]);
|
||||
let blob = new Blob([str], {type: "application/javascript"});
|
||||
let blobUrl = URL.createObjectURL(blob);
|
||||
Services.scriptloader.loadSubScript(blobUrl, sb);
|
||||
|
|
|
@ -58,7 +58,6 @@ this.sessionrestore = class extends ExtensionAPI {
|
|||
// Because we're running this part of the test in the parent process, we
|
||||
// pull those arguments from the top window directly. This is mainly so
|
||||
// that TalosParentProfiler knows where to save the profile.
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
let url = new URL(args.queryElementAt(0, Ci.nsISupportsString).data);
|
||||
this.TalosParentProfiler.initFromURLQueryParams(url.search);
|
||||
}
|
||||
|
|
|
@ -16,8 +16,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "resProto",
|
|||
"@mozilla.org/network/protocol;1?name=resource",
|
||||
"nsISubstitutingProtocolHandler");
|
||||
|
||||
Cu.importGlobalProperties(["TextEncoder"]);
|
||||
|
||||
const Cm = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
|
||||
|
||||
let frameScriptURL;
|
||||
|
|
|
@ -46,8 +46,6 @@ let _NetUtil = ChromeUtils.import("resource://gre/modules/NetUtil.jsm", null).Ne
|
|||
|
||||
let _XPCOMUtils = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", null).XPCOMUtils;
|
||||
|
||||
Cu.importGlobalProperties(["XMLHttpRequest"]);
|
||||
|
||||
// Support a common assertion library, Assert.jsm.
|
||||
var AssertCls = ChromeUtils.import("resource://testing-common/Assert.jsm", null).Assert;
|
||||
// Pass a custom report function for xpcshell-test style reporting.
|
||||
|
|
|
@ -7,6 +7,7 @@ var USERSCRIPT_DISABLED_ERRORMSG = `userScripts APIs are currently experimental
|
|||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(this, "userScriptsEnabled", USERSCRIPT_PREFNAME, false);
|
||||
|
||||
// eslint-disable-next-line mozilla/reject-importGlobalProperties
|
||||
Cu.importGlobalProperties(["crypto", "TextEncoder"]);
|
||||
|
||||
var {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
var EXPORTED_SYMBOLS = ["webrequest_test"];
|
||||
|
||||
Cu.importGlobalProperties(["fetch", "XMLHttpRequest"]);
|
||||
Cu.importGlobalProperties(["fetch"]);
|
||||
|
||||
var webrequest_test = {
|
||||
testFetch(url) {
|
||||
|
|
|
@ -13,8 +13,6 @@ const {escaped} = ChromeUtils.import("resource://testing-common/AddonTestUtils.j
|
|||
|
||||
const env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
|
||||
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
|
||||
// Make sure media pre-loading is enabled on Android so that our <audio> and
|
||||
// <video> elements trigger the expected requests.
|
||||
Services.prefs.setIntPref("media.autoplay.default", Ci.nsIAutoplay.ALLOWED);
|
||||
|
|
|
@ -8,8 +8,6 @@ server.registerDirectory("/data/", do_get_file("data"));
|
|||
|
||||
const BASE_URL = `http://localhost:${server.identity.primaryPort}/data`;
|
||||
|
||||
Cu.importGlobalProperties(["XMLHttpRequest"]);
|
||||
|
||||
const {
|
||||
createAppInfo,
|
||||
promiseShutdownManager,
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
PromiseTestUtils.whitelistRejectionsGlobally(/Message manager disconnected/);
|
||||
|
||||
Cu.importGlobalProperties(["Blob", "URL"]);
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm");
|
||||
const {ExtensionAPI} = ExtensionCommon;
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
Cu.importGlobalProperties(["XMLHttpRequest"]);
|
||||
|
||||
const proxy = createHttpServer();
|
||||
|
||||
// accept proxy connections for mozilla.org
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
Cu.importGlobalProperties(["XMLHttpRequest"]);
|
||||
|
||||
const proxy = createHttpServer();
|
||||
|
||||
// accept proxy connections for mozilla.org
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// Tests whether we can redirect to a moz-extension: url.
|
||||
ChromeUtils.defineModuleGetter(this, "TestUtils",
|
||||
"resource://testing-common/TestUtils.jsm");
|
||||
Cu.importGlobalProperties(["XMLHttpRequest"]);
|
||||
|
||||
PromiseTestUtils.whitelistRejectionsGlobally(/Message manager disconnected/);
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm");
|
||||
const {ExtensionAPI} = ExtensionCommon;
|
||||
|
||||
Cu.importGlobalProperties(["Blob", "URL"]);
|
||||
|
||||
add_task(async function() {
|
||||
const schema = [
|
||||
{
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm");
|
||||
const {ExtensionAPI} = ExtensionCommon;
|
||||
|
||||
Cu.importGlobalProperties(["Blob", "URL"]);
|
||||
|
||||
AddonTestUtils.init(this);
|
||||
AddonTestUtils.overrideCertDB();
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
|
||||
const HOSTS = new Set([
|
||||
"example.com",
|
||||
]);
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
// Boilerplate used to be able to import this module both from the main
|
||||
// thread and from worker threads.
|
||||
if (typeof Components != "undefined") {
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
// Global definition of |exports|, to keep everybody happy.
|
||||
// In non-main thread, |exports| is provided by the module
|
||||
// loader.
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
// Boilerplate used to be able to import this module both from the main
|
||||
// thread and from worker threads.
|
||||
if (typeof Components != "undefined") {
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
// Global definition of |exports|, to keep everybody happy.
|
||||
// In non-main thread, |exports| is provided by the module
|
||||
// loader.
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
|
||||
add_task(async function test_getFieldOverrides() {
|
||||
let recipes = new Set([
|
||||
{ // path doesn't match but otherwise good
|
||||
|
|
|
@ -4,8 +4,6 @@ var EXPORTED_SYMBOLS = [
|
|||
"PlacesTestUtils",
|
||||
];
|
||||
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "PlacesUtils",
|
||||
"resource://gre/modules/PlacesUtils.jsm");
|
||||
|
|
|
@ -18,8 +18,6 @@ const TRANSITION_RELOAD = Ci.nsINavHistoryService.TRANSITION_RELOAD;
|
|||
|
||||
const TITLE_LENGTH_MAX = 4096;
|
||||
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
FileUtils: "resource://gre/modules/FileUtils.jsm",
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
|
||||
|
||||
// Test removing a single page
|
||||
add_task(async function test_remove_single() {
|
||||
await PlacesUtils.history.clear();
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/PromiseUtils.jsm", this);
|
||||
|
||||
add_task(async function test_removeVisitsByFilter() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Cu.importGlobalProperties(["URL", "crypto"]);
|
||||
Cu.importGlobalProperties(["crypto"]);
|
||||
|
||||
const { TYPE_BOOKMARK, TYPE_FOLDER } = Ci.nsINavBookmarksService;
|
||||
const { EXPIRE_NEVER, TYPE_INT32 } = Ci.nsIAnnotationService;
|
||||
|
|
|
@ -3,7 +3,6 @@ ChromeUtils.import("resource://gre/modules/PlacesSyncUtils.jsm");
|
|||
ChromeUtils.import("resource://testing-common/httpd.js");
|
||||
ChromeUtils.defineModuleGetter(this, "Preferences",
|
||||
"resource://gre/modules/Preferences.jsm");
|
||||
Cu.importGlobalProperties(["URLSearchParams"]);
|
||||
|
||||
const SYNC_PARENT_ANNO = "sync/parent";
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ const annosvc = PlacesUtils.annotations;
|
|||
const PT = PlacesTransactions;
|
||||
const menuGuid = PlacesUtils.bookmarks.menuGuid;
|
||||
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
ChromeUtils.defineModuleGetter(this, "Preferences",
|
||||
"resource://gre/modules/Preferences.jsm");
|
||||
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
const DESCRIPTION_ANNO = "bookmarkProperties/description";
|
||||
|
||||
Cu.importGlobalProperties(["XMLHttpRequest"]);
|
||||
|
||||
add_task(async function() {
|
||||
// Removes bookmarks.html if the file already exists.
|
||||
let HTMLFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.html");
|
||||
|
|
|
@ -24,7 +24,6 @@ var EXPORTED_SYMBOLS = [ "console", "ConsoleAPI" ];
|
|||
|
||||
ChromeUtils.defineModuleGetter(this, "Services",
|
||||
"resource://gre/modules/Services.jsm");
|
||||
Cu.importGlobalProperties(["Element"]);
|
||||
|
||||
var gTimerRegistry = new Map();
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
const EXPORTED_SYMBOLS = ["httpRequest", "percentEncode"];
|
||||
|
||||
Cu.importGlobalProperties(["XMLHttpRequest"]);
|
||||
|
||||
// Strictly follow RFC 3986 when encoding URI components.
|
||||
// Accepts a unescaped string and returns the URI encoded string for use in
|
||||
// an HTTP request.
|
||||
|
|
|
@ -8,7 +8,6 @@ var EXPORTED_SYMBOLS = ["NewTabUtils"];
|
|||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.importGlobalProperties(["btoa", "URL"]);
|
||||
|
||||
// Android tests don't import these properly, so guard against that
|
||||
let shortURL = {};
|
||||
|
|
|
@ -16,8 +16,6 @@ var EXPORTED_SYMBOLS = ["Subprocess"];
|
|||
|
||||
/* exported Subprocess */
|
||||
|
||||
Cu.importGlobalProperties(["TextEncoder"]);
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/subprocess/subprocess_common.jsm");
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
/* eslint-disable mozilla/balanced-listeners */
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
Cu.importGlobalProperties(["TextDecoder"]);
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "AsyncShutdown",
|
||||
"resource://gre/modules/AsyncShutdown.jsm");
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
/* eslint-disable mozilla/balanced-listeners */
|
||||
|
||||
Cu.importGlobalProperties(["TextDecoder"]);
|
||||
|
||||
var EXPORTED_SYMBOLS = ["SubprocessImpl"];
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/ctypes.jsm");
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
var EXPORTED_SYMBOLS = ["MockDocument"];
|
||||
|
||||
Cu.importGlobalProperties(["DOMParser", "URL"]);
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm", {});
|
||||
|
||||
const MockDocument = {
|
||||
|
|
|
@ -15,7 +15,6 @@ ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
|
|||
ChromeUtils.import("resource://testing-common/httpd.js");
|
||||
ChromeUtils.import("resource://gre/modules/Preferences.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/UpdateUtils.jsm");
|
||||
Cu.importGlobalProperties(["DOMParser"]);
|
||||
|
||||
var ProductAddonCheckerScope = ChromeUtils.import("resource://gre/modules/addons/ProductAddonChecker.jsm", {});
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ var EXPORTED_SYMBOLS = ["AddonTestUtils", "MockAsyncShutdown"];
|
|||
|
||||
const CERTDB_CONTRACTID = "@mozilla.org/security/x509certdb;1";
|
||||
|
||||
Cu.importGlobalProperties(["fetch", "TextEncoder"]);
|
||||
Cu.importGlobalProperties(["fetch"]);
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/AsyncShutdown.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
|
||||
|
|
|
@ -9,8 +9,6 @@ if (!_TEST_FILE[0].includes("toolkit/mozapps/extensions/test/xpcshell/")) {
|
|||
"the add-on manager component."));
|
||||
}
|
||||
|
||||
Cu.importGlobalProperties(["TextEncoder"]);
|
||||
|
||||
const PREF_EM_CHECK_UPDATE_SECURITY = "extensions.checkUpdateSecurity";
|
||||
const PREF_EM_STRICT_COMPATIBILITY = "extensions.strictCompatibility";
|
||||
const PREF_GETADDONS_BYIDS = "extensions.getAddons.get.url";
|
||||
|
|
|
@ -9,8 +9,6 @@ const PREF_APP_DISTRIBUTION = "distribution.id";
|
|||
const PREF_APP_DISTRIBUTION_VERSION = "distribution.version";
|
||||
const PREF_APP_UPDATE_CHANNEL = "app.update.channel";
|
||||
|
||||
Cu.importGlobalProperties(["URLSearchParams"]);
|
||||
|
||||
// Get the HTTP server.
|
||||
var testserver = AddonTestUtils.createHttpServer({hosts: ["example.com"]});
|
||||
|
||||
|
|
|
@ -13,8 +13,6 @@ Services.prefs.setBoolPref("lightweightThemes.update.enabled", true);
|
|||
|
||||
ChromeUtils.import("resource://gre/modules/LightweightThemeManager.jsm");
|
||||
|
||||
Cu.importGlobalProperties(["URLSearchParams"]);
|
||||
|
||||
var gInstallDate;
|
||||
|
||||
const updateFile = "test_update.json";
|
||||
|
@ -955,4 +953,3 @@ add_task(async function run_test_locked_install() {
|
|||
let installs = await AddonManager.getAllInstalls();
|
||||
equal(installs.length, 0);
|
||||
});
|
||||
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
// This verifies that add-on update check correctly fills in the
|
||||
// %COMPATIBILITY_MODE% token in the update URL.
|
||||
|
||||
Cu.importGlobalProperties(["URLSearchParams"]);
|
||||
|
||||
// The test extension uses an insecure update url.
|
||||
Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
|
||||
|
||||
|
|
|
@ -175,6 +175,7 @@ module.exports = {
|
|||
"mozilla/no-import-into-var-and-global": "error",
|
||||
"mozilla/no-useless-parameters": "error",
|
||||
"mozilla/no-useless-removeEventListener": "error",
|
||||
"mozilla/reject-importGlobalProperties": ["error", "allownonwebidl"],
|
||||
"mozilla/rejects-requires-await": "error",
|
||||
"mozilla/use-cc-etc": "error",
|
||||
"mozilla/use-chromeutils-generateqi": "error",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "eslint-plugin-mozilla",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "eslint-plugin-mozilla",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.",
|
||||
"keywords": [
|
||||
"eslint",
|
||||
|
|
Загрузка…
Ссылка в новой задаче