Bug 1959483 - Port tests from ExperimentFakes and ExperimentTestUtils to NimbusTestUtils in browser/components/shell r=nimbus-reviewers,beth
Differential Revision: https://phabricator.services.mozilla.com/D247016
This commit is contained in:
committed by
dthorn@mozilla.com
parent
324eb993a8
commit
127d08ec0b
@@ -2,8 +2,8 @@
|
|||||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
ChromeUtils.defineESModuleGetters(this, {
|
ChromeUtils.defineESModuleGetters(this, {
|
||||||
ExperimentFakes: "resource://testing-common/NimbusTestUtils.sys.mjs",
|
|
||||||
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
|
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
|
||||||
|
NimbusTestUtils: "resource://testing-common/NimbusTestUtils.sys.mjs",
|
||||||
});
|
});
|
||||||
|
|
||||||
let defaultValue;
|
let defaultValue;
|
||||||
@@ -19,7 +19,7 @@ add_task(async function remote_disable() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let doCleanup = await ExperimentFakes.enrollWithFeatureConfig(
|
let doCleanup = await NimbusTestUtils.enrollWithFeatureConfig(
|
||||||
{
|
{
|
||||||
featureId: NimbusFeatures.shellService.featureId,
|
featureId: NimbusFeatures.shellService.featureId,
|
||||||
value: { disablePin: true, enabled: true },
|
value: { disablePin: true, enabled: true },
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
ChromeUtils.defineESModuleGetters(this, {
|
ChromeUtils.defineESModuleGetters(this, {
|
||||||
ASRouter: "resource:///modules/asrouter/ASRouter.sys.mjs",
|
ASRouter: "resource:///modules/asrouter/ASRouter.sys.mjs",
|
||||||
ExperimentAPI: "resource://nimbus/ExperimentAPI.sys.mjs",
|
ExperimentAPI: "resource://nimbus/ExperimentAPI.sys.mjs",
|
||||||
ExperimentFakes: "resource://testing-common/NimbusTestUtils.sys.mjs",
|
|
||||||
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
|
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
|
||||||
|
NimbusTestUtils: "resource://testing-common/NimbusTestUtils.sys.mjs",
|
||||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ add_task(async function remote_disable() {
|
|||||||
|
|
||||||
userChoiceStub.resetHistory();
|
userChoiceStub.resetHistory();
|
||||||
setDefaultStub.resetHistory();
|
setDefaultStub.resetHistory();
|
||||||
let doCleanup = await ExperimentFakes.enrollWithFeatureConfig(
|
let doCleanup = await NimbusTestUtils.enrollWithFeatureConfig(
|
||||||
{
|
{
|
||||||
featureId: NimbusFeatures.shellService.featureId,
|
featureId: NimbusFeatures.shellService.featureId,
|
||||||
value: {
|
value: {
|
||||||
@@ -116,7 +116,7 @@ add_task(async function ensure_fallback() {
|
|||||||
});
|
});
|
||||||
userChoiceStub.resetHistory();
|
userChoiceStub.resetHistory();
|
||||||
setDefaultStub.resetHistory();
|
setDefaultStub.resetHistory();
|
||||||
let doCleanup = await ExperimentFakes.enrollWithFeatureConfig(
|
let doCleanup = await NimbusTestUtils.enrollWithFeatureConfig(
|
||||||
{
|
{
|
||||||
featureId: NimbusFeatures.shellService.featureId,
|
featureId: NimbusFeatures.shellService.featureId,
|
||||||
value: {
|
value: {
|
||||||
@@ -146,7 +146,7 @@ add_task(async function ensure_fallback() {
|
|||||||
|
|
||||||
async function setUpNotificationTests(guidanceEnabled, oneClick) {
|
async function setUpNotificationTests(guidanceEnabled, oneClick) {
|
||||||
sinon.reset();
|
sinon.reset();
|
||||||
const experimentCleanup = await ExperimentFakes.enrollWithFeatureConfig(
|
const experimentCleanup = await NimbusTestUtils.enrollWithFeatureConfig(
|
||||||
{
|
{
|
||||||
featureId: NimbusFeatures.shellService.featureId,
|
featureId: NimbusFeatures.shellService.featureId,
|
||||||
value: {
|
value: {
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
ChromeUtils.defineESModuleGetters(this, {
|
ChromeUtils.defineESModuleGetters(this, {
|
||||||
ExperimentAPI: "resource://nimbus/ExperimentAPI.sys.mjs",
|
ExperimentAPI: "resource://nimbus/ExperimentAPI.sys.mjs",
|
||||||
ExperimentFakes: "resource://testing-common/NimbusTestUtils.sys.mjs",
|
|
||||||
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
|
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
|
||||||
|
NimbusTestUtils: "resource://testing-common/NimbusTestUtils.sys.mjs",
|
||||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ add_task(async function ready() {
|
|||||||
Assert.ok(AppConstants.platform == "win", "Platform is Windows");
|
Assert.ok(AppConstants.platform == "win", "Platform is Windows");
|
||||||
|
|
||||||
add_task(async function remoteEnableWithPDF() {
|
add_task(async function remoteEnableWithPDF() {
|
||||||
let doCleanup = await ExperimentFakes.enrollWithFeatureConfig(
|
let doCleanup = await NimbusTestUtils.enrollWithFeatureConfig(
|
||||||
{
|
{
|
||||||
featureId: NimbusFeatures.shellService.featureId,
|
featureId: NimbusFeatures.shellService.featureId,
|
||||||
value: {
|
value: {
|
||||||
@@ -89,7 +89,7 @@ add_task(async function remoteEnableWithPDF() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function remoteEnableWithPDF_testOnlyReplaceBrowsers() {
|
add_task(async function remoteEnableWithPDF_testOnlyReplaceBrowsers() {
|
||||||
let doCleanup = await ExperimentFakes.enrollWithFeatureConfig(
|
let doCleanup = await NimbusTestUtils.enrollWithFeatureConfig(
|
||||||
{
|
{
|
||||||
featureId: NimbusFeatures.shellService.featureId,
|
featureId: NimbusFeatures.shellService.featureId,
|
||||||
value: {
|
value: {
|
||||||
@@ -151,7 +151,7 @@ add_task(async function remoteEnableWithPDF_testOnlyReplaceBrowsers() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function remoteEnableWithoutPDF() {
|
add_task(async function remoteEnableWithoutPDF() {
|
||||||
let doCleanup = await ExperimentFakes.enrollWithFeatureConfig(
|
let doCleanup = await NimbusTestUtils.enrollWithFeatureConfig(
|
||||||
{
|
{
|
||||||
featureId: NimbusFeatures.shellService.featureId,
|
featureId: NimbusFeatures.shellService.featureId,
|
||||||
value: {
|
value: {
|
||||||
@@ -183,7 +183,7 @@ add_task(async function remoteEnableWithoutPDF() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function remoteDisable() {
|
add_task(async function remoteDisable() {
|
||||||
let doCleanup = await ExperimentFakes.enrollWithFeatureConfig(
|
let doCleanup = await NimbusTestUtils.enrollWithFeatureConfig(
|
||||||
{
|
{
|
||||||
featureId: NimbusFeatures.shellService.featureId,
|
featureId: NimbusFeatures.shellService.featureId,
|
||||||
value: {
|
value: {
|
||||||
|
|||||||
Reference in New Issue
Block a user