gecko/accessible/tests/mochitest/states/test_inputs.xul

83 lines
2.7 KiB
XML

<?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"
title="Accessible XUL input control state tests">
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="../common.js" />
<script type="application/javascript"
src="../states.js" />
<script type="application/javascript">
<![CDATA[
function doTest()
{
testStates("some-text", STATE_FOCUSABLE, 0, STATE_UNAVAILABLE);
testStates("some-text2", STATE_UNAVAILABLE, 0 , STATE_FOCUSABLE);
testStates("some-password", STATE_FOCUSABLE, 0, STATE_UNAVAILABLE);
testStates("some-password2", STATE_UNAVAILABLE, 0 , STATE_FOCUSABLE);
testStates("checkbox", STATE_FOCUSABLE, 0, STATE_UNAVAILABLE);
testStates("checkbox2", STATE_UNAVAILABLE, 0 , STATE_FOCUSABLE);
testStates("radio-group", 0, 0, STATE_UNAVAILABLE);
testStates("orange", STATE_UNAVAILABLE, 0 , STATE_FOCUSABLE);
testStates("violet", 0, 0, STATE_UNAVAILABLE);
testStates("radio-group2", STATE_UNAVAILABLE, 0 , STATE_FOCUSABLE);
testStates("orange2", STATE_UNAVAILABLE, 0 , STATE_FOCUSABLE);
SimpleTest.finish()
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
]]>
</script>
<hbox flex="1" style="overflow: auto;">
<body xmlns="http://www.w3.org/1999/xhtml">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=599163"
title="check disabled state instead of attribute">
Mozilla Bug 599163
</a><br/>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
<vbox flex="1">
<textbox id="some-text"/>
<textbox id="some-text2" disabled="true"/>
<textbox id="some-password" type="password" maxlength="8"/>
<textbox id="some-password2" type="password" maxlength="8" disabled="true"/>
<checkbox id="checkbox" checked="true" label="Steak"/>
<checkbox id="checkbox2" checked="true" label="Salad" disabled="true"/>
<radiogroup id="radio-group">
<radio id="orange" label="Orange" disabled="true"/>
<radio id="violet" selected="true" label="Violet"/>
<radio id="yellow" label="Yellow"/>
</radiogroup>
<radiogroup id="radio-group2" disabled="true">
<radio id="orange2" label="Orange"/>
<radio id="violet2" selected="true" label="Violet"/>
<radio id="yellow2" label="Yellow"/>
</radiogroup>
</vbox>
</hbox>
</window>