gecko-dev/toolkit/components/nimbus/test/unit/head.js
Barret Rennie 981568640d Bug 1782150 - Set and unset prefs when enrolling and unenrolling in experiments r=emcminn
Nimbus will now set prefs specified for variables specified in the feature
manifest when enerolling in an experiment that sets those variables. If
enrolling in an experiment and a rollout that would both set the same pref, the
experiment takes precedence.

`ExperimentFakes.enrollWithFeatureConfig` was updated to add support for
enrolling in rollouts because `ExperimentFakes.enrollWithRollout` skips
enrollment logic altogether and directly calls `ExperimentStore.addEnrollment`
(https://searchfox.org/mozilla-central/rev/9ddf68cc9e603276fc4c5253328cb3aeed6f0a55/toolkit/components/nimbus/test/NimbusTestUtils.jsm#216).

All callers will be migrated to the new API in bug 1782150.

Differential Revision: https://phabricator.services.mozilla.com/D156642
2022-09-27 17:27:26 +00:00

11 lines
390 B
JavaScript

"use strict";
// Globals
const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm");
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
XPCOMUtils.defineLazyModuleGetters(this, {
ExperimentFakes: "resource://testing-common/NimbusTestUtils.jsm",
ExperimentTestUtils: "resource://testing-common/NimbusTestUtils.jsm",
});