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_panel_hover_menu.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_panel_hover_menu.xhtml')
-rw-r--r-- | toolkit/content/tests/chrome/test_panel_hover_menu.xhtml | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/toolkit/content/tests/chrome/test_panel_hover_menu.xhtml b/toolkit/content/tests/chrome/test_panel_hover_menu.xhtml new file mode 100644 index 0000000000..4c5d8589cb --- /dev/null +++ b/toolkit/content/tests/chrome/test_panel_hover_menu.xhtml @@ -0,0 +1,46 @@ +<?xml version="1.0"?> +<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> +<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://global/skin"/> + <link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css"/> + <script><![CDATA[ + add_task(async function test_panel_submenu_hover() { + let panel = document.getElementById("panel"); + let menu = document.getElementById("menu"); + let menupopup = document.getElementById("menupopup"); + + let panelShown = new Promise(r => panel.addEventListener("popupshown", r, { once: true })); + info("opening panel"); + panel.openPopupAtScreen(window.screenX, window.screenY); + await panelShown; + info("panel shown"); + + info("hovering menu button"); + synthesizeMouseAtCenter(menu, { type: "mousemove" }); + // Wait for at least the submenu delay. + await new Promise(r => setTimeout(r, 1000)); + is(menupopup.state, "closed", "menu shouldn't have opened"); + + info("clicking menu button"); + let menupopupShown = new Promise(r => menupopup.addEventListener("popupshown", r, { once: true })); + synthesizeMouseAtCenter(menu, {}); + await menupopupShown; + + ok(true, "Menupopup was shown on click"); + }); + ]]></script> +</head> +<body> + <xul:panel id="panel"> + <xul:button type="menu" id="menu" label="Open menu"> + <xul:menupopup id="menupopup"> + <xul:menuitem label="foo"/> + </xul:menupopup> + </xul:button> + </xul:panel> +</body> +</html> |