Skip to content

Commit 0b33c33

Browse files
committed
Bug 2036752: Use correct registry path for PreXULSkeletonUI in enterprise builds and allow skeleton UI when MOZ_BYPASS_FELT is set
1 parent 6077424 commit 0b33c33

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

browser/base/content/test/startup/browser_preXULSkeletonUIRegistry.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ ChromeUtils.defineESModuleGetters(this, {
22
WindowsRegistry: "resource://gre/modules/WindowsRegistry.sys.mjs",
33
});
44

5+
const kRegPath = AppConstants.MOZ_ENTERPRISE
6+
? "Software\\Mozilla\\FirefoxEnterprise\\PreXULSkeletonUISettings"
7+
: "Software\\Mozilla\\Firefox\\PreXULSkeletonUISettings";
8+
59
function getFirefoxExecutableFile() {
610
let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
711
file = Services.dirsvc.get("GreBinD", Ci.nsIFile);
@@ -56,15 +60,15 @@ add_task(async function testWritesEnabledOnPrefChange() {
5660
const firefoxPath = getFirefoxExecutableFile().path;
5761
let enabled = WindowsRegistry.readRegKey(
5862
Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
59-
"Software\\Mozilla\\Firefox\\PreXULSkeletonUISettings",
63+
kRegPath,
6064
`${firefoxPath}|Enabled`
6165
);
6266
is(enabled, 1, "Pre-XUL skeleton UI is enabled in the Windows registry");
6367

6468
Services.prefs.setBoolPref("browser.startup.preXulSkeletonUI", false);
6569
enabled = WindowsRegistry.readRegKey(
6670
Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
67-
"Software\\Mozilla\\Firefox\\PreXULSkeletonUISettings",
71+
kRegPath,
6872
`${firefoxPath}|Enabled`
6973
);
7074
is(enabled, 0, "Pre-XUL skeleton UI is disabled in the Windows registry");
@@ -73,7 +77,7 @@ add_task(async function testWritesEnabledOnPrefChange() {
7377
Services.prefs.setIntPref("browser.tabs.inTitlebar", 0);
7478
enabled = WindowsRegistry.readRegKey(
7579
Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
76-
"Software\\Mozilla\\Firefox\\PreXULSkeletonUISettings",
80+
kRegPath,
7781
`${firefoxPath}|Enabled`
7882
);
7983
is(enabled, 0, "Pre-XUL skeleton UI is disabled in the Windows registry");
@@ -106,7 +110,7 @@ add_task(async function testPersistsNecessaryValuesOnChange() {
106110
for (let key of regKeys) {
107111
WindowsRegistry.removeRegKey(
108112
Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
109-
"Software\\Mozilla\\Firefox\\PreXULSkeletonUISettings",
113+
kRegPath,
110114
key
111115
);
112116
}
@@ -116,7 +120,7 @@ add_task(async function testPersistsNecessaryValuesOnChange() {
116120
for (let key of regKeys) {
117121
let value = readRegKeyExtended(
118122
Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
119-
"Software\\Mozilla\\Firefox\\PreXULSkeletonUISettings",
123+
kRegPath,
120124
`${firefoxPath}|${key}`
121125
);
122126
isnot(

mozglue/misc/PreXULSkeletonUI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1663,7 +1663,7 @@ static Result<Ok, PreXULSkeletonUIError> ValidateCmdlineArguments(
16631663
// PreXULSkeletonUI is kept for normal browser, just disabled for FELT
16641664
// window.
16651665
#if defined(MOZ_ENTERPRISE)
1666-
if (!hasFeltFlag) {
1666+
if (!hasFeltFlag && !EnvHasValue("MOZ_BYPASS_FELT")) {
16671667
return Err(PreXULSkeletonUIError::Cmdline);
16681668
}
16691669
#endif

0 commit comments

Comments
 (0)