Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<link rel=author href="mailto:masonf@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/close-watcher/resources/helpers.js"></script>
<dialog>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>