blob: afb2f5f7c4b7f6ddfe8da004750017e6c7f01f9a [file] [log] [blame]
<!DOCTYPE html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta http-equiv="Content-Security-Policy" content="trusted-types a b c*">
</head>
<body>
<script>
test(t => {
trustedTypes.createPolicy("a", {}),
assert_throws_js(TypeError,
_ => trustedTypes.createPolicy("a", {}),
"Duplicate name");
trustedTypes.createPolicy("b", {}),
assert_throws_js(TypeError,
_ => trustedTypes.createPolicy("d", {}),
"Invalid name.");
}, "TrustedTypePolicyFactory and policy list in CSP.");
</script>
</body>