blob: 547f5e75981e0e35eca764e0d46e9b67b976391c (
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
add_task(async function test_active_policies() {
await setupPolicyEngineWithJson({
policies: {
DisablePrivateBrowsing: true,
},
});
let expected = {
DisablePrivateBrowsing: true,
};
Assert.deepEqual(
await Services.policies.getActivePolicies(),
expected,
"Active policies parsed correctly"
);
});
add_task(async function test_wrong_policies() {
await setupPolicyEngineWithJson({
policies: {
BlockAboutSupport: [true],
},
});
let expected = {};
Assert.deepEqual(
await Services.policies.getActivePolicies(),
expected,
"Wrong policies ignored"
);
});
add_task(async function test_content_process() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], function () {
try {
Services.policies.getActivePolicies();
} catch (ex) {
is(
ex.result,
Cr.NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED,
"Function getActivePolicies() doesn't have a valid definition in the content process"
);
}
});
});
|