assertSinkEqualsDocumentWriteLn

Summary

Harness status: OK

Found 20 tests

Details

ResultTest NameMessage
Passdocument.write with html assigned via policy (successful URL transformation).
Asserts run
Pass
assert_equals("Quack, I want to be a duck!", "Quack, I want to be a duck!")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:18:5)
Faildocument.write with multiple trusted arguments.Failed to execute 'write' on 'Document': This document requires 'TrustedHTML' assignment.
TypeError: Failed to execute 'write' on 'Document': This document requires 'TrustedHTML' assignment.
    at Test.<anonymous> (https://xn--n8j6ds53lwwkrqhv28a.wpt.live/trusted-types/block-string-assignment-to-Document-write.html:25:14)
    at Test.step (https://xn--n8j6ds53lwwkrqhv28a.wpt.live/resources/testharness.js:2642:25)
    at test (https://xn--n8j6ds53lwwkrqhv28a.wpt.live/resources/testharness.js:633:30)
    at https://xn--n8j6ds53lwwkrqhv28a.wpt.live/trusted-types/block-string-assignment-to-Document-write.html:21:3
Asserts runNo asserts ran
Passdocument.writeln with html assigned via policy (successful URL transformation).
Asserts run
Pass
assert_equals("Quack, I want to be a duck!", "Quack, I want to be a duck!")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:34:5)
Faildocument.writeln with multiple trusted arguments.Failed to execute 'writeln' on 'Document': This document requires 'TrustedHTML' assignment.
TypeError: Failed to execute 'writeln' on 'Document': This document requires 'TrustedHTML' assignment.
    at Test.<anonymous> (https://xn--n8j6ds53lwwkrqhv28a.wpt.live/trusted-types/block-string-assignment-to-Document-write.html:41:14)
    at Test.step (https://xn--n8j6ds53lwwkrqhv28a.wpt.live/resources/testharness.js:2642:25)
    at test (https://xn--n8j6ds53lwwkrqhv28a.wpt.live/resources/testharness.js:633:30)
    at https://xn--n8j6ds53lwwkrqhv28a.wpt.live/trusted-types/block-string-assignment-to-Document-write.html:37:3
Asserts runNo asserts ran
Pass`document.write(string)` throws
Asserts run
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       document.write('A string');     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:48:5)
Pass
assert_equals("", "")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:51:5)
Pass`document.write(string, string)` throws
Asserts run
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       let a = "abcdef";       let b = "ghijkl";       document.write(a, b);     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:56:5)
Pass
assert_equals("", "")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:61:5)
Pass`document.write(string, TrustedHTML)` throws
Asserts run
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       let a = "abcdef";       let b = p.createHTML("ghijkl");       document.write(a, b);     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:66:5)
Pass
assert_equals("", "")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:71:5)
Pass`document.writeln(string)` throws
Asserts run
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       document.writeln('A string');     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:77:5)
Pass
assert_equals("", "")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:80:5)
Pass`document.writeln(string, string)` throws
Asserts run
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       let a = "abcdef";       let b = "ghijkl";       document.writeln(a, b);     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:85:5)
Pass
assert_equals("", "")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:90:5)
Pass`document.writeln(string, TrustedHTML)` throws
Asserts run
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       let a = "abcdef";       let b = p.createHTML("ghijkl");       document.writeln(a, b);     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:95:5)
Pass
assert_equals("", "")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:100:5)
Pass`document.write(null)` throws
Asserts run
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       document.write(null);     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:106:5)
Pass
assert_equals("", "")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:109:5)
Pass`document.writeln(null)` throws
Asserts run
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       document.writeln(null);     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:115:5)
Pass
assert_equals("", "")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:118:5)
Pass`document.write(string)` observes default policy
Asserts run
Pass
assert_equals("Quack, I want to be a duck!", "Quack, I want to be a duck!")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:138:5)
Pass`document.write(string, string)` observes default policy
Asserts run
Pass
assert_equals("abczxcvbnjkl", "abczxcvbnjkl")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:146:5)
Pass`document.write(string, TrustedHTML)` observes default policy
Asserts run
Pass
assert_equals("abczxcvbnjkl", "abczxcvbnjkl")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:154:5)
Pass`document.write` passes the correct sink string to the default policy
Asserts run
Pass
assert_equals("Document write", "Document write")
    at createHTML ( /trusted-types/block-string-assignment-to-Document-write.html:124:17)
Pass`document.writeln(string)` observes default policy
Asserts run
Pass
assert_equals("Quack, I want to be a duck!", "Quack, I want to be a duck!")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:166:5)
Pass`document.writeln(string, string)` observes default policy
Asserts run
Pass
assert_equals("abczxcvbnjkl", "abczxcvbnjkl")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:174:5)
Pass`document.writeln(string, TrustedHTML)` observes default policy
Asserts run
Pass
assert_equals("abczxcvbnjkl", "abczxcvbnjkl")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Document-write.html:182:5)
Pass`document.writeln` passes the correct sink string to the default policy
Asserts run
Pass
assert_equals("Document writeln", "Document writeln")
    at createHTML ( /trusted-types/block-string-assignment-to-Document-write.html:126:17)