Skip to content

Commit 539511a

Browse files
committed
[test] Add scriptUrl to trusted types
Change-Id: I0865832b120dd7b719f79d6374c166e414a180b9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417902 Reviewed-by: Bob Nystrom <[email protected]>
1 parent 9505e95 commit 539511a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pkg/test_runner/lib/src/testing_servers.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,18 @@ class TestingServers {
360360
var contentHeaderValue = [
361361
"script-src 'self'",
362362
"object-src 'self'",
363+
364+
// Trusted types (https://w3c.github.io/trusted-types/dist/spec/#trusted-types-csp-directive)
365+
//
366+
// Policy `dart.deferred-loading` is used to trust dart2js's deferred
367+
// loading URLs, and is tested by tests/web/deferred/trusted_script_url
368+
//
369+
// Policy `scriptUrl` is the name of a policy created to test creation
370+
// of policies via js-interop, and is tested by
371+
// tests/lib/js/static_interop_test/import/import_trustedscripturl_test
363372
"require-trusted-types-for: 'script'",
364-
"trusted-types dart.deferred-loading",
373+
"trusted-types dart.deferred-loading scriptUrl"
374+
,
365375
].join('; ');
366376
for (var header in [
367377
"Content-Security-Policy",

0 commit comments

Comments
 (0)