From 9a52fe90193d9f538d2890ef30429ed13e7dc99e Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Wed, 27 Apr 2022 11:40:42 +0000 Subject: [PATCH] Bug 1766099 - Part 7: Explicitly specify import or imported symbol for importScripts in toolkit/components/promiseworker/. r=Standard8 Depends on D144676 Differential Revision: https://phabricator.services.mozilla.com/D144677 --- .../components/osfile/tests/mochi/worker_test_osfile_comms.js | 2 +- .../components/osfile/tests/mochi/worker_test_osfile_front.js | 4 +++- .../components/osfile/tests/mochi/worker_test_osfile_unix.js | 3 ++- .../components/osfile/tests/mochi/worker_test_osfile_win.js | 3 ++- .../components/promiseworker/tests/xpcshell/data/worker.js | 1 + toolkit/components/promiseworker/worker/PromiseWorker.js | 1 + 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/toolkit/components/osfile/tests/mochi/worker_test_osfile_comms.js b/toolkit/components/osfile/tests/mochi/worker_test_osfile_comms.js index 5b68b79fb54a..4534ccc8bb74 100644 --- a/toolkit/components/osfile/tests/mochi/worker_test_osfile_comms.js +++ b/toolkit/components/osfile/tests/mochi/worker_test_osfile_comms.js @@ -2,10 +2,10 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ /* eslint-env mozilla/chrome-worker, node */ -/* global finish, log */ "use strict"; +/* import-globals-from /testing/mochitest/tests/SimpleTest/WorkerSimpleTest.js */ importScripts("chrome://mochikit/content/tests/SimpleTest/WorkerSimpleTest.js"); // The set of samples for communications test. Declare as a global diff --git a/toolkit/components/osfile/tests/mochi/worker_test_osfile_front.js b/toolkit/components/osfile/tests/mochi/worker_test_osfile_front.js index 93c5b5b5e753..4f7e5901021c 100644 --- a/toolkit/components/osfile/tests/mochi/worker_test_osfile_front.js +++ b/toolkit/components/osfile/tests/mochi/worker_test_osfile_front.js @@ -2,9 +2,10 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ /* eslint-env mozilla/chrome-worker, node */ -/* global finish, log */ +/* import-globals-from /testing/mochitest/tests/SimpleTest/WorkerSimpleTest.js */ importScripts("chrome://mochikit/content/tests/SimpleTest/WorkerSimpleTest.js"); +/* import-globals-from /toolkit/components/workerloader/require.js */ importScripts("resource://gre/modules/workers/require.js"); var SharedAll = require("resource://gre/modules/osfile/osfile_shared_allthreads.jsm"); @@ -47,6 +48,7 @@ self.onmessage = function onmessage_start(msg) { function test_init() { info("Starting test_init"); + /* import-globals-from /toolkit/components/osfile/osfile.jsm */ importScripts("resource://gre/modules/osfile.jsm"); } diff --git a/toolkit/components/osfile/tests/mochi/worker_test_osfile_unix.js b/toolkit/components/osfile/tests/mochi/worker_test_osfile_unix.js index 4fdf9e6009fd..aa456da030fe 100644 --- a/toolkit/components/osfile/tests/mochi/worker_test_osfile_unix.js +++ b/toolkit/components/osfile/tests/mochi/worker_test_osfile_unix.js @@ -2,8 +2,8 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ /* eslint-env mozilla/chrome-worker, node */ -/* global finish, log */ +/* import-globals-from /testing/mochitest/tests/SimpleTest/WorkerSimpleTest.js */ importScripts("chrome://mochikit/content/tests/SimpleTest/WorkerSimpleTest.js"); self.onmessage = function(msg) { @@ -23,6 +23,7 @@ self.onmessage = function(msg) { function test_init() { info("Starting test_init"); + /* import-globals-from /toolkit/components/osfile/osfile.jsm */ importScripts("resource://gre/modules/osfile.jsm"); } diff --git a/toolkit/components/osfile/tests/mochi/worker_test_osfile_win.js b/toolkit/components/osfile/tests/mochi/worker_test_osfile_win.js index e1fbd3ec5732..5e02c0399847 100644 --- a/toolkit/components/osfile/tests/mochi/worker_test_osfile_win.js +++ b/toolkit/components/osfile/tests/mochi/worker_test_osfile_win.js @@ -2,8 +2,8 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ /* eslint-env mozilla/chrome-worker, node */ -/* global finish, log */ +/* import-globals-from /testing/mochitest/tests/SimpleTest/WorkerSimpleTest.js */ importScripts("chrome://mochikit/content/tests/SimpleTest/WorkerSimpleTest.js"); self.onmessage = function(msg) { @@ -22,6 +22,7 @@ self.onmessage = function(msg) { function test_init() { info("Starting test_init"); + /* import-globals-from /toolkit/components/osfile/osfile.jsm */ importScripts("resource://gre/modules/osfile.jsm"); } diff --git a/toolkit/components/promiseworker/tests/xpcshell/data/worker.js b/toolkit/components/promiseworker/tests/xpcshell/data/worker.js index 5234e78a9de4..a639554e73f1 100644 --- a/toolkit/components/promiseworker/tests/xpcshell/data/worker.js +++ b/toolkit/components/promiseworker/tests/xpcshell/data/worker.js @@ -7,6 +7,7 @@ // Trivial worker definition +/* import-globals-from /toolkit/components/workerloader/require.js */ importScripts("resource://gre/modules/workers/require.js"); var PromiseWorker = require("resource://gre/modules/workers/PromiseWorker.js"); diff --git a/toolkit/components/promiseworker/worker/PromiseWorker.js b/toolkit/components/promiseworker/worker/PromiseWorker.js index 6c0f4298ac6e..b87e6c7e51dc 100644 --- a/toolkit/components/promiseworker/worker/PromiseWorker.js +++ b/toolkit/components/promiseworker/worker/PromiseWorker.js @@ -28,6 +28,7 @@ if (typeof require == "undefined" || typeof module == "undefined") { ); } +/* import-globals-from /toolkit/components/workerloader/require.js */ importScripts("resource://gre/modules/workers/require.js"); /**