summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none.tentative.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none.tentative.html')
-rw-r--r--testing/web-platform/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none.tentative.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/testing/web-platform/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none.tentative.html b/testing/web-platform/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none.tentative.html
new file mode 100644
index 0000000000..48c75937ea
--- /dev/null
+++ b/testing/web-platform/tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none.tentative.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<script src="/resources/testharness.js" ></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/helper.sub.js"></script>
+<meta http-equiv="Content-Security-Policy" content="trusted-types 'none'">
+<body>
+<script>
+ test(t => {
+ assert_throws_js(TypeError, _ => {
+ window.trustedTypes.createPolicy('SomeName', { createHTML: s => s } );
+ });
+ }, "Cannot create policy with name 'SomeName' - policy creation throws");
+
+ test(t => {
+ assert_throws_js(TypeError, _ => {
+ window.trustedTypes.createPolicy('default', { createHTML: s => s } );
+ });
+ }, "Cannot create policy with name 'default' - policy creation throws");
+</script>