diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /layout/xul/test/test_bug1197913.xhtml | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/xul/test/test_bug1197913.xhtml')
-rw-r--r-- | layout/xul/test/test_bug1197913.xhtml | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/layout/xul/test/test_bug1197913.xhtml b/layout/xul/test/test_bug1197913.xhtml new file mode 100644 index 0000000000..770c70113d --- /dev/null +++ b/layout/xul/test/test_bug1197913.xhtml @@ -0,0 +1,63 @@ +<?xml version="1.0"?> +<?xml-stylesheet type="text/css" href="chrome://global/skin"?> +<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=1197913 +--> +<window title="Mozilla Bug 1197913" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + onload="SimpleTest.waitForFocus(nextTest, window)"> + <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> + <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/> + + + <!-- test results are displayed in the html:body --> + <body xmlns="http://www.w3.org/1999/xhtml"> + <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1197913" + target="_blank">Mozilla Bug 1197913</a> + </body> + + <hbox align="center" pack="center"> + <menulist> + <menupopup> + <menuitem label="Car" /> + <menuitem label="Taxi" id="target" /> + <menuitem label="Bus" /> + </menupopup> + </menulist> + </hbox> + <!-- test code goes here --> + <script type="application/javascript"> + <![CDATA[ + SimpleTest.waitForExplicitFinish(); + + let menulist = document.getElementsByTagName("menulist")[0]; + let menuitem = document.getElementById("target"); + + function onDOMMenuItemActive(e) { + menuitem.removeEventListener("DOMMenuItemActive", onDOMMenuItemActive); + + synthesizeMouse(menuitem, 0, 0, { type: "mousemove" }); + synthesizeMouse(menuitem, -1, 0, { type: "mousemove" }); + + setTimeout(() => { + ok(menuitem.getAttribute("_moz-menuactive"), "Should be active"); + SimpleTest.finish(); + }); + } + + function onPopupShown(e) { + menulist.removeEventListener("popupshown", onPopupShown); + menuitem.addEventListener("DOMMenuItemActive", onDOMMenuItemActive); + synthesizeMouse(menuitem, 0, 0, { type: "mousemove" }); + synthesizeMouse(menuitem, 1, 0, { type: "mousemove" }); + } + + function nextTest(e) { + menulist.addEventListener("popupshown", onPopupShown); + synthesizeMouseAtCenter(menulist, {}); + } + + ]]> + </script> +</window> |