Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="../../popovers/resources/toggle-event-source-test.js"></script>
<button id=showmodalbutton commandfor=dialog command=show-modal>show modal</button>
<dialog id=dialog>
dialog
<button id=closebutton commandfor=dialog command=close>close</button>
</dialog>
<script>
const showmodalbutton = document.getElementById('showmodalbutton');
const dialog = document.getElementById('dialog');
createToggleEventSourceTest({
description: 'ToggleEvent.source on <dialog> elements: dialog.showModal().',
target: dialog,
openFunc: async () => dialog.showModal(),
closeFunc: async () => dialog.close(),
openSource: null,
closeSource: null
});
createToggleEventSourceTest({
description: 'ToggleEvent.soruce on <dialog> elements: command button.',
target: dialog,
openFunc: async () => showmodalbutton.click(),
closeFunc: async () => closebutton.click(),
openSource: showmodalbutton,
closeSource: closebutton
});
createToggleEventSourceTest({
description: 'ToggleEvent.soruce on <dialog> elements: open with showModal, close with button.',
target: dialog,
openFunc: async () => dialog.showModal(),
closeFunc: async () => closebutton.click(),
openSource: null,
closeSource: closebutton
});
createToggleEventSourceTest({
description: 'ToggleEvent.soruce on <dialog> elements: open with button, close with dialog.close().',
target: dialog,
openFunc: async () => showmodalbutton.click(),
closeFunc: async () => dialog.close(),
openSource: showmodalbutton,
closeSource: null
});
</script>