Skip to content

Commit 692919a

Browse files
author
agoloman
committed
Revert "Bug 1996449 - Ensure runOncePerModification("displayMenuBar", ..) works as expected. r=mkaply,mossop" for causing bc failures @browser_policy_display_menu.js.
This reverts commit 0df9ebb.
1 parent 0df9ebb commit 692919a

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

browser/components/enterprisepolicies/Policies.sys.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3177,8 +3177,6 @@ export function runOnce(actionName, callback) {
31773177
* A promise that will resolve once the callback finishes running.
31783178
*/
31793179
async function runOncePerModification(actionName, policyValue, callback) {
3180-
// Stringify the value so that it matches what we'd get from getStringPref.
3181-
policyValue = policyValue + "";
31823180
let prefName = `browser.policies.runOncePerModification.${actionName}`;
31833181
let oldPolicyValue = Services.prefs.getStringPref(prefName, undefined);
31843182
if (policyValue === oldPolicyValue) {

browser/components/enterprisepolicies/tests/browser/browser_policy_display_menu.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,11 @@ add_task(async function test_menu_shown_string() {
2828

2929
// Since testing will apply the policy after the browser has already started,
3030
// we will need to open a new window to actually see the menu bar
31-
{
32-
let newWin = await BrowserTestUtils.openNewBrowserWindow();
33-
let menubar = newWin.document.getElementById("toolbar-menubar");
34-
ok(!menubar.hasAttribute("autohide"), "The menu bar should not be hidden");
35-
setToolbarVisibility(menubar, false);
36-
ok(menubar.hasAttribute("autohide"), "The menu bar should be hidden");
37-
await BrowserTestUtils.closeWindow(newWin);
38-
}
31+
let newWin = await BrowserTestUtils.openNewBrowserWindow();
32+
let menubar = newWin.document.getElementById("toolbar-menubar");
33+
ok(!menubar.hasAttribute("autohide"), "The menu bar should not be hidden");
3934

40-
{
41-
// Make sure the menubar autohide persists even tho it's default-on.
42-
let newWin = await BrowserTestUtils.openNewBrowserWindow();
43-
let menubar = newWin.document.getElementById("toolbar-menubar");
44-
ok(menubar.hasAttribute("autohide"), "The menu bar should be hidden");
45-
await BrowserTestUtils.closeWindow(newWin);
46-
}
35+
await BrowserTestUtils.closeWindow(newWin);
4736
});
4837

4938
add_task(async function test_menubar_on() {

0 commit comments

Comments
 (0)