Skip to content

Commit 5eb2171

Browse files
committed
Bug 1863204 - Correct ESLint scope for some privileged globals and remove importGlobalProperties from more places. r=Gijs,sessionstore-reviewers,dom-storage-reviewers,sclements,asuth
Differential Revision: https://phabricator.services.mozilla.com/D192806
1 parent 179d2c8 commit 5eb2171

File tree

31 files changed

+9
-56
lines changed

31 files changed

+9
-56
lines changed

browser/components/newtab/test/xpcshell/head.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
1212
JsonSchema: "resource://gre/modules/JsonSchema.sys.mjs",
1313
});
1414

15-
XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]);
16-
1715
function assertValidates(validator, obj, msg) {
1816
const result = validator.validate(obj);
1917
Assert.ok(

browser/components/sessionstore/test/unit/test_final_write_cleanup.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ const {
2222
const MAX_ENTRIES = 9;
2323
const URL = "http://example.com/#";
2424

25-
Cu.importGlobalProperties(["structuredClone"]);
26-
2725
async function prepareWithLimit(back, fwd) {
2826
SessionWriter.init("empty", false, Paths, {
2927
maxSerializeBack: back,

dom/cache/test/xpcshell/head.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ add_setup(function () {
4747

4848
enableTesting();
4949

50-
// Expose Cache and Fetch symbols on the global
51-
Cu.importGlobalProperties(["caches", "fetch"]);
50+
Cu.importGlobalProperties(["caches"]);
5251

5352
registerCleanupFunction(resetTesting);
5453
});

dom/indexedDB/test/test_message_manager_ipc.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
const blobText = blobData.join("");
2727
const blobType = "text/plain";
2828

29-
Cu.importGlobalProperties(["indexedDB"]);
30-
3129
function info(msg) {
3230
sendAsyncMessage(mmName, { op: "info", msg });
3331
}

dom/indexedDB/test/unit/GlobalObjectsChild.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ function finishTest() {
1919
function run_test() {
2020
const name = "Splendid Test";
2121

22-
Cu.importGlobalProperties(["indexedDB"]);
23-
2422
do_test_pending();
2523

2624
let keyRange = IDBKeyRange.only(42);

dom/indexedDB/test/unit/test_sandbox.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ function run_test() {
7777
sb
7878
);
7979

80-
Cu.importGlobalProperties(["indexedDB"]);
8180
do_test_pending();
8281
Promise.all([innerPromise, exerciseInterface()]).then(do_test_finished);
8382
}

dom/indexedDB/test/unit/xpcshell-head-parent-process.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ if (!this.runTest) {
4646
enableExperimental();
4747
}
4848

49-
Cu.importGlobalProperties(["indexedDB"]);
50-
5149
// In order to support converting tests to using async functions from using
5250
// generator functions, we detect async functions by checking the name of
5351
// function's constructor.

dom/localstorage/test/unit/head.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ add_setup(function () {
2121

2222
enableTesting();
2323

24-
Cu.importGlobalProperties(["crypto"]);
25-
2624
registerCleanupFunction(resetTesting);
2725
});
2826

dom/push/test/xpcshell/test_crypto_encrypt.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Test PushCrypto.encrypt()
22
"use strict";
33

4-
Cu.importGlobalProperties(["crypto"]);
5-
64
const { PushCrypto } = ChromeUtils.importESModule(
75
"resource://gre/modules/PushCrypto.sys.mjs"
86
);

dom/push/test/xpcshell/test_service_child.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
"use strict";
55

6-
Cu.importGlobalProperties(["crypto"]);
7-
86
var db;
97

108
function done() {

0 commit comments

Comments
 (0)