diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /toolkit/content/tests/chrome/test_dialog_button.xhtml | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/content/tests/chrome/test_dialog_button.xhtml')
-rw-r--r-- | toolkit/content/tests/chrome/test_dialog_button.xhtml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/toolkit/content/tests/chrome/test_dialog_button.xhtml b/toolkit/content/tests/chrome/test_dialog_button.xhtml new file mode 100644 index 0000000000..8c973839c1 --- /dev/null +++ b/toolkit/content/tests/chrome/test_dialog_button.xhtml @@ -0,0 +1,36 @@ +<!DOCTYPE HTML> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="utf-8" /> + <title><!-- Test with dialog & buttons --></title> + <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> + <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/> + <link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css"/> + <script><![CDATA[ + add_task(async function test_dialog_button_accesskey() { + var win = window.browsingContext.topChromeWindow.openDialog( + "dialog_button.xhtml", + "_new", + "chrome,dialog" + ); + await new Promise((r) => win.addEventListener("load", r, { once: true })); + + let dialogClosed = new Promise((r) => { + win.document.addEventListener("dialogclosing", r, { once: true }); + }); + // https://bugzilla.mozilla.org/show_bug.cgi?id=1625632 + // When pressing an accesskey for a built in dialog button while a regular button is focused, + // it should forward to the dialog. + win.document.querySelector("#button").focus(); + synthesizeKey("a", {}, win); + await dialogClosed; + ok(true, "Accesskey on focused button"); + }); + ]]></script> +</head> +<body> +<p id="display"></p> +<div id="content" style="display: none"></div> +<pre id="test"></pre> +</body> +</html> |