diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /toolkit/content/tests/chrome/test_panel_hover_menu.xhtml | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
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> |