Summary

Harness status: OK

Found 9 tests

Details

ResultTest NameMessage
Passeval with plain string with Trusted Types and permissive CSP throws (no type).
Asserts run
Pass
assert_throws_js(function "function EvalError() { [native code] }", function "_ => {       eval('a="hello there"');     }")
    at Test.<anonymous> ( /trusted-types/eval-with-permissive-csp.html:17:5)
Pass
assert_equals(0, 0)
    at Test.<anonymous> ( /trusted-types/eval-with-permissive-csp.html:20:5)
Passindirect eval with plain string with Trusted Types and permissive CSP throws (no type).
Asserts run
Pass
assert_throws_js(function "function EvalError() { [native code] }", function "_ => {       eval?.('a="hello there"');     }")
    at Test.<anonymous> ( /trusted-types/eval-with-permissive-csp.html:25:5)
Pass
assert_equals(0, 0)
    at Test.<anonymous> ( /trusted-types/eval-with-permissive-csp.html:28:5)
PassFunction constructor with plain string with Trusted Types and permissive CSP throws (no type).
Asserts run
Pass
assert_throws_js(function "function EvalError() { [native code] }", function "_ => {       new Function('a="hello there"');     }")
    at Test.<anonymous> ( /trusted-types/eval-with-permissive-csp.html:33:5)
Pass
assert_equals(0, 0)
    at Test.<anonymous> ( /trusted-types/eval-with-permissive-csp.html:36:5)
Passeval with TrustedScript and permissive CSP works.
Asserts run
Pass
assert_equals("Hello a cat string", "Hello a cat string")
    at Test.<anonymous> ( /trusted-types/eval-with-permissive-csp.html:41:5)
Passindirect eval with TrustedScript and permissive CSP works.
Asserts run
Pass
assert_equals("Hello a cat string", "Hello a cat string")
    at Test.<anonymous> ( /trusted-types/eval-with-permissive-csp.html:46:5)
Failnew Function with TrustedScript and permissive CSP works.Refused to evaluate a string as JavaScript because this document requires 'Trusted Type' assignment.
EvalError: Refused to evaluate a string as JavaScript because this document requires 'Trusted Type' assignment.
    at new Function (<anonymous>)
    at Test.<anonymous> (https://not-wpt.live/trusted-types/eval-with-permissive-csp.html:50:13)
    at Test.step (https://not-wpt.live/resources/testharness.js:2642:25)
    at test (https://not-wpt.live/resources/testharness.js:633:30)
    at https://not-wpt.live/trusted-types/eval-with-permissive-csp.html:49:3
Asserts runNo asserts ran
Passeval with plain string with Trusted Types and permissive CSP works with default policy.
Asserts run
Pass
assert_equals(2, 2)
    at Test.<anonymous> ( /trusted-types/eval-with-permissive-csp.html:57:5)
Passindirect eval with plain string with Trusted Types and permissive CSP works with default policy.
Asserts run
Pass
assert_equals(2, 2)
    at Test.<anonymous> ( /trusted-types/eval-with-permissive-csp.html:62:5)
Passnew Function with plain string default policy and permissive CSP works with default policy.
Asserts run
Pass
assert_equals(2, 2)
    at Test.<anonymous> ( /trusted-types/eval-with-permissive-csp.html:67:5)