diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /testing/web-platform/tests/content-security-policy | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/content-security-policy')
-rw-r--r-- | testing/web-platform/tests/content-security-policy/securitypolicyviolation/constructor-required-fields.html | 213 |
1 files changed, 103 insertions, 110 deletions
diff --git a/testing/web-platform/tests/content-security-policy/securitypolicyviolation/constructor-required-fields.html b/testing/web-platform/tests/content-security-policy/securitypolicyviolation/constructor-required-fields.html index 1a090d8e2c..1f30e38b0c 100644 --- a/testing/web-platform/tests/content-security-policy/securitypolicyviolation/constructor-required-fields.html +++ b/testing/web-platform/tests/content-security-policy/securitypolicyviolation/constructor-required-fields.html @@ -25,118 +25,111 @@ }), undefined); }, "SecurityPolicyViolationEvent constructor works with an init dict"); - // missing required members + // missing optional members test(function() { - assert_throws_js(TypeError, - function() { new SecurityPolicyViolationEvent("securitypolicyviolation", { - // documentURI: "http://example.com", - referrer: "http://example.com", - blockedURI: "http://example.com", - violatedDirective: "default-src", - effectiveDirective: "default-src", - originalPolicy: "default-src 'none'", - sourceFile: "example.js", - sample: "<script>alert('1');</scr" + "ipt>", - disposition: "enforce", - statusCode: 200, - lineNumber: 1, - columnNumber: 1, - })}); - }, "SecurityPolicyViolationEvent constructor requires documentURI"); + assert_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { + // documentURI: "http://example.com", + referrer: "http://example.com", + blockedURI: "http://example.com", + violatedDirective: "default-src", + effectiveDirective: "default-src", + originalPolicy: "default-src 'none'", + sourceFile: "example.js", + sample: "<script>alert('1');</scr" + "ipt>", + disposition: "enforce", + statusCode: 200, + lineNumber: 1, + columnNumber: 1, + }).documentURI, ""); + }, "SecurityPolicyViolationEvent constructor does not require documentURI"); test(function() { - assert_throws_js(TypeError, - function() { new SecurityPolicyViolationEvent("securitypolicyviolation", { - documentURI: "http://example.com", - referrer: "http://example.com", - blockedURI: "http://example.com", - // violatedDirective: "default-src", - effectiveDirective: "default-src", - originalPolicy: "default-src 'none'", - sourceFile: "example.js", - sample: "<script>alert('1');</scr" + "ipt>", - disposition: "enforce", - statusCode: 200, - lineNumber: 1, - columnNumber: 1, - })}); - }, "SecurityPolicyViolationEvent constructor requires violatedDirective"); + assert_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { + documentURI: "http://example.com", + referrer: "http://example.com", + blockedURI: "http://example.com", + // violatedDirective: "default-src", + effectiveDirective: "default-src", + originalPolicy: "default-src 'none'", + sourceFile: "example.js", + sample: "<script>alert('1');</scr" + "ipt>", + disposition: "enforce", + statusCode: 200, + lineNumber: 1, + columnNumber: 1, + }).violatedDirective, ""); + }, "SecurityPolicyViolationEvent constructor does not require violatedDirective"); test(function() { - assert_throws_js(TypeError, - function() { new SecurityPolicyViolationEvent("securitypolicyviolation", { - documentURI: "http://example.com", - referrer: "http://example.com", - blockedURI: "http://example.com", - violatedDirective: "default-src", - // effectiveDirective: "default-src", - originalPolicy: "default-src 'none'", - sourceFile: "example.js", - sample: "<script>alert('1');</scr" + "ipt>", - disposition: "enforce", - statusCode: 200, - lineNumber: 1, - columnNumber: 1, - })}); - }, "SecurityPolicyViolationEvent constructor requires effectiveDirective"); + assert_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { + documentURI: "http://example.com", + referrer: "http://example.com", + blockedURI: "http://example.com", + violatedDirective: "default-src", + // effectiveDirective: "default-src", + originalPolicy: "default-src 'none'", + sourceFile: "example.js", + sample: "<script>alert('1');</scr" + "ipt>", + disposition: "enforce", + statusCode: 200, + lineNumber: 1, + columnNumber: 1, + }).effectiveDirective, ""); + }, "SecurityPolicyViolationEvent constructor does not require effectiveDirective"); test(function() { - assert_throws_js(TypeError, - function() { new SecurityPolicyViolationEvent("securitypolicyviolation", { - documentURI: "http://example.com", - referrer: "http://example.com", - blockedURI: "http://example.com", - violatedDirective: "default-src", - effectiveDirective: "default-src", - // originalPolicy: "default-src 'none'", - sourceFile: "example.js", - sample: "<script>alert('1');</scr" + "ipt>", - disposition: "enforce", - statusCode: 200, - lineNumber: 1, - columnNumber: 1, - })}); - }, "SecurityPolicyViolationEvent constructor requires originalPolicy"); + assert_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { + documentURI: "http://example.com", + referrer: "http://example.com", + blockedURI: "http://example.com", + violatedDirective: "default-src", + effectiveDirective: "default-src", + // originalPolicy: "default-src 'none'", + sourceFile: "example.js", + sample: "<script>alert('1');</scr" + "ipt>", + disposition: "enforce", + statusCode: 200, + lineNumber: 1, + columnNumber: 1, + }).originalPolicy, ""); + }, "SecurityPolicyViolationEvent constructor does not require originalPolicy"); test(function() { - assert_throws_js(TypeError, - function() { new SecurityPolicyViolationEvent("securitypolicyviolation", { - documentURI: "http://example.com", - referrer: "http://example.com", - blockedURI: "http://example.com", - violatedDirective: "default-src", - effectiveDirective: "default-src", - originalPolicy: "default-src 'none'", - sourceFile: "example.js", - sample: "<script>alert('1');</scr" + "ipt>", - // disposition: "enforce", - statusCode: 200, - lineNumber: 1, - columnNumber: 1, - })}); - }, "SecurityPolicyViolationEvent constructor requires disposition"); + assert_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { + documentURI: "http://example.com", + referrer: "http://example.com", + blockedURI: "http://example.com", + violatedDirective: "default-src", + effectiveDirective: "default-src", + originalPolicy: "default-src 'none'", + sourceFile: "example.js", + sample: "<script>alert('1');</scr" + "ipt>", + // disposition: "enforce", + statusCode: 200, + lineNumber: 1, + columnNumber: 1, + }).disposition, "enforce"); + }, "SecurityPolicyViolationEvent constructor does not require disposition"); test(function() { - assert_throws_js(TypeError, - function() { new SecurityPolicyViolationEvent("securitypolicyviolation", { - documentURI: "http://example.com", - referrer: "http://example.com", - blockedURI: "http://example.com", - violatedDirective: "default-src", - effectiveDirective: "default-src", - originalPolicy: "default-src 'none'", - sourceFile: "example.js", - sample: "<script>alert('1');</scr" + "ipt>", - disposition: "enforce", - // statusCode: 200, - lineNumber: 1, - columnNumber: 1, - })}); - }, "SecurityPolicyViolationEvent constructor requires statusCode"); + assert_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { + documentURI: "http://example.com", + referrer: "http://example.com", + blockedURI: "http://example.com", + violatedDirective: "default-src", + effectiveDirective: "default-src", + originalPolicy: "default-src 'none'", + sourceFile: "example.js", + sample: "<script>alert('1');</scr" + "ipt>", + disposition: "enforce", + // statusCode: 200, + lineNumber: 1, + columnNumber: 1, + }).statusCode, 0); + }, "SecurityPolicyViolationEvent constructor does not require statusCode"); - // missing optional members test(function() { - assert_not_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { + assert_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { documentURI: "http://example.com", // referrer: "http://example.com", blockedURI: "http://example.com", @@ -149,11 +142,11 @@ statusCode: 200, lineNumber: 1, columnNumber: 1, - }), undefined); + }).referrer, ""); }, "SecurityPolicyViolationEvent constructor does not require referrer"); test(function() { - assert_not_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { + assert_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { documentURI: "http://example.com", referrer: "http://example.com", // blockedURI: "http://example.com", @@ -166,11 +159,11 @@ statusCode: 200, lineNumber: 1, columnNumber: 1, - }), undefined); + }).blockedURI, ""); }, "SecurityPolicyViolationEvent constructor does not require blockedURI"); test(function() { - assert_not_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { + assert_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { documentURI: "http://example.com", referrer: "http://example.com", blockedURI: "http://example.com", @@ -183,11 +176,11 @@ statusCode: 200, lineNumber: 1, columnNumber: 1, - }), undefined); + }).sourceFile, ""); }, "SecurityPolicyViolationEvent constructor does not require sourceFile"); test(function() { - assert_not_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { + assert_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { documentURI: "http://example.com", referrer: "http://example.com", blockedURI: "http://example.com", @@ -200,11 +193,11 @@ statusCode: 200, lineNumber: 1, columnNumber: 1, - }), undefined); + }).sample, ""); }, "SecurityPolicyViolationEvent constructor does not require sample"); test(function() { - assert_not_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { + assert_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { documentURI: "http://example.com", referrer: "http://example.com", blockedURI: "http://example.com", @@ -217,11 +210,11 @@ statusCode: 200, // lineNumber: 1, columnNumber: 1, - }), undefined); + }).lineNumber, 0); }, "SecurityPolicyViolationEvent constructor does not require lineNumber"); test(function() { - assert_not_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { + assert_equals(new SecurityPolicyViolationEvent("securitypolicyviolation", { documentURI: "http://example.com", referrer: "http://example.com", blockedURI: "http://example.com", @@ -234,6 +227,6 @@ statusCode: 200, lineNumber: 1, // columnNumber: 1, - }), undefined); + }).columnNumber, 0); }, "SecurityPolicyViolationEvent constructor does not require columnNumber"); </script> |