mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
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
This commit is contained in:
parent
8cd944215e
commit
91709586ba
@ -3,7 +3,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const BASE = getRootDirectory(gTestPath).replace(
|
||||
"chrome://mochitests/content",
|
||||
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
|
||||
|
@ -3,7 +3,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const BASE = getRootDirectory(gTestPath).replace(
|
||||
"chrome://mochitests/content",
|
||||
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
|
||||
|
@ -5,7 +5,9 @@
|
||||
|
||||
let contextMenu;
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const example_base =
|
||||
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
|
||||
|
@ -14,7 +14,9 @@
|
||||
* correctly prevent default events, and follows the correct code path.
|
||||
*/
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
var gTests = [
|
||||
{
|
||||
|
@ -3,7 +3,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const BASE = getRootDirectory(gTestPath).replace(
|
||||
"chrome://mochitests/content",
|
||||
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
|
||||
|
@ -6,11 +6,11 @@ ChromeUtils.defineESModuleGetters(this, {
|
||||
"resource://testing-common/EnterprisePolicyTesting.sys.mjs",
|
||||
PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs",
|
||||
TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
ExtensionCommon: "resource://gre/modules/ExtensionCommon.jsm",
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
});
|
||||
|
||||
async function promisePageActionPanelOpen(win = window, eventDict = {}) {
|
||||
|
@ -10,7 +10,9 @@
|
||||
const { TelemetryTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/TelemetryTestUtils.sys.mjs"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const {
|
||||
MODE_DISABLED,
|
||||
|
@ -1,7 +1,9 @@
|
||||
const { UIState } = ChromeUtils.importESModule(
|
||||
"resource://services-sync/UIState.sys.mjs"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
function promiseSyncReady() {
|
||||
let service = Cc["@mozilla.org/weave/service;1"].getService(Ci.nsISupports)
|
||||
|
@ -3,7 +3,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
add_task(async function() {
|
||||
let tab1 = await addTab();
|
||||
|
@ -2,7 +2,9 @@
|
||||
* 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 { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const TEST_ROOT = getRootDirectory(gTestPath).replace(
|
||||
"chrome://mochitests/content",
|
||||
|
@ -7,7 +7,9 @@ const { MacAttribution } = ChromeUtils.importESModule(
|
||||
const { AttributionIOUtils } = ChromeUtils.importESModule(
|
||||
"resource:///modules/AttributionCode.sys.mjs"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
async function assertCacheExistsAndIsEmpty() {
|
||||
// We should have written to the cache, and be able to read back
|
||||
|
@ -102,7 +102,9 @@ async function setupStubs() {
|
||||
const { AppConstants } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/AppConstants.sys.mjs"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
// This depends on the caller to invoke it by name. We do try to
|
||||
// prevent the most obvious incorrect invocation, namely
|
||||
|
@ -7,7 +7,9 @@ const { AppConstants } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/AppConstants.sys.mjs"
|
||||
);
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
add_task(async () => {
|
||||
await setupStubs();
|
||||
|
@ -12,7 +12,9 @@ const { BuiltInThemes } = ChromeUtils.importESModule(
|
||||
const { ColorwayClosetOpener } = ChromeUtils.import(
|
||||
"resource:///modules/ColorwayClosetOpener.jsm"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const MOCK_COLLECTION_TEST_CARD_IMAGE_PATH = "mockCollectionPreview.avif";
|
||||
const MOCK_THEME_NAME = "Mock Theme";
|
||||
|
@ -2,7 +2,9 @@
|
||||
/* vim: set sts=2 sw=2 et tw=80: */
|
||||
|
||||
"use strict";
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
|
@ -9,11 +9,11 @@ const { AddonTestUtils } = ChromeUtils.import(
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
|
||||
TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
HomePage: "resource:///modules/HomePage.jsm",
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
});
|
||||
|
||||
function promisePrefChanged(expectedValue) {
|
||||
|
@ -9,12 +9,12 @@ const { AddonTestUtils } = ChromeUtils.import(
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
PromiseUtils: "resource://gre/modules/PromiseUtils.sys.mjs",
|
||||
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.jsm",
|
||||
HomePage: "resource:///modules/HomePage.jsm",
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
});
|
||||
|
||||
AddonTestUtils.init(this);
|
||||
|
@ -19,7 +19,9 @@ const { RemoteSettings } = ChromeUtils.importESModule(
|
||||
"resource://services-settings/remote-settings.sys.mjs"
|
||||
);
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const URLTYPE_SUGGEST_JSON = "application/x-suggestions+json";
|
||||
|
||||
|
@ -12,7 +12,9 @@ const { SearchTestUtils } = ChromeUtils.importESModule(
|
||||
const { NimbusFeatures } = ChromeUtils.import(
|
||||
"resource://nimbus/ExperimentAPI.jsm"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
AddonTestUtils.init(this);
|
||||
AddonTestUtils.overrideCertDB();
|
||||
|
@ -20,7 +20,9 @@ const { ASRouter } = ChromeUtils.import(
|
||||
const { UIState } = ChromeUtils.importESModule(
|
||||
"resource://services-sync/UIState.sys.mjs"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const { FeatureCalloutMessages } = ChromeUtils.import(
|
||||
"resource://activity-stream/lib/FeatureCalloutMessages.jsm"
|
||||
);
|
||||
|
@ -3,7 +3,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const { InternalTestingProfileMigrator } = ChromeUtils.importESModule(
|
||||
"resource:///modules/InternalTestingProfileMigrator.sys.mjs"
|
||||
);
|
||||
|
@ -3,7 +3,9 @@ http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const { EdgeProfileMigrator } = ChromeUtils.importESModule(
|
||||
"resource:///modules/EdgeProfileMigrator.sys.mjs"
|
||||
);
|
||||
|
@ -19,7 +19,9 @@ const { FxAccounts } = ChromeUtils.importESModule(
|
||||
);
|
||||
// We import sinon here to make it available across all mochitest test files
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
// Set the content pref to make it available across tests
|
||||
const ABOUT_WELCOME_OVERRIDE_CONTENT_PREF = "browser.aboutwelcome.screens";
|
||||
// Test differently for windows 7 as theme screens are removed.
|
||||
|
@ -7,7 +7,9 @@
|
||||
const { AboutWelcomeDefaults } = ChromeUtils.import(
|
||||
"resource://activity-stream/aboutwelcome/lib/AboutWelcomeDefaults.jsm"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const { AttributionCode } = ChromeUtils.importESModule(
|
||||
"resource:///modules/AttributionCode.sys.mjs"
|
||||
);
|
||||
|
@ -10,7 +10,9 @@ const { AboutWelcomeTelemetry } = ChromeUtils.import(
|
||||
const { AttributionCode } = ChromeUtils.importESModule(
|
||||
"resource:///modules/AttributionCode.sys.mjs"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const TELEMETRY_PREF = "browser.newtabpage.activity-stream.telemetry";
|
||||
|
||||
add_task(function test_enabled() {
|
||||
|
@ -4,7 +4,9 @@
|
||||
const { OnboardingMessageProvider } = ChromeUtils.import(
|
||||
"resource://activity-stream/lib/OnboardingMessageProvider.jsm"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
function getOnboardingScreenById(screens, screenId) {
|
||||
return screens.find(screen => {
|
||||
|
@ -1,6 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const sandbox = sinon.createSandbox();
|
||||
|
||||
|
@ -7,7 +7,9 @@
|
||||
* Test to ensure that on "mousedown" in Toolbar we set Speculative Connection
|
||||
*/
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const sandbox = sinon.createSandbox();
|
||||
let spy = sandbox
|
||||
.stub(PlacesUIUtils, "setupSpeculativeConnection")
|
||||
|
@ -4,7 +4,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const sandbox = sinon.createSandbox();
|
||||
const TAG_NAME = "testTag";
|
||||
|
@ -8,7 +8,9 @@
|
||||
const { PromptTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/PromptTestUtils.sys.mjs"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const { ForgetAboutSite } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/ForgetAboutSite.sys.mjs"
|
||||
);
|
||||
|
@ -1,7 +1,9 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const sandbox = sinon.createSandbox();
|
||||
|
||||
const URL1 = "https://example.com/1/";
|
||||
|
@ -6,7 +6,9 @@ const { Interactions } = ChromeUtils.importESModule(
|
||||
"resource:///modules/Interactions.sys.mjs"
|
||||
);
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
this,
|
||||
|
@ -1,4 +1,6 @@
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-generateqi */
|
||||
|
||||
|
@ -9,7 +9,9 @@ ChromeUtils.defineModuleGetter(
|
||||
"chrome://pocket/content/pktApi.jsm"
|
||||
);
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
// PocketEnabled/Disabled promises return true if it was already
|
||||
// Enabled/Disabled, and false if it need to Enable/Disable.
|
||||
|
@ -9,4 +9,6 @@ XPCOMUtils.defineLazyScriptGetter(
|
||||
"chrome://pocket/content/pktUI.js"
|
||||
);
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
@ -1,4 +1,6 @@
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const testGlobal = {
|
||||
PKT_PANEL_OVERLAY: class {
|
||||
|
@ -11,7 +11,9 @@ const { FxAccountsPairingFlow } = ChromeUtils.importESModule(
|
||||
);
|
||||
|
||||
// Use sinon for mocking.
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
let flowCounter = 0;
|
||||
|
||||
|
@ -2,7 +2,9 @@
|
||||
* 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 { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const sandbox = sinon.createSandbox();
|
||||
|
||||
|
@ -2,7 +2,9 @@
|
||||
* 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 { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
add_task(async function test_experiment_messaging_system() {
|
||||
const LOCALE = Services.locale.appLocaleAsBCP47;
|
||||
|
@ -10,7 +10,9 @@ const SCREENSHOTS_EVENTS = [
|
||||
{ category: "screenshots", method: "failed", object: "screenshot_too_large" },
|
||||
];
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
ScreenshotsUtils: "resource:///modules/ScreenshotsUtils.sys.mjs",
|
||||
});
|
||||
|
@ -3,7 +3,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
ScreenshotsUtils: "resource:///modules/ScreenshotsUtils.sys.mjs",
|
||||
|
@ -10,7 +10,9 @@ const { ExperimentFakes } = ChromeUtils.import(
|
||||
const { SearchService } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/SearchService.sys.mjs"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
add_task(async function test_engines_reloaded_nimbus() {
|
||||
let reloadSpy = sinon.spy(SearchService.prototype, "_maybeReloadEngines");
|
||||
|
@ -10,11 +10,11 @@ ChromeUtils.defineESModuleGetters(this, {
|
||||
SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.sys.mjs",
|
||||
SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
|
||||
TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
});
|
||||
|
||||
const TESTS = [
|
||||
|
@ -10,11 +10,11 @@ ChromeUtils.defineESModuleGetters(this, {
|
||||
SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.sys.mjs",
|
||||
SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
|
||||
TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
});
|
||||
|
||||
const TEST_PROVIDER_INFO = [
|
||||
|
@ -4,7 +4,9 @@
|
||||
const { _LastSession } = ChromeUtils.importESModule(
|
||||
"resource:///modules/sessionstore/SessionStore.sys.mjs"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const state = {
|
||||
windows: [
|
||||
|
@ -1,11 +1,14 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm",
|
||||
ExperimentFakes: "resource://testing-common/NimbusTestUtils.jsm",
|
||||
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
});
|
||||
|
||||
const userChoiceStub = sinon
|
||||
|
@ -1,11 +1,14 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm",
|
||||
ExperimentFakes: "resource://testing-common/NimbusTestUtils.jsm",
|
||||
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(
|
||||
|
@ -1 +1,3 @@
|
||||
var { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
var { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
@ -1,7 +1,9 @@
|
||||
var { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
var { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
var { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "FxAccountsCommon", function() {
|
||||
return ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
|
||||
|
@ -5,10 +5,7 @@ http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
// Helpers for testing telemetry events.
|
||||
|
@ -2,5 +2,7 @@
|
||||
* 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/. */
|
||||
|
||||
var { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
var { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
var gProfD = do_get_profile().QueryInterface(Ci.nsIFile);
|
||||
|
@ -3,7 +3,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
var gTestTab;
|
||||
var gContentAPI;
|
||||
|
@ -5,7 +5,9 @@
|
||||
// the original search string to the docshell and not a search url.
|
||||
|
||||
add_task(async function test() {
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const sandbox = sinon.createSandbox();
|
||||
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
|
@ -19,6 +19,7 @@ ChromeUtils.defineESModuleGetters(this, {
|
||||
UrlbarSearchUtils: "resource:///modules/UrlbarSearchUtils.sys.mjs",
|
||||
UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs",
|
||||
UrlbarView: "resource:///modules/UrlbarView.sys.mjs",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
@ -26,7 +27,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm",
|
||||
ExperimentFakes: "resource://testing-common/NimbusTestUtils.jsm",
|
||||
ObjectUtils: "resource://gre/modules/ObjectUtils.jsm",
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "PlacesFrecencyRecalculator", () => {
|
||||
|
@ -30,12 +30,9 @@ XPCOMUtils.defineLazyGetter(this, "MerinoTestUtils", () => {
|
||||
return module;
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
});
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.sys.mjs",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
async function addTopSites(url) {
|
||||
|
@ -22,13 +22,13 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
||||
"resource:///modules/UrlbarProviderQuickSuggest.sys.mjs",
|
||||
UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs",
|
||||
setTimeout: "resource://gre/modules/Timer.sys.mjs",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm",
|
||||
ExperimentFakes: "resource://testing-common/NimbusTestUtils.jsm",
|
||||
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
});
|
||||
|
||||
let gTestScope;
|
||||
|
@ -10,10 +10,7 @@
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
EnterprisePolicyTesting:
|
||||
"resource://testing-common/EnterprisePolicyTesting.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
// We use this pref in enterprise preference policy tests. We specifically use a
|
||||
|
@ -11,10 +11,7 @@ ChromeUtils.defineESModuleGetters(this, {
|
||||
CONTEXTUAL_SERVICES_PING_TYPES:
|
||||
"resource:///modules/PartnerLinkAttribution.sys.mjs",
|
||||
UrlbarView: "resource:///modules/UrlbarView.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
const { TELEMETRY_SCALARS } = UrlbarProviderQuickSuggest;
|
||||
|
@ -29,12 +29,12 @@ ChromeUtils.defineESModuleGetters(this, {
|
||||
UrlbarResult: "resource:///modules/UrlbarResult.sys.mjs",
|
||||
UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.sys.mjs",
|
||||
UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.sys.mjs",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AddonTestUtils: "resource://testing-common/AddonTestUtils.jsm",
|
||||
HttpServer: "resource://testing-common/httpd.js",
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "QuickSuggestTestUtils", () => {
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
let sandbox;
|
||||
|
@ -9,8 +9,8 @@
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
// The possible limit-related properties in result groups.
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
const SUGGEST_PREF = "browser.urlbar.suggest.searches";
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
const MAX_RESULTS = 10;
|
||||
|
@ -25,7 +25,9 @@ var { FileTestUtils } = ChromeUtils.importESModule(
|
||||
var { MockDocument } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/MockDocument.sys.mjs"
|
||||
);
|
||||
var { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
var { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
var { TestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/TestUtils.sys.mjs"
|
||||
);
|
||||
|
@ -10,11 +10,11 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
HomePage: "resource:///modules/HomePage.jsm",
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
});
|
||||
|
||||
const HOMEPAGE_IGNORELIST = "homepage-urls";
|
||||
|
@ -11,11 +11,11 @@ const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
|
||||
TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
HomePage: "resource:///modules/HomePage.jsm",
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
});
|
||||
|
||||
const HOMEPAGE_IGNORELIST = "homepage-urls";
|
||||
|
@ -11,7 +11,9 @@ const {
|
||||
"resource:///modules/PartnerLinkAttribution.sys.mjs"
|
||||
);
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const FAKE_PING = { tile_id: 1, position: 1 };
|
||||
|
||||
|
@ -17,7 +17,9 @@ const { UpdateUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/UpdateUtils.sys.mjs"
|
||||
);
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const FAKE_PING = { event: "fake_event", value: "fake_value", locale: "en-US" };
|
||||
const FAKE_ENDPOINT = "https://www.test.com";
|
||||
|
@ -1,7 +1,9 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const { AddonTestUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/AddonTestUtils.jsm"
|
||||
|
@ -1,6 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const {
|
||||
setDefaultPreferencesIfNeeded,
|
||||
PREFERENCE_TYPES,
|
||||
|
@ -8,7 +8,9 @@ const { getAddonAndLocalAPIsMocker } = ChromeUtils.importESModule(
|
||||
const { LangPackMatcher } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/LangPackMatcher.sys.mjs"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const sandbox = sinon.createSandbox();
|
||||
const mockAddonAndLocaleAPIs = getAddonAndLocalAPIsMocker(this, sandbox);
|
||||
|
@ -4,7 +4,9 @@
|
||||
const { Async } = ChromeUtils.importESModule(
|
||||
"resource://services-common/async.sys.mjs"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
function makeArray(length) {
|
||||
// Start at 1 so that we can just divide by yieldEvery to get the expected
|
||||
|
@ -9,7 +9,9 @@
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const { SCOPE_OLD_SYNC, LEGACY_SCOPE_WEBEXT_SYNC } = ChromeUtils.import(
|
||||
"resource://gre/modules/FxAccountsCommon.js"
|
||||
);
|
||||
|
@ -22,7 +22,9 @@ var { CommonUtils } = ChromeUtils.importESModule(
|
||||
var { PlacesTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/PlacesTestUtils.sys.mjs"
|
||||
);
|
||||
var { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
var { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
var {
|
||||
SerializableSet,
|
||||
Svc,
|
||||
|
@ -119,7 +119,7 @@ The [`Sinon`](https://sinonjs.org/) mocking framework is available. You can impo
|
||||
using something like:
|
||||
|
||||
```js
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule("resource://testing-common/Sinon.sys.mjs");
|
||||
```
|
||||
|
||||
More details on how to do mocking are available on the Sinon website.
|
||||
|
@ -2,22 +2,18 @@
|
||||
* 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";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["sinon"];
|
||||
|
||||
// ================================================
|
||||
// Load mocking/stubbing library sinon
|
||||
// docs: http://sinonjs.org/releases/v7.2.7/
|
||||
const {
|
||||
import {
|
||||
clearInterval,
|
||||
clearTimeout,
|
||||
setInterval,
|
||||
setIntervalWithTarget,
|
||||
setTimeout,
|
||||
setTimeoutWithTarget,
|
||||
} = ChromeUtils.importESModule("resource://gre/modules/Timer.sys.mjs");
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
} from "resource://gre/modules/Timer.sys.mjs";
|
||||
|
||||
const obj = {
|
||||
global: {
|
||||
clearInterval,
|
||||
@ -28,10 +24,17 @@ const obj = {
|
||||
setTimeoutWithTarget,
|
||||
Date,
|
||||
},
|
||||
clearInterval,
|
||||
clearTimeout,
|
||||
setInterval,
|
||||
setIntervalWithTarget,
|
||||
setTimeout,
|
||||
setTimeoutWithTarget,
|
||||
};
|
||||
Services.scriptloader.loadSubScript(
|
||||
"resource://testing-common/sinon-7.2.7.js",
|
||||
obj
|
||||
);
|
||||
const sinon = obj.global.sinon;
|
||||
|
||||
export const sinon = obj.global.sinon;
|
||||
// ================================================
|
@ -15,7 +15,7 @@ TESTING_JS_MODULES += [
|
||||
"FileTestUtils.sys.mjs",
|
||||
"MockRegistrar.sys.mjs",
|
||||
"sinon-7.2.7.js",
|
||||
"Sinon.jsm",
|
||||
"Sinon.sys.mjs",
|
||||
"StructuredLog.sys.mjs",
|
||||
"TestUtils.sys.mjs",
|
||||
"XPCShellContentUtils.sys.mjs",
|
||||
|
@ -7,7 +7,9 @@ const { RemoteSettings } = ChromeUtils.importESModule(
|
||||
"resource://services-settings/remote-settings.sys.mjs"
|
||||
);
|
||||
|
||||
let { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
let { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
// Name of the RemoteSettings collection containing the rules.
|
||||
const COLLECTION_NAME = "cookie-banner-rules-list";
|
||||
|
@ -24,7 +24,9 @@ add_setup(async () => {
|
||||
const { WebRequest } = ChromeUtils.import(
|
||||
"resource://gre/modules/WebRequest.jsm"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
gTabLookupSpy = sinon.spy(WebRequest, "getTabIdForChannelWrapper");
|
||||
|
||||
await ExtensionTestUtils.startAddonManager();
|
||||
|
@ -19,7 +19,9 @@ const { TestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/TestUtils.sys.mjs"
|
||||
);
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
add_task(async function test_hasPersistedScripts_startup_cache() {
|
||||
let extension1 = ExtensionTestUtils.loadExtension({
|
||||
|
@ -1 +1,3 @@
|
||||
var { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
var { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
@ -3,7 +3,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const { JsonSchema } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/JsonSchema.sys.mjs"
|
||||
);
|
||||
|
@ -1,4 +1,6 @@
|
||||
"use strict";
|
||||
// Globals
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
@ -20,6 +20,7 @@ const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
JsonSchema: "resource://gre/modules/JsonSchema.sys.mjs",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
@ -29,7 +30,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
NormandyUtils: "resource://normandy/lib/NormandyUtils.jsm",
|
||||
_RemoteSettingsExperimentLoader:
|
||||
"resource://nimbus/lib/RemoteSettingsExperimentLoader.jsm",
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
FeatureManifest: "resource://nimbus/FeatureManifest.js",
|
||||
});
|
||||
|
||||
|
@ -4,7 +4,9 @@
|
||||
"use strict";
|
||||
|
||||
// Globals
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
ExperimentManager: "resource://nimbus/lib/ExperimentManager.jsm",
|
||||
|
@ -1,7 +1,9 @@
|
||||
"use strict";
|
||||
// Globals
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
@ -15,7 +15,9 @@ const { NormandyUtils } = ChromeUtils.import(
|
||||
const { RecipeRunner } = ChromeUtils.import(
|
||||
"resource://normandy/lib/RecipeRunner.jsm"
|
||||
);
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const FIXTURE_ADDON_ID = "normandydriver-a@example.com";
|
||||
const UUID_REGEX = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i;
|
||||
|
@ -40,7 +40,9 @@ const FileInputStream = Components.Constructor(
|
||||
"init"
|
||||
);
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
// Make sinon assertions fail in a way that mochitest understands
|
||||
sinon.assert.fail = function(message) {
|
||||
|
@ -1,3 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
var { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
var { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
@ -5,7 +5,9 @@ const { ExperimentAPI } = ChromeUtils.import(
|
||||
"resource://nimbus/ExperimentAPI.jsm"
|
||||
);
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
// Dummy migrator to change and detect importable behavior.
|
||||
const gTestMigrator = {
|
||||
|
@ -1,4 +1,6 @@
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
add_task(async function test_noFilter() {
|
||||
let openingFunc = () =>
|
||||
|
@ -1,4 +1,6 @@
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
|
||||
const { getFxAccountsSingleton } = ChromeUtils.import(
|
||||
"resource://gre/modules/FxAccounts.jsm"
|
||||
|
@ -4,7 +4,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const { LoginManagerParent } = ChromeUtils.import(
|
||||
"resource://gre/modules/LoginManagerParent.jsm"
|
||||
);
|
||||
|
@ -4,7 +4,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const { LoginManagerParent } = ChromeUtils.import(
|
||||
"resource://gre/modules/LoginManagerParent.jsm"
|
||||
);
|
||||
|
@ -4,7 +4,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const { LoginManagerParent } = ChromeUtils.import(
|
||||
"resource://gre/modules/LoginManagerParent.jsm"
|
||||
);
|
||||
|
@ -11,7 +11,9 @@
|
||||
let { LoginExport } = ChromeUtils.import(
|
||||
"resource://gre/modules/LoginExport.jsm"
|
||||
);
|
||||
let { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
let { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
/**
|
||||
* Saves the logins to a temporary CSV file, reads the lines and returns the CSV lines.
|
||||
|
@ -3,7 +3,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
|
||||
const NEW_VIDEO_ASPECT_RATIO = 1.334;
|
||||
|
||||
|
@ -179,7 +179,9 @@ add_task(async function invalid_properties_for_bookmark_type() {
|
||||
});
|
||||
|
||||
add_task(async function test_insert_into_root_throws() {
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const sandbox = sinon.createSandbox();
|
||||
sandbox.stub(PlacesUtils, "isInAutomation").get(() => false);
|
||||
registerCleanupFunction(() => sandbox.restore());
|
||||
|
@ -2808,7 +2808,9 @@ add_task(async function test_preventive_maintenance() {
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
add_task(async function test_idle_daily() {
|
||||
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
|
||||
const { sinon } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/Sinon.sys.mjs"
|
||||
);
|
||||
const sandbox = sinon.createSandbox();
|
||||
sandbox.stub(PlacesDBUtils, "maintenanceOnIdle");
|
||||
Services.prefs.clearUserPref("places.database.lastMaintenance");
|
||||
|
@ -7,13 +7,13 @@ const lazy = {};
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
|
||||
SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.jsm",
|
||||
AddonTestUtils: "resource://testing-common/AddonTestUtils.jsm",
|
||||
ExtensionTestUtils: "resource://testing-common/ExtensionXPCShellUtils.jsm",
|
||||
sinon: "resource://testing-common/Sinon.jsm",
|
||||
});
|
||||
|
||||
var gTestScope;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user