Bug 1685123 - Throw errors for “content_security_policy” manifest property with invalid types r=robwu

This change is required to allow throwing errors for the sandbox CSP implementation

Differential Revision: https://phabricator.services.mozilla.com/D309522
This commit is contained in:
Robbendebiene
2026-07-07 21:10:15 +00:00
committed by rob@robwu.nl
parent cbfbb76471
commit 83d64ccda0
2 changed files with 10 additions and 11 deletions
@@ -213,7 +213,6 @@
"content_security_policy": {
"optional": true,
"onError": "warn",
"choices": [
{
"max_manifest_version": 2,
@@ -46,12 +46,12 @@ add_task(async function test_manifest_csp() {
});
ExtensionTestUtils.failOnSchemaWarnings(true);
Assert.deepEqual(normalized.errors, [], "Should have no warnings");
Assert.deepEqual(
normalized.errors,
[
`Error processing content_security_policy: Expected string instead of {"extension_pages":"script-src 'self'; object-src 'none'"}`,
],
"Should have the expected warning"
normalized.error,
`Error processing content_security_policy: Expected string instead of {"extension_pages":"script-src 'self'; object-src 'none'"}`,
"Should have the expected error"
);
});
@@ -63,12 +63,12 @@ add_task(async function test_manifest_csp_v3() {
});
ExtensionTestUtils.failOnSchemaWarnings(true);
Assert.deepEqual(normalized.errors, [], "Should have no warnings");
Assert.deepEqual(
normalized.errors,
[
`Error processing content_security_policy: Expected object instead of "script-src 'self'; object-src 'none'"`,
],
"Should have the expected warning"
normalized.error,
`Error processing content_security_policy: Expected object instead of "script-src 'self'; object-src 'none'"`,
"Should have the expected error"
);
normalized = await ExtensionTestUtils.normalizeManifest({