summaryrefslogtreecommitdiffstats
path: root/browser/components/tests/unit/test_browserGlue_migration_remove_pref.js
blob: 1178a2bd371fda16a8bfa539fbb2bf9defb99676 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

const gBrowserGlue = Cc["@mozilla.org/browser/browserglue;1"].getService(
  Ci.nsIObserver
);

add_setup(() => {
  registerCleanupFunction(() => {
    Services.prefs.clearUserPref("browser.fixup.alternate.enabled");
  });
});

add_task(async function browser_fixup_alternate_enabled() {
  Services.prefs.setBoolPref("browser.fixup.alternate.enabled", true);
  Services.prefs.setIntPref("browser.migration.version", 139);

  gBrowserGlue.observe(null, "browser-glue-test", "force-ui-migration");

  Assert.ok(
    !Services.prefs.getBoolPref("browser.fixup.alternate.enabled", false),
    "browser.fixup.alternate.enabled pref should be cleared"
  );
});