Summary

Harness status: OK

Found 7 tests

Details

ResultTest NameMessage
PassinsertAdjacentHTML with html assigned via policy (successful HTML transformation).
Asserts run
Pass
assert_equals(3, 3)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:28:5)
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-Element-insertAdjacentHTML.html:29:5)
Pass
assert_equals("beforeafter", "beforeafter")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:33:5)
Pass
assert_equals(3, 3)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:36:5)
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-Element-insertAdjacentHTML.html:37:5)
PassinsertAdjacentHTML(TrustedHTML) throws SyntaxError DOMException when position invalid.
Asserts run
Pass
assert_throws_dom("SyntaxError", function "_ => {       d.insertAdjacentHTML('invalid', p.createHTML("<p>Fail</p>"));     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:48:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:52:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:53:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:54:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:55:5)
Pass`insertAdjacentHTML(string)` throws.
Asserts run
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       d.insertAdjacentHTML('beforebegin', "<p>Fail</p>");     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:66:5)
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       d.insertAdjacentHTML('afterbegin', "<p>Fail</p>");     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:69:5)
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       d.insertAdjacentHTML('beforeend', "<p>Fail</p>");     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:72:5)
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       d.insertAdjacentHTML('afterend', "<p>Fail</p>");     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:75:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:79:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:80:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:81:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:82:5)
Pass`insertAdjacentHTML(string)` still throws TypeError when position invalid.
Asserts run
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       d.insertAdjacentHTML('invalid', "<p>Fail</p>");     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:92:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:96:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:97:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:98:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:99:5)
Pass`insertAdjacentHTML(null)` throws.
Asserts run
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       d.insertAdjacentHTML('beforebegin', null);     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:110:5)
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       d.insertAdjacentHTML('afterbegin', null);     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:113:5)
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       d.insertAdjacentHTML('beforeend', null);     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:116:5)
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "_ => {       d.insertAdjacentHTML('afterend', null);     }")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:119:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:123:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:124:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:125:5)
Pass
assert_equals(null, null)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:126:5)
Pass`insertAdjacentHTML(string)` assigned via default policy (successful HTML transformation).
Asserts run
Pass
assert_equals(3, 3)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:156:5)
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-Element-insertAdjacentHTML.html:157:5)
Pass
assert_equals(3, 3)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:160:5)
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-Element-insertAdjacentHTML.html:161:5)
Pass
assert_equals(3, 3)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:166:5)
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-Element-insertAdjacentHTML.html:167:5)
Pass
assert_equals(3, 3)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:170:5)
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-Element-insertAdjacentHTML.html:171:5)
Pass
assert_equals("Element insertAdjacentHTML", "Element insertAdjacentHTML")
    at createHTML ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:145:11)
Pass`insertAdjacentHTML(null)` assigned via default policy does not throw.
Asserts run
Pass
assert_equals(3, 3)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:185:5)
Pass
assert_equals("null", "null")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:186:5)
Pass
assert_equals(3, 3)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:189:5)
Pass
assert_equals("null", "null")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:190:5)
Pass
assert_equals(3, 3)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:195:5)
Pass
assert_equals("null", "null")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:196:5)
Pass
assert_equals(3, 3)
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:199:5)
Pass
assert_equals("null", "null")
    at Test.<anonymous> ( /trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.html:200:5)