Bug 1743209 [wpt PR 31763] - Use proper cleanup in dialog-focusing-steps-disconnected.html, a=testonly

Automatic update from web-platform-tests
Use proper cleanup in dialog-focusing-steps-disconnected.html

See #31761

--

wpt-commits: 43fb287da71d4c37d7604c410f9c49c33df41fc5
wpt-pr: 31763
This commit is contained in:
Oriol Brufau 2021-11-29 09:42:51 +00:00 коммит произвёл moz-wptsync-bot
Родитель c651d068e1
Коммит 0501096cc0
1 изменённых файлов: 3 добавлений и 5 удалений

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

@ -8,7 +8,7 @@
<body>
<input>
<script>
test(() => {
test(function() {
const outerInput = document.querySelector("input");
outerInput.focus();
assert_equals(document.activeElement, outerInput,
@ -22,14 +22,12 @@ test(() => {
dialog.append(innerInput);
dialog.show();
this.add_cleanup(() => { dialog.close(); });
assert_equals(document.activeElement, outerInput, "Focusing steps should not change focus");
// Clean up
dialog.close();
}, "dialog.show(): focusing steps should not change focus on disconnected <dialog>");
test(() => {
test(function() {
assert_throws_dom("InvalidStateError", () => {
document.createElement("dialog").showModal();
});