commit 05e7955bf8563ca4d8d71c3495587e60c6a6b3a5
parent 3225a787fef10e7f338a2bc527299c369b930414
Author: Rebecca King <rking@mozilla.com>
Date: Fri, 19 Dec 2025 20:24:48 +0000
Bug 2006365 - Remove dependency on variant pref for Firefox VPN section in about:settings - r=ip-protection-reviewers,akulyk,fchasen
Differential Revision: https://phabricator.services.mozilla.com/D277036
Diffstat:
4 files changed, 21 insertions(+), 26 deletions(-)
diff --git a/browser/components/preferences/privacy.js b/browser/components/preferences/privacy.js
@@ -200,7 +200,7 @@ Preferences.addAll([
{ id: "privacy.globalprivacycontrol.enabled", type: "bool" },
// Firefox VPN
- { id: "browser.ipProtection.variant", type: "string" },
+ { id: "browser.ipProtection.enabled", type: "bool" },
{ id: "browser.ipProtection.features.siteExceptions", type: "bool" },
{ id: "browser.ipProtection.features.autoStart", type: "bool" },
{ id: "browser.ipProtection.autoStartEnabled", type: "bool" },
@@ -1417,8 +1417,7 @@ Preferences.addSetting({
Preferences.addSetting({
id: "ipProtectionVisible",
- pref: "browser.ipProtection.variant",
- get: prefVal => prefVal == "beta",
+ pref: "browser.ipProtection.enabled",
});
Preferences.addSetting({
id: "ipProtectionSiteExceptionsFeatureEnabled",
diff --git a/browser/components/preferences/tests/browser_bug731866.js b/browser/components/preferences/tests/browser_bug731866.js
@@ -11,8 +11,9 @@ const backupSectionDisabled = !(
SpecialPowers.getBoolPref("browser.backup.archive.enabled") ||
SpecialPowers.getBoolPref("browser.backup.restore.enabled")
);
-const ipProtectionExperiment = SpecialPowers.getStringPref(
- "browser.ipProtection.variant"
+const ipProtectionEnabled = SpecialPowers.getBoolPref(
+ "browser.ipProtection.enabled",
+ false
);
const profilesGroupDisabled = !SelectableProfileService.isEnabled;
const updatePrefContainers = ["updatesCategory", "updateApp"];
@@ -83,11 +84,8 @@ function checkElements(expectedPane) {
continue;
}
- // IP Protection is only enabled by browser.ipProtection.variant = beta
- if (
- element.id === "dataIPProtectionGroup" &&
- ipProtectionExperiment !== "beta"
- ) {
+ // IP Protection section is gated by browser.ipProtection.enabled
+ if (element.id === "dataIPProtectionGroup" && !ipProtectionEnabled) {
is_element_hidden(element, "Disabled ipProtection should be hidden");
continue;
}
diff --git a/browser/components/preferences/tests/browser_bug795764_cachedisabled.js b/browser/components/preferences/tests/browser_bug795764_cachedisabled.js
@@ -25,8 +25,9 @@ function test() {
}
async function runTest(win) {
- const ipProtectionExperiment = SpecialPowers.getStringPref(
- "browser.ipProtection.variant"
+ const ipProtectionEnabled = SpecialPowers.getBoolPref(
+ "browser.ipProtection.enabled",
+ false
);
is(gBrowser.currentURI.spec, "about:preferences", "about:preferences loaded");
@@ -44,11 +45,8 @@ async function runTest(win) {
continue;
}
- // IP Protection is only enabled by browser.ipProtection.variant = beta
- if (
- element.id === "dataIPProtectionGroup" &&
- ipProtectionExperiment !== "beta"
- ) {
+ // IP Protection section is gated by browser.ipProtection.enabled
+ if (element.id === "dataIPProtectionGroup" && !ipProtectionEnabled) {
is_element_hidden(element, "Disabled ipProtection should be hidden");
continue;
}
diff --git a/browser/components/preferences/tests/browser_privacy_ipprotection.js b/browser/components/preferences/tests/browser_privacy_ipprotection.js
@@ -5,7 +5,7 @@
"use strict";
-const FEATURE_PREF = "browser.ipProtection.variant";
+const FEATURE_PREF = "browser.ipProtection.enabled";
const SITE_EXCEPTIONS_FEATURE_PREF =
"browser.ipProtection.features.siteExceptions";
const AUTOSTART_FEATURE_ENABLED_PREF =
@@ -18,7 +18,7 @@ const ONBOARDING_MESSAGE_MASK_PREF =
const SECTION_ID = "dataIPProtectionGroup";
async function setupVpnPrefs({
- feature,
+ feature = false,
siteExceptions = false,
autostartFeatureEnabled = false,
autostart = false,
@@ -46,10 +46,10 @@ function testSettingsGroupVisible(browser, sectionId) {
return settingGroup;
}
-// Test the section is hidden on page load if the variant pref is set to an ineligible experiment.
+// Test the section is hidden on page load if the feature pref is disabled.
add_task(
async function test_section_removed_when_set_to_ineligible_experiment_pref() {
- await setupVpnPrefs({ feature: "alpha" });
+ await setupVpnPrefs({ feature: false });
await BrowserTestUtils.withNewTab(
{ gBrowser, url: "about:preferences#privacy" },
@@ -63,10 +63,10 @@ add_task(
}
);
-// Test the section is shown on page load if the variant pref is set to an eligible experiment
+// Test the section is shown on page load if the feature pref is enabled
add_task(
async function test_section_shown_when_set_to_eligible_experiment_pref() {
- await setupVpnPrefs({ feature: "beta" });
+ await setupVpnPrefs({ feature: true });
await BrowserTestUtils.withNewTab(
{ gBrowser, url: "about:preferences#privacy" },
@@ -79,7 +79,7 @@ add_task(
// Test the site exceptions controls load correctly.
add_task(async function test_exceptions_settings() {
- await setupVpnPrefs({ feature: "beta", siteExceptions: true });
+ await setupVpnPrefs({ feature: true, siteExceptions: true });
await BrowserTestUtils.withNewTab(
{ gBrowser, url: "about:preferences#privacy" },
@@ -204,7 +204,7 @@ add_task(async function test_exclusions_add_button() {
// Test that autostart checkboxes exist and map to the correct preferences
add_task(async function test_autostart_checkboxes() {
await setupVpnPrefs({
- feature: "beta",
+ feature: true,
autostartFeatureEnabled: true,
autostart: true,
autostartprivate: true,
@@ -244,7 +244,7 @@ add_task(async function test_autostart_checkboxes() {
// Test that additional links exist
add_task(async function test_additional_links() {
await setupVpnPrefs({
- feature: "beta",
+ feature: true,
});
await BrowserTestUtils.withNewTab(