test_general.xhtml (4766B)
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 <?xml-stylesheet href="../nsIAccessible_name.css" 6 type="text/css"?> 7 8 9 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 10 xmlns:html="http://www.w3.org/1999/xhtml" 11 title="nsIAccessible actions testing"> 12 13 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> 14 15 <script type="application/javascript" 16 src="../common.js" /> 17 <script type="application/javascript" 18 src="../events.js" /> 19 <script type="application/javascript" 20 src="../actions.js" /> 21 <script type="application/javascript" 22 src="../role.js" /> 23 <script type="application/javascript" 24 src="../states.js" /> 25 26 <script type="application/javascript"> 27 <![CDATA[ 28 //gA11yEventDumpToConsole = true; 29 //enableLogging("tree,verbose"); // debug 30 31 SimpleTest.expectAssertions(0, 1); 32 33 function doTest() 34 { 35 var actionsArray = [ 36 { 37 ID: "menu", 38 actionName: "click", 39 events: CLICK_EVENTS, 40 // Wait for the submenu to show up. 41 eventSeq: [ 42 new invokerChecker(EVENT_SHOW, getNode("submenu")) 43 ] 44 }, 45 { 46 ID: "submenu", 47 actionName: "click", 48 events: CLICK_EVENTS 49 }, 50 { 51 ID: "menuitem", 52 actionName: "click", 53 events: XUL_EVENTS 54 }, 55 { 56 ID: "button", 57 actionName: "press", 58 events: XUL_EVENTS 59 }, 60 { 61 ID: "buttonmenu", 62 actionName: "press", 63 events: CLICK_EVENTS 64 }, 65 { 66 ID: "name_entry_label", 67 actionName: "click", 68 events: CLICK_EVENTS 69 }, 70 { 71 ID: "labelWithPopup", 72 actionName: "click", 73 events: CLICK_EVENTS 74 }, 75 { 76 ID: "toolbarbutton_label", 77 actionName: "click", 78 targetID: "toolbarbutton", 79 events: XUL_EVENTS, 80 allowBubbling: true 81 }, 82 { 83 ID: "menulist_label", 84 actionName: "click", 85 // focusChecker expects a unique focus event. However, there might 86 // still be pending focus events not caught by previous tests. 87 eventSeq: [ 88 new invokerChecker(EVENT_FOCUS, getNode("menulist")) 89 ] 90 }/*, // XXX: bug 490288 91 { 92 ID: "buttonmenu_item", 93 actionName: "click", 94 events: CLICK_EVENTS 95 }*/ 96 ]; 97 98 is(getAccessible("name_entry_label").firstChild.actionCount, 1, "label text should have 1 action"); 99 100 testActions(actionsArray); 101 } 102 103 SimpleTest.waitForExplicitFinish(); 104 addA11yLoadEvent(doTest); 105 ]]> 106 </script> 107 108 <hbox flex="1" style="overflow: auto;"> 109 <body xmlns="http://www.w3.org/1999/xhtml"> 110 <a target="_blank" rel="opener" 111 href="https://bugzilla.mozilla.org/show_bug.cgi?id=410765" 112 title="nsIAccessible actions testing"> 113 Mozilla Bug 410765 114 </a> 115 <a target="_blank" rel="opener" 116 href="https://bugzilla.mozilla.org/show_bug.cgi?id=504252" 117 title="Expose STATE_HASPOPUP on XUL elements that have an @popup attribute"> 118 Mozilla Bug 504252 119 </a><br/> 120 <p id="display"></p> 121 <div id="content" style="display: none"> 122 </div> 123 <pre id="test"> 124 </pre> 125 </body> 126 127 <vbox flex="1"> 128 <menubar> 129 <menu label="menu" id="menu"> 130 <menupopup> 131 <menuitem label="menu item" id="menuitem"/> 132 <menu label="submenu" id="submenu"> 133 <menupopup> 134 <menuitem label="menu item"/> 135 </menupopup> 136 </menu> 137 </menupopup> 138 </menu> 139 </menubar> 140 141 <button label="button" id="button"/> 142 143 <button type="menu" id="buttonmenu" label="button"> 144 <menupopup> 145 <menuitem label="item1" id="buttonmenu_item"/> 146 <menuitem label="item1"/> 147 </menupopup> 148 </button> 149 150 <label id="labelWithPopup" value="file name" 151 popup="fileContext" 152 tabindex="0"/> 153 <hbox> 154 <label id="name_entry_label" value="Name" control="name_entry"/> 155 <html:input id="name_entry"/> 156 </hbox> 157 <toolbarbutton id="toolbarbutton"> 158 <label id="toolbarbutton_label">toolbarbutton</label> 159 </toolbarbutton> 160 <hbox> 161 <label id="menulist_label" control="menulist">menulist</label> 162 <menulist id="menulist"/> 163 </hbox> 164 </vbox> 165 </hbox> 166 </window>