trisquel-icecat/icecat/accessible/tests/mochitest/events/test_namechange.xhtml
2025-10-06 02:35:48 -06:00

61 lines
1.7 KiB
HTML

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script src="chrome://mochikit/content/chrome-harness.js"/>
<script src="../common.js" />
<script src="../name.js" />
<script src="../promisified-events.js" />
<script type="application/javascript">
<![CDATA[
/**
* Check name changed a11y event.
*/
async function doTest() {
let changed = waitForEvent(EVENT_NAME_CHANGE, "listitem");
info("Changing childContent value");
getNode("childcontent").setAttribute("value", "Changed.");
await changed;
const buttonWithLabel = getNode("buttonWithLabel");
testName(buttonWithLabel, "initial");
info("Changing buttonWithLabel label");
changed = waitForEvent(EVENT_NAME_CHANGE, buttonWithLabel);
buttonWithLabel.setAttribute("label", "changed");
await changed;
testName(buttonWithLabel, "changed");
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
]]>
</script>
<vbox flex="1" style="overflow: auto;">
<body xmlns="http://www.w3.org/1999/xhtml">
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
<richlistbox>
<richlistitem id="listitem">
<description id="childcontent" value="This will be changed."/>
</richlistitem>
</richlistbox>
<button id="buttonWithLabel" label="initial"/>
</vbox>
</window>