Dialog</dialog>

<script>
promise_test(async () => {
  const dialog = document.querySelector('dialog');
  assert_false(dialog.open);
  dialog.show();
  assert_true(dialog.open);
  await sendEscKey();
  assert_true(dialog.open,'Escape does not close a non-modal dialog');
  dialog.close();
  dialog.showModal();
  assert_true(dialog.open);
  await sendEscKey();
  assert_false(dialog.open,'Escape does close a modal dialog');
},'Non-modal dialogs should not be cancelable via ESC');
</script>
