Bug 1498665 [wpt PR 13488] - Small adjustment to document.write TrustedTypes test., a=testonly

Automatic update from web-platform-testsSmall adjustment to document.write TrustedTypes test as WindowTestEnvironment writes to the DOM, breaking the test when viewed in the browser. (#13488)

Also removed a duplicate test.
--

wpt-commits: 72388ece045369a7b07eed7f52e582cf231b892d
wpt-pr: 13488
This commit is contained in:
Krzysztof Kotowicz 2018-10-16 09:58:23 +00:00 коммит произвёл James Graham
Родитель ba937cf462
Коммит 4f21617257
2 изменённых файлов: 3 добавлений и 10 удалений

Просмотреть файл

@ -4,10 +4,11 @@
<script src="support/helper.sub.js"></script> <script src="support/helper.sub.js"></script>
<body> <body>
<script> <script>
// TrustedHTML assignments do not throw.
test(t => { test(t => {
let p = createHTML_policy(window, 1); let p = createHTML_policy(window, 1);
let html = p.createHTML(INPUTS.HTML); let html = p.createHTML(INPUTS.HTML);
document.write(html); document.write(html);
assert_equals(document.body.innerText, RESULTS.HTML); assert_true(document.body.innerText.indexOf(RESULTS.HTML) !== -1);
}, "document.write with html assigned via policy (successful URL transformation)."); }, "document.write with html assigned via policy (successful transformation).");
</script> </script>

Просмотреть файл

@ -9,14 +9,6 @@
</head> </head>
<body> <body>
<script> <script>
// TrustedURL assignments do not throw.
test(t => {
let p = createHTML_policy(window, 1);
let html = p.createHTML(INPUTS.HTML);
document.write(html);
assert_equals(document.body.innerText, RESULTS.HTML);
}, "document.write with html assigned via policy (successful URL transformation).");
// String assignments throw. // String assignments throw.
test(t => { test(t => {
assert_throws(new TypeError(), _ => { assert_throws(new TypeError(), _ => {