test_listbox.xhtml (2035B)
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="XUL listbox element test."> 8 9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> 10 11 <script type="application/javascript" 12 src="../common.js"></script> 13 <script type="application/javascript" 14 src="../role.js"></script> 15 16 <script type="application/javascript"> 17 <![CDATA[ 18 function doTest() 19 { 20 var id = ""; 21 var acc = null; 22 23 ////////////////////////////////////////////////////////////////////////// 24 // Simple listbox. There is no nsIAccessibleTable interface. 25 26 id = "listbox1"; 27 acc = getAccessible(id); 28 29 // query nsIAccessibleTable 30 try { 31 acc.QueryInterface(nsIAccessibleTable); 32 ok(false, 33 id + " shouldn't implement nsIAccessibleTable interface."); 34 } catch(e) { 35 ok(true, id + " doesn't implement nsIAccessibleTable interface."); 36 } 37 38 // role 39 testRole(id, ROLE_LISTBOX); 40 41 SimpleTest.finish(); 42 } 43 44 SimpleTest.waitForExplicitFinish(); 45 addA11yLoadEvent(doTest); 46 ]]> 47 </script> 48 49 <hbox style="overflow: auto;"> 50 <body xmlns="http://www.w3.org/1999/xhtml"> 51 <a target="_blank" 52 href="https://bugzilla.mozilla.org/show_bug.cgi?id=418371" 53 title="implement the rest of methods of nsIAccessibleTable on xul:listbox"> 54 Mozilla Bug 418371 55 </a> 56 <p id="display"></p> 57 <div id="content" style="display: none"> 58 </div> 59 <pre id="test"> 60 </pre> 61 </body> 62 63 <vbox flex="1"> 64 <label control="listbox1" value="listbox: "/> 65 <richlistbox id="listbox1"> 66 <richlistitem id="item1"><label value="item1"/></richlistitem> 67 <richlistitem id="item1"><label value="item2"/></richlistitem> 68 </richlistbox> 69 </vbox> 70 </hbox> 71 72 </window>