Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'android'
- Manifest: layout/xul/test/chrome.toml
<?xml version="1.0"?>
<!--
-->
onload="SimpleTest.waitForFocus(nextTest, window)">
<!-- test results are displayed in the html:body -->
</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, 5, 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, 5, 0, { type: "mousemove" });
synthesizeMouse(menuitem, 6, 0, { type: "mousemove" });
}
function nextTest(e) {
menulist.addEventListener("popupshown", onPopupShown);
synthesizeMouseAtCenter(menulist, {});
}
]]>
</script>
</window>