From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- .../extensions/test/xpcshell/test_corrupt.js | 4 ++-- .../test_system_update_enterprisepolicy.js | 26 +++++++++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) (limited to 'toolkit/mozapps/extensions/test/xpcshell') diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_corrupt.js b/toolkit/mozapps/extensions/test/xpcshell/test_corrupt.js index 727c643763..33e81c13bd 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_corrupt.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_corrupt.js @@ -196,7 +196,7 @@ add_task(async function test_after_corruption() { await Assert.rejects( promiseShutdownManager(), - /NotAllowedError: Could not open the file at .+ for writing/ + /NotAllowedError: Could not write to `.+'/ ); }); @@ -211,6 +211,6 @@ add_task(async function test_after_second_restart() { await Assert.rejects( promiseShutdownManager(), - /NotAllowedError: Could not open the file at .+ for writing/ + /NotAllowedError: Could not write to `.+'/ ); }); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_system_update_enterprisepolicy.js b/toolkit/mozapps/extensions/test/xpcshell/test_system_update_enterprisepolicy.js index d36b97a3cc..e25890515f 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_system_update_enterprisepolicy.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_system_update_enterprisepolicy.js @@ -44,12 +44,32 @@ const TEST_CONDITIONS = { add_task(async function test_update_disabled_by_policy() { await setupSystemAddonConditions(TEST_CONDITIONS, distroDir); + const TEST_POLICY_DATA = { + DisableSystemAddonUpdate: true, + }; await EnterprisePolicyTesting.setupPolicyEngineWithJson({ - policies: { - DisableSystemAddonUpdate: true, - }, + policies: TEST_POLICY_DATA, }); + Assert.deepEqual( + Services.policies.getActivePolicies(), + TEST_POLICY_DATA, + "Got the expected test policy data as the active policy " + + "(if this assertions fails, check your system for enterprise policies installed at system level)" + ); + + Assert.equal( + Services.policies.isAllowed("SysAddonUpdate"), + false, + "Expected SysAddonUpdate feature to be disabled by policies" + ); + + Assert.equal( + Services.prefs.getBoolPref("extensions.systemAddon.update.enabled"), + true, + "Expected system addon updates to not be already disabled through prefs" + ); + await updateAllSystemAddons( buildSystemAddonUpdates([ { -- cgit v1.2.3