summaryrefslogtreecommitdiffstats
path: root/browser/components/enterprisepolicies/tests/xpcshell/test_containers.js
blob: 0f6a0190ac11b17fce5d67870f1c4b2a043286be (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
27
28
29
30
31
32
33
34
35
36
37
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

ChromeUtils.defineESModuleGetters(this, {
  ContextualIdentityService:
    "resource://gre/modules/ContextualIdentityService.sys.mjs",
});

add_task(async function setup() {
  Services.prefs.setBoolPref("privacy.userContext.enabled", true);
  do_get_profile();
});

add_task(async function test_containers_default() {
  await setupPolicyEngineWithJson({
    policies: {
      Containers: {
        Default: [
          {
            name: "Test Container",
            icon: "cart",
            color: "orange",
          },
        ],
      },
    },
  });
  let identities = ContextualIdentityService.getPublicIdentities();
  equal(identities.length, 1);
  ContextualIdentityService.getPublicIdentities().forEach(identity => {
    equal(identity.name, "Test Container");
    equal(identity.icon, "cart");
    equal(identity.color, "orange");
  });
});