Skip to content

Commit 9170958

Browse files
committed
Bug 1801379 - Migrate Sinon.jsm to an ES module r=extension-reviewers,application-update-reviewers,pip-reviewers,credential-management-reviewers,fxview-reviewers,devtools-reviewers,Standard8,nchevobbe,sclements,dimi,mconley,bytesized,robwu
Migrated `testing/modules/Sinon.sys.mjs` to an ES module. `testing` should now be 100% ESM 🎉 Differential Revision: https://phabricator.services.mozilla.com/D173643
1 parent 8cd9442 commit 9170958

File tree

112 files changed

+294
-154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+294
-154
lines changed

browser/base/content/test/contextMenu/browser_contextmenu_share_macosx.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
"use strict";
55

6-
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
6+
const { sinon } = ChromeUtils.importESModule(
7+
"resource://testing-common/Sinon.sys.mjs"
8+
);
79
const BASE = getRootDirectory(gTestPath).replace(
810
"chrome://mochitests/content",
911
// eslint-disable-next-line @microsoft/sdl/no-insecure-url

browser/base/content/test/contextMenu/browser_contextmenu_share_win.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
"use strict";
55

6-
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
6+
const { sinon } = ChromeUtils.importESModule(
7+
"resource://testing-common/Sinon.sys.mjs"
8+
);
79
const BASE = getRootDirectory(gTestPath).replace(
810
"chrome://mochitests/content",
911
// eslint-disable-next-line @microsoft/sdl/no-insecure-url

browser/base/content/test/contextMenu/browser_contextmenu_spellcheck.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
let contextMenu;
77

8-
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
8+
const { sinon } = ChromeUtils.importESModule(
9+
"resource://testing-common/Sinon.sys.mjs"
10+
);
911

1012
const example_base =
1113
// eslint-disable-next-line @microsoft/sdl/no-insecure-url

browser/base/content/test/general/browser_contentAreaClick.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
* correctly prevent default events, and follows the correct code path.
1515
*/
1616

17-
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
17+
const { sinon } = ChromeUtils.importESModule(
18+
"resource://testing-common/Sinon.sys.mjs"
19+
);
1820

1921
var gTests = [
2022
{

browser/base/content/test/menubar/browser_file_share.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
"use strict";
55

6-
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
6+
const { sinon } = ChromeUtils.importESModule(
7+
"resource://testing-common/Sinon.sys.mjs"
8+
);
79
const BASE = getRootDirectory(gTestPath).replace(
810
"chrome://mochitests/content",
911
// eslint-disable-next-line @microsoft/sdl/no-insecure-url

browser/base/content/test/pageActions/head.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ ChromeUtils.defineESModuleGetters(this, {
66
"resource://testing-common/EnterprisePolicyTesting.sys.mjs",
77
PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs",
88
TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs",
9+
sinon: "resource://testing-common/Sinon.sys.mjs",
910
});
1011

1112
XPCOMUtils.defineLazyModuleGetters(this, {
1213
ExtensionCommon: "resource://gre/modules/ExtensionCommon.jsm",
13-
sinon: "resource://testing-common/Sinon.jsm",
1414
});
1515

1616
async function promisePageActionPanelOpen(win = window, eventDict = {}) {

browser/base/content/test/protectionsUI/browser_protectionsUI_cookie_banner.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
const { TelemetryTestUtils } = ChromeUtils.importESModule(
1111
"resource://testing-common/TelemetryTestUtils.sys.mjs"
1212
);
13-
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
13+
const { sinon } = ChromeUtils.importESModule(
14+
"resource://testing-common/Sinon.sys.mjs"
15+
);
1416

1517
const {
1618
MODE_DISABLED,

browser/base/content/test/sync/head.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
const { UIState } = ChromeUtils.importESModule(
22
"resource://services-sync/UIState.sys.mjs"
33
);
4-
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
4+
const { sinon } = ChromeUtils.importESModule(
5+
"resource://testing-common/Sinon.sys.mjs"
6+
);
57

68
function promiseSyncReady() {
79
let service = Cc["@mozilla.org/weave/service;1"].getService(Ci.nsISupports)

browser/base/content/test/tabs/browser_removeTabs_order.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
"use strict";
55

6-
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
6+
const { sinon } = ChromeUtils.importESModule(
7+
"resource://testing-common/Sinon.sys.mjs"
8+
);
79

810
add_task(async function() {
911
let tab1 = await addTab();

browser/base/content/test/tabs/common_link_in_tab_title_and_url_prefilled.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
5+
const { sinon } = ChromeUtils.importESModule(
6+
"resource://testing-common/Sinon.sys.mjs"
7+
);
68

79
const TEST_ROOT = getRootDirectory(gTestPath).replace(
810
"chrome://mochitests/content",

0 commit comments

Comments
 (0)