Issue #2466 - Part 1: Reduce nsContentPolicy type usage.

Use CSPDirective instead, since it directly deals with CSP anyway.
This cleanup prepares for the following changes.
This commit is contained in:
Moonchild 2024-02-04 00:33:43 +01:00 committed by roytam1
commit 4ea2206c15
10 changed files with 43 additions and 105 deletions

View file

@ -215,7 +215,7 @@ function run_test() {
function(csp) {
var uri = NetUtil
// shouldLoad creates and sends out the report here.
csp.shouldLoad(Ci.nsIContentPolicy.TYPE_SCRIPT,
csp.shouldLoad(Ci.nsIContentSecurityPolicy.SCRIPT_SRC_DIRECTIVE,
NetUtil.newURI(selfSpec + "#bar"),
null, null, null, null);
});
@ -224,7 +224,7 @@ function run_test() {
makeTest(8, {"blocked-uri": "ftp://blocked.test"}, false,
function(csp) {
// shouldLoad creates and sends out the report here.
csp.shouldLoad(Ci.nsIContentPolicy.TYPE_SCRIPT,
csp.shouldLoad(Ci.nsIContentSecurityPolicy.SCRIPT_SRC_DIRECTIVE,
NetUtil.newURI("ftp://blocked.test/profile.png"),
null, null, null, null);
});