commit 692919af61da66514a1a3495d6e8afe0a5fa3712
parent 0df9ebba38e667abd4fb76adf2861d7e85c74b33
Author: agoloman <agoloman@mozilla.com>
Date: Sat, 8 Nov 2025 14:27:18 +0200
Revert "Bug 1996449 - Ensure runOncePerModification("displayMenuBar", ..) works as expected. r=mkaply,mossop" for causing bc failures @browser_policy_display_menu.js.
This reverts commit 0df9ebba38e667abd4fb76adf2861d7e85c74b33.
Diffstat:
2 files changed, 4 insertions(+), 17 deletions(-)
diff --git a/browser/components/enterprisepolicies/Policies.sys.mjs b/browser/components/enterprisepolicies/Policies.sys.mjs
@@ -3177,8 +3177,6 @@ export function runOnce(actionName, callback) {
* A promise that will resolve once the callback finishes running.
*/
async function runOncePerModification(actionName, policyValue, callback) {
- // Stringify the value so that it matches what we'd get from getStringPref.
- policyValue = policyValue + "";
let prefName = `browser.policies.runOncePerModification.${actionName}`;
let oldPolicyValue = Services.prefs.getStringPref(prefName, undefined);
if (policyValue === oldPolicyValue) {
diff --git a/browser/components/enterprisepolicies/tests/browser/browser_policy_display_menu.js b/browser/components/enterprisepolicies/tests/browser/browser_policy_display_menu.js
@@ -28,22 +28,11 @@ add_task(async function test_menu_shown_string() {
// Since testing will apply the policy after the browser has already started,
// we will need to open a new window to actually see the menu bar
- {
- let newWin = await BrowserTestUtils.openNewBrowserWindow();
- let menubar = newWin.document.getElementById("toolbar-menubar");
- ok(!menubar.hasAttribute("autohide"), "The menu bar should not be hidden");
- setToolbarVisibility(menubar, false);
- ok(menubar.hasAttribute("autohide"), "The menu bar should be hidden");
- await BrowserTestUtils.closeWindow(newWin);
- }
+ let newWin = await BrowserTestUtils.openNewBrowserWindow();
+ let menubar = newWin.document.getElementById("toolbar-menubar");
+ ok(!menubar.hasAttribute("autohide"), "The menu bar should not be hidden");
- {
- // Make sure the menubar autohide persists even tho it's default-on.
- let newWin = await BrowserTestUtils.openNewBrowserWindow();
- let menubar = newWin.document.getElementById("toolbar-menubar");
- ok(menubar.hasAttribute("autohide"), "The menu bar should be hidden");
- await BrowserTestUtils.closeWindow(newWin);
- }
+ await BrowserTestUtils.closeWindow(newWin);
});
add_task(async function test_menubar_on() {