From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../tests/xpcshell/test_containers.js | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 browser/components/enterprisepolicies/tests/xpcshell/test_containers.js (limited to 'browser/components/enterprisepolicies/tests/xpcshell/test_containers.js') diff --git a/browser/components/enterprisepolicies/tests/xpcshell/test_containers.js b/browser/components/enterprisepolicies/tests/xpcshell/test_containers.js new file mode 100644 index 0000000000..0f6a0190ac --- /dev/null +++ b/browser/components/enterprisepolicies/tests/xpcshell/test_containers.js @@ -0,0 +1,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"); + }); +}); -- cgit v1.2.3