tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 0edd3d1a9ed2d159b4eeed7c5f7b25951cdd1249
parent aca2beb437d95ae9ba7371a8cc41daba40f93e3d
Author: Sandor Molnar <smolnar@mozilla.com>
Date:   Sat, 10 Jan 2026 00:40:15 +0200

Revert "Bug 2003349 - Hide rollouts from about:studies unless nimbus.debug=true r=nimbus-reviewers,relud" for causing xpc failures @ test_sorted_alphabetically.js

This reverts commit 5a5d32606016abf413fe9091dce3d2e90777938b.

Diffstat:
Mtoolkit/components/normandy/content/AboutPages.sys.mjs | 6+-----
Mtoolkit/components/normandy/test/browser/browser_about_studies.js | 57++++++++-------------------------------------------------
2 files changed, 9 insertions(+), 54 deletions(-)

diff --git a/toolkit/components/normandy/content/AboutPages.sys.mjs b/toolkit/components/normandy/content/AboutPages.sys.mjs @@ -102,15 +102,11 @@ ChromeUtils.defineLazyGetter(AboutPages, "aboutStudies", () => { }, getMessagingSystemList() { - const debugEnabled = Services.prefs.getBoolPref("nimbus.debug"); - // Do not include Firefox Labs. Those are shown on // about:preferences#experimental. - // - // Only show Rollouts if nimbus.debug is enabled. return lazy.ExperimentAPI.manager.store .getAll() - .filter(e => !e.isFirefoxLabsOptIn && (debugEnabled || !e.isRollout)); + .filter(e => !e.isFirefoxLabsOptIn); }, async optInToExperiment(data) { diff --git a/toolkit/components/normandy/test/browser/browser_about_studies.js b/toolkit/components/normandy/test/browser/browser_about_studies.js @@ -741,12 +741,10 @@ add_task(async function test_nimbus_about_studies_rollout() { return content.document.querySelectorAll(".study-name").length; }); // Make sure strings are properly shown - Assert.equal(studyCount, 0, "Rollout not loaded in non-debug mode"); + Assert.equal(studyCount, 1, "Rollout loaded in non-debug mode"); } ); - await SpecialPowers.pushPrefEnv({ - set: [["nimbus.debug", true]], - }); + Services.prefs.setBoolPref("nimbus.debug", true); await BrowserTestUtils.withNewTab( { gBrowser, url: "about:studies" }, async browser => { @@ -787,7 +785,7 @@ add_task(async function test_nimbus_about_studies_rollout() { ); // Cleanup for multiple test runs await NimbusTestUtils.assert.storeIsEmpty(ExperimentAPI.manager.store); - await SpecialPowers.popPrefEnv(); + Services.prefs.clearUserPref("nimbus.debug"); }); add_task(async function test_getStudiesEnabled() { @@ -872,7 +870,7 @@ add_task(async function test_forceEnroll() { sandbox.restore(); }); -add_task(async function test_inactive_rollouts_not_under_completed_studies() { +add_task(async function test_inactive_rollouts_under_completed_studies() { // Adds an active experiment and rollout const experiment = NimbusTestUtils.factories.recipe("my-testing-experiment"); const rollout = NimbusTestUtils.factories.recipe("my-testing-rollout", { @@ -906,12 +904,12 @@ add_task(async function test_inactive_rollouts_not_under_completed_studies() { "active list should include enrolled experiment" ); Assert.ok( - !activeListItems.includes(rollout.slug), + activeListItems.includes(rollout.slug), "active list should include enrolled rollout" ); Assert.equal( activeListItems.length, - 1, + 2, "should be 2 elements in active list" ); } @@ -944,56 +942,17 @@ add_task(async function test_inactive_rollouts_not_under_completed_studies() { "inactive list should include unenrolled experiment" ); Assert.ok( - !inactiveListItems.includes(rollout.slug), - "inactive list should not include unenrolled rollout" - ); - Assert.equal( - inactiveListItems.length, - 1, - "should be 2 items in inactive list" - ); - } - ); - - await SpecialPowers.pushPrefEnv({ - set: [["nimbus.debug", true]], - }); - - await BrowserTestUtils.withNewTab( - { gBrowser, url: "about:studies" }, - async browser => { - const inactiveListItems = await SpecialPowers.spawn( - browser, - [], - async () => { - await ContentTaskUtils.waitForCondition( - () => content.document.querySelector(".nimbus.disabled"), - "waiting for the experiment to become disabled" - ); - return Array.from( - content.document.querySelectorAll("ul.inactive-study-list li") - ).map(el => el.dataset.studySlug); - } - ); - - Assert.ok( - inactiveListItems.includes(experiment.slug), - "inactive list should include unenrolled experiment" - ); - Assert.ok( inactiveListItems.includes(rollout.slug), - "inactive list should include unenrolled rollout in debug" + "inactive list should include unenrolled rollout" ); Assert.equal( inactiveListItems.length, 2, - "should be 2 items in inactive list in debug" + "should be 2 items in inactive list" ); } ); - await SpecialPowers.popPrefEnv(); - // Cleanup for multiple test runs await NimbusTestUtils.assert.storeIsEmpty(ExperimentAPI.manager.store); });