test_button.xhtml (2284B)
1 <?xml version="1.0"?> 2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> 3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" 4 type="text/css"?> 5 6 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 7 title="Accessible XUL button hierarchy tests"> 8 9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> 10 11 <script type="application/javascript" 12 src="../common.js" /> 13 <script type="application/javascript" 14 src="../role.js" /> 15 16 <script type="application/javascript"> 17 <![CDATA[ 18 //////////////////////////////////////////////////////////////////////////// 19 // Test 20 21 function doTest() 22 { 23 ////////////////////////////////////////////////////////////////////////// 24 // button 25 26 var accTree = { 27 role: ROLE_PUSHBUTTON, 28 name: "hello", 29 children: [ ] 30 }; 31 testAccessibleTree("button1", accTree); 32 33 ////////////////////////////////////////////////////////////////////////// 34 // toolbarbutton 35 36 accTree = { 37 role: ROLE_PUSHBUTTON, 38 name: "hello", 39 children: [ ] 40 }; 41 testAccessibleTree("button2", accTree); 42 43 ////////////////////////////////////////////////////////////////////////// 44 // toolbarbutton with type="checkbox" 45 46 accTree = { 47 role: ROLE_TOGGLE_BUTTON, 48 name: "hello", 49 children: [ ] 50 }; 51 testAccessibleTree("button3", accTree); 52 53 SimpleTest.finish() 54 } 55 56 SimpleTest.waitForExplicitFinish(); 57 addA11yLoadEvent(doTest); 58 ]]> 59 </script> 60 61 <hbox flex="1" style="overflow: auto;"> 62 <body xmlns="http://www.w3.org/1999/xhtml"> 63 <a target="_blank" 64 href="https://bugzilla.mozilla.org/show_bug.cgi?id=249292" 65 title="Ensure accessible children for toolbarbutton types 'menu'"> 66 Mozilla Bug 249292 67 </a><br/> 68 <p id="display"></p> 69 <div id="content" style="display: none"> 70 </div> 71 <pre id="test"> 72 </pre> 73 </body> 74 75 <vbox flex="1"> 76 <button id="button1" label="hello"/> 77 <toolbarbutton id="button2" label="hello"/> 78 <toolbarbutton id="button3" type="checkbox" label="hello"/> 79 </vbox> 80 </hbox> 81 82 </window>