Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove instances of 'whitelist' from trusted-types/ #21339

Merged
merged 1 commit into from Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions trusted-types/TrustedTypePolicy-CSP.tentative.html
Expand Up @@ -6,22 +6,22 @@
<meta http-equiv="Content-Security-Policy" content="trusted-types SomeName JustOneMoreName">
<body>
<script>
// Whitelisted name test
// Allowed name test
test(t => {
let policy = window.trustedTypes.createPolicy('SomeName', { createHTML: s => s } );
assert_equals(policy.name, 'SomeName');
}, "Whitelisted policy creation works.");
}, "Allowed-name policy creation works.");

// Another whitelisted name test
// Another allowed name test
test(t => {
let policy = window.trustedTypes.createPolicy('JustOneMoreName', { createHTML: s => s } );
assert_equals(policy.name, 'JustOneMoreName');
}, "Another whitelisted policy creation works.");
}, "Another allowed-name policy creation works.");

// Non-whitelisted names test
// Non-allowed names test
test(t => {
assert_throws(new TypeError(), _ => {
window.trustedTypes.createPolicy('SomeOtherName', { createURL: s => s } );
});
}, "Non-whitelisted policy creation throws.");
}, "Non-allowed name policy creation throws.");
</script>
Expand Up @@ -6,22 +6,22 @@
<meta http-equiv="Content-Security-Policy" content="trusted-types SomeName JustOneMoreName">
<body>
<script>
// Whitelisted name test
// Allowed name test
test(t => {
let policy = window.trustedTypes.createPolicy('SomeName', { createHTML: s => s } );
assert_equals(policy.name, 'SomeName');
}, "Whitelisted policy creation works.");
}, "Allowed-name policy creation works.");

// Another whitelisted name test
// Another allowed name test
test(t => {
let policy = window.trustedTypes.createPolicy('JustOneMoreName', { createHTML: s => s } );
assert_equals(policy.name, 'JustOneMoreName');
}, "Another whitelisted policy creation works.");
}, "Another allowed-name policy creation works.");

// Non-whitelisted names test
// Non-allowed names test
test(t => {
assert_throws(new TypeError(), _ => {
window.trustedTypes.createPolicy('SomeOtherName', { createURL: s => s } );
});
}, "Non-whitelisted policy creation throws.");
}, "Non-allowed name policy creation throws.");
</script>