mirror of
https://github.com/mozilla-firefox/firefox
synced 2026-08-12 12:35:33 +00:00
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:
committed by
rob@robwu.nl
parent
cbfbb76471
commit
83d64ccda0
@@ -213,7 +213,6 @@
|
||||
|
||||
"content_security_policy": {
|
||||
"optional": true,
|
||||
"onError": "warn",
|
||||
"choices": [
|
||||
{
|
||||
"max_manifest_version": 2,
|
||||
|
||||
+10
-10
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user