tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_containers.js (978B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 ChromeUtils.defineESModuleGetters(this, {
      7  ContextualIdentityService:
      8    "resource://gre/modules/ContextualIdentityService.sys.mjs",
      9 });
     10 
     11 add_task(async function setup() {
     12  Services.prefs.setBoolPref("privacy.userContext.enabled", true);
     13  do_get_profile();
     14 });
     15 
     16 add_task(async function test_containers_default() {
     17  await setupPolicyEngineWithJson({
     18    policies: {
     19      Containers: {
     20        Default: [
     21          {
     22            name: "Test Container",
     23            icon: "cart",
     24            color: "orange",
     25          },
     26        ],
     27      },
     28    },
     29  });
     30  let identities = ContextualIdentityService.getPublicIdentities();
     31  equal(identities.length, 1);
     32  ContextualIdentityService.getPublicIdentities().forEach(identity => {
     33    equal(identity.name, "Test Container");
     34    equal(identity.icon, "cart");
     35    equal(identity.color, "orange");
     36  });
     37 });