gecko/accessible/tests/mochitest/tree/test_combobox.xul
Alexander Surkov 4fe3532b6f Bug 249292 - Ensure accessible children for <toolbarbutton> types 'menu' and 'menu-button', r=marcoz, davidb
--HG--
rename : accessible/tests/mochitest/test_elm_filectrl.html => accessible/tests/mochitest/tree/test_filectrl.html
rename : accessible/tests/mochitest/test_elm_media.html => accessible/tests/mochitest/tree/test_media.html
rename : accessible/tests/mochitest/test_elm_select.html => accessible/tests/mochitest/tree/test_select.html
rename : accessible/tests/mochitest/test_elm_tree.xul => accessible/tests/mochitest/tree/test_tree.xul
rename : accessible/tests/mochitest/test_elm_txtcntnr.html => accessible/tests/mochitest/tree/test_txtctrl.html
2009-11-10 13:58:52 +08:00

139 lines
3.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 menulist and textbox @autocomplete hierarchy tests">
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js" />
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js" />
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js" />
<script type="application/javascript">
<![CDATA[
////////////////////////////////////////////////////////////////////////////
// Test
function doTest()
{
//////////////////////////////////////////////////////////////////////////
// menulist
var accTree = {
role: ROLE_COMBOBOX,
children: [
{
role: ROLE_COMBOBOX_LIST,
children: [
{
role: ROLE_COMBOBOX_OPTION
},
{
role: ROLE_COMBOBOX_OPTION
}
]
}
]
};
testAccessibleTree("menulist", accTree);
//////////////////////////////////////////////////////////////////////////
// textbox@type=autocomplete #1 (history)
accTree = {
role: ROLE_AUTOCOMPLETE,
children: [
{
role: ROLE_ENTRY,
children: [
{
role: ROLE_TEXT_LEAF
}
]
},
{
role: ROLE_COMBOBOX_LIST, // context menu popup
children: [ ]
}
]
};
testAccessibleTree("autocomplete", accTree);
//////////////////////////////////////////////////////////////////////////
// textbox@type=autocomplete #2 (child menupoup)
accTree = {
role: ROLE_AUTOCOMPLETE,
children: [
{
role: ROLE_COMBOBOX_LIST, // autocomplete menu popup
children: [
{
role: ROLE_COMBOBOX_OPTION
}
]
},
{
role: ROLE_ENTRY,
children: [ ]
},
{
role: ROLE_COMBOBOX_LIST, // context menu popup
children: [ ]
}
]
};
testAccessibleTree("autocomplete2", accTree);
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=249292"
title="Ensure accessible children for toolbarbutton types 'menu' and 'menu-button'">
Mozilla Bug 249292
</a><br/>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
<vbox flex="1">
<menulist id="menulist">
<menupopup>
<menuitem label="item"/>
<menuitem label="item"/>
</menupopup>
</menulist>
<textbox id="autocomplete" type="autocomplete"
autocompletesearch="history"
value="http://localhost:8888/redirect-a11y.html"/>
<textbox id="autocomplete2" type="autocomplete">
<menupopup>
<menuitem label="item1"/>
</menupopup>
</textbox>
</vbox>
</hbox>
</window>