From 5a6f848c3883b331667daaaa3b960e314d546d27 Mon Sep 17 00:00:00 2001 From: Daniel Thorn Date: Fri, 9 May 2025 18:06:54 +0000 Subject: [PATCH] Bug 1959483 - Port tests from ExperimentFakes and ExperimentTestUtils to NimbusTestUtils in browser/components/genai r=nimbus-reviewers,firefox-ai-ml-reviewers,beth,Mardak Differential Revision: https://phabricator.services.mozilla.com/D247008 --- .../genai/tests/browser/browser_chat_nimbus.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/browser/components/genai/tests/browser/browser_chat_nimbus.js b/browser/components/genai/tests/browser/browser_chat_nimbus.js index a66143f24bcb..cccc8924dcaf 100644 --- a/browser/components/genai/tests/browser/browser_chat_nimbus.js +++ b/browser/components/genai/tests/browser/browser_chat_nimbus.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -const { ExperimentFakes } = ChromeUtils.importESModule( +const { NimbusTestUtils } = ChromeUtils.importESModule( "resource://testing-common/NimbusTestUtils.sys.mjs" ); @@ -18,7 +18,7 @@ add_task(async function test_nimbus_user_prefs() { "No user nimbus pref yet" ); - let cleanup = await ExperimentFakes.enrollWithFeatureConfig({ + let cleanup = await NimbusTestUtils.enrollWithFeatureConfig({ featureId: "chatbot", value: { prefs: { @@ -54,7 +54,7 @@ add_task(async function test_nimbus_user_prefs() { "sidebar used default value" ); - cleanup = await ExperimentFakes.enrollWithFeatureConfig({ + cleanup = await NimbusTestUtils.enrollWithFeatureConfig({ featureId: "chatbot", value: { prefs: { @@ -92,7 +92,7 @@ add_task(async function test_nimbus_default_prefs() { "sidebar used default value" ); - const cleanup = await ExperimentFakes.enrollWithFeatureConfig({ + const cleanup = await NimbusTestUtils.enrollWithFeatureConfig({ featureId: "chatbot", value: { prefs: { @@ -118,7 +118,7 @@ add_task(async function test_nimbus_default_prefs() { add_task(async function test_nimbus_rollout_experiment() { const foo = "browser.ml.chat.foo"; const nimbus = "browser.ml.chat.nimbus"; - const cleanRollout = await ExperimentFakes.enrollWithFeatureConfig( + const cleanRollout = await NimbusTestUtils.enrollWithFeatureConfig( { featureId: "chatbot", value: { @@ -138,7 +138,7 @@ add_task(async function test_nimbus_rollout_experiment() { const nimbusValue = Services.prefs.getStringPref(nimbus); Assert.ok(nimbusValue, "Set some nimbus slug"); - const cleanExperiment = await ExperimentFakes.enrollWithFeatureConfig({ + const cleanExperiment = await NimbusTestUtils.enrollWithFeatureConfig({ featureId: "chatbot", value: { prefs: { @@ -170,7 +170,7 @@ add_task(async function test_nimbus_rollout_experiment() { add_task(async function test_nimbus_minimum_version() { const foo = "browser.ml.chat.foo"; const nimbus = "browser.ml.chat.nimbus"; - let cleanup = await ExperimentFakes.enrollWithFeatureConfig({ + let cleanup = await NimbusTestUtils.enrollWithFeatureConfig({ featureId: "chatbot", value: { minVersion: AppConstants.MOZ_APP_VERSION_DISPLAY + ".1", @@ -188,7 +188,7 @@ add_task(async function test_nimbus_minimum_version() { cleanup(); - cleanup = await ExperimentFakes.enrollWithFeatureConfig({ + cleanup = await NimbusTestUtils.enrollWithFeatureConfig({ featureId: "chatbot", value: { minVersion: AppConstants.MOZ_APP_VERSION_DISPLAY,