accessible/tests/mochitest/attributes/test_obj_group.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/attributes/test_obj_group.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,216 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     1.6 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
     1.7 +                 type="text/css"?>
     1.8 +
     1.9 +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    1.10 +        title="Accessibility Group Attributes ('level', 'setsize', 'posinset') Test.">
    1.11 +
    1.12 +  <script type="application/javascript"
    1.13 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
    1.14 +
    1.15 +  <script type="application/javascript"
    1.16 +          src="../common.js" />
    1.17 +  <script type="application/javascript"
    1.18 +          src="../events.js" />
    1.19 +  <script type="application/javascript"
    1.20 +          src="../attributes.js" />
    1.21 +
    1.22 +  <script type="application/javascript">
    1.23 +  <![CDATA[
    1.24 +    function openMenu(aID)
    1.25 +    {
    1.26 +      this.menuNode = getNode(aID);
    1.27 +
    1.28 +      this.eventSeq = [
    1.29 +        new invokerChecker(EVENT_FOCUS, this.menuNode)
    1.30 +      ];
    1.31 +
    1.32 +      this.invoke = function openMenu_invoke()
    1.33 +      {
    1.34 +        this.menuNode.open = true;
    1.35 +      }
    1.36 +
    1.37 +      this.finalCheck = function openMenu_finalCheck()
    1.38 +      {
    1.39 +        testGroupAttrs("menu_item1.1", 1, 1);
    1.40 +        testGroupAttrs("menu_item1.2", 1, 3);
    1.41 +        testGroupAttrs("menu_item1.4", 2, 3);
    1.42 +        testGroupAttrs("menu_item2", 3, 3);
    1.43 +      }
    1.44 +
    1.45 +      this.getID = function openMenu_getID()
    1.46 +      {
    1.47 +        return "open menu " + prettyName(aID);
    1.48 +      }
    1.49 +    }
    1.50 +
    1.51 +    function openSubMenu(aID)
    1.52 +    {
    1.53 +      this.menuNode = getNode(aID);
    1.54 +
    1.55 +      this.eventSeq = [
    1.56 +        new invokerChecker(EVENT_FOCUS, this.menuNode)
    1.57 +      ];
    1.58 +
    1.59 +      this.invoke = function openSubMenu_invoke()
    1.60 +      {
    1.61 +        this.menuNode.open = true;
    1.62 +      }
    1.63 +
    1.64 +      this.finalCheck = function openSubMenu_finalCheck()
    1.65 +      {
    1.66 +        testGroupAttrs("menu_item2.1", 1, 2, 1);
    1.67 +        testGroupAttrs("menu_item2.2", 2, 2, 1);
    1.68 +      }
    1.69 +
    1.70 +      this.getID = function openSubMenu_getID()
    1.71 +      {
    1.72 +        return "open submenu " + prettyName(aID);
    1.73 +      }
    1.74 +    }
    1.75 +
    1.76 +    //gA11yEventDumpToConsole = true; // debug stuff
    1.77 +
    1.78 +    var gQueue = null;
    1.79 +    function doTest()
    1.80 +    {
    1.81 +      //////////////////////////////////////////////////////////////////////////
    1.82 +      // xul:listbox (bug 417317)
    1.83 +      testGroupAttrs("listitem1", 1, 4);
    1.84 +      testGroupAttrs("listitem2", 2, 4);
    1.85 +      testGroupAttrs("listitem3", 3, 4);
    1.86 +      testGroupAttrs("listitem4", 4, 4);
    1.87 +
    1.88 +      //////////////////////////////////////////////////////////////////////////
    1.89 +      // xul:tab
    1.90 +      testGroupAttrs("tab1", 1, 2);
    1.91 +      testGroupAttrs("tab2", 2, 2);
    1.92 +
    1.93 +      //////////////////////////////////////////////////////////////////////////
    1.94 +      // xul:radio
    1.95 +      testGroupAttrs("radio1", 1, 2);
    1.96 +      testGroupAttrs("radio2", 2, 2);
    1.97 +
    1.98 +      //////////////////////////////////////////////////////////////////////////
    1.99 +      // xul:menulist
   1.100 +      testGroupAttrs("menulist1.1", 1);
   1.101 +      testGroupAttrs("menulist1.2", 2);
   1.102 +      testGroupAttrs("menulist1.3", 3);
   1.103 +      testGroupAttrs("menulist1.4", 4);
   1.104 +
   1.105 +      //////////////////////////////////////////////////////////////////////////
   1.106 +      // ARIA menu (bug 441888)
   1.107 +      testGroupAttrs("aria-menuitem", 1, 3);
   1.108 +      testGroupAttrs("aria-menuitemcheckbox", 2, 3);
   1.109 +      testGroupAttrs("aria-menuitemradio", 3, 3);
   1.110 +      testGroupAttrs("aria-menuitem2", 1, 1);
   1.111 +
   1.112 +      //////////////////////////////////////////////////////////////////////////
   1.113 +      // xul:menu (bug 443881)
   1.114 +      gQueue = new eventQueue();
   1.115 +      gQueue.push(new openMenu("menu_item1"));
   1.116 +      gQueue.push(new openSubMenu("menu_item2"));
   1.117 +      gQueue.invoke(); // SimpleTest.finish();
   1.118 +    }
   1.119 +
   1.120 +    SimpleTest.waitForExplicitFinish();
   1.121 +    addA11yLoadEvent(doTest);
   1.122 +  ]]>
   1.123 +  </script>
   1.124 +
   1.125 +  <hbox flex="1" style="overflow: auto;">
   1.126 +  <body xmlns="http://www.w3.org/1999/xhtml">
   1.127 +    <a target="_blank"
   1.128 +       href="https://bugzilla.mozilla.org/show_bug.cgi?id=417317"
   1.129 +       title="Certain types of LISTITEM accessibles no longer get attributes set like 'x of y', regression from fix for bug 389926">
   1.130 +      Mozilla Bug 417317
   1.131 +    </a><br/>
   1.132 +    <a target="_blank"
   1.133 +       href="https://bugzilla.mozilla.org/show_bug.cgi?id=443881"
   1.134 +       title="take into account separators in xul menus when group attributes are calculating">
   1.135 +      Mozilla Bug 443881
   1.136 +    </a><br/>
   1.137 +    <a target="_blank"
   1.138 +       href="https://bugzilla.mozilla.org/show_bug.cgi?id=441888"
   1.139 +       title="ARIA checked menu items are not included in the total list of menu items">
   1.140 +      Mozilla Bug 441888
   1.141 +    </a><br/>
   1.142 +
   1.143 +    <p id="display"></p>
   1.144 +    <div id="content" style="display: none">
   1.145 +    </div>
   1.146 +    <pre id="test">
   1.147 +    </pre>
   1.148 +  </body>
   1.149 +
   1.150 +  <vbox flex="1">
   1.151 +
   1.152 +  <listbox>
   1.153 +    <listitem label="listitem1" id="listitem1"/>
   1.154 +    <listitem label="listitem2" id="listitem2" type="checkbox"/>
   1.155 +    <listitem label="listitem3" id="listitem3" type="checkbox"/>
   1.156 +    <listitem label="listitem4" id="listitem4"/>
   1.157 +  </listbox>
   1.158 +
   1.159 +  <menubar>
   1.160 +    <menu label="item1" id="menu_item1">
   1.161 +      <menupopup>
   1.162 +        <menuitem label="item1.1" id="menu_item1.1"/>
   1.163 +        <menuseparator/>
   1.164 +        <menuitem label="item1.2" id="menu_item1.2"/>
   1.165 +        <menuitem label="item1.3" hidden="true"/>
   1.166 +        <menuitem label="item1.4" id="menu_item1.4"/>
   1.167 +        <menu label="item2" id="menu_item2">
   1.168 +          <menupopup>
   1.169 +            <menuitem label="item2.1" id="menu_item2.1"/>
   1.170 +            <menuitem label="item2.2" id="menu_item2.2"/>
   1.171 +          </menupopup>
   1.172 +        </menu>
   1.173 +      </menupopup>
   1.174 +    </menu>
   1.175 +  </menubar>
   1.176 +
   1.177 +  <tabbox>
   1.178 +    <tabs>
   1.179 +      <tab id="tab1" label="tab1"/>
   1.180 +      <tab id="tab2" label="tab3"/>
   1.181 +    </tabs>
   1.182 +    <tabpanels>
   1.183 +      <tabpanel/>
   1.184 +      <tabpanel/>
   1.185 +    </tabpanels>
   1.186 +  </tabbox>
   1.187 +
   1.188 +  <radiogroup>
   1.189 +    <radio id="radio1" label="radio1"/>
   1.190 +    <radio id="radio2" label="radio2"/>
   1.191 +  </radiogroup>
   1.192 +
   1.193 +  <menulist id="menulist1" label="Vehicle">
   1.194 +    <menupopup>
   1.195 +      <menuitem id="menulist1.1" label="Car"/>
   1.196 +      <menuitem id="menulist1.2" label="Taxi"/>
   1.197 +      <menuitem id="menulist1.3" label="Bus" selected="true"/>
   1.198 +      <menuitem id="menulist1.4" label="Train"/>
   1.199 +    </menupopup>
   1.200 +  </menulist>
   1.201 +
   1.202 +  <vbox>
   1.203 +    <description role="menuitem" id="aria-menuitem"
   1.204 +                 value="conventional menuitem"/>
   1.205 +    <description role="menuitemcheckbox" id="aria-menuitemcheckbox"
   1.206 +                 value="conventional checkbox menuitem"/>
   1.207 +    <description role="menuitem" hidden="true"/>
   1.208 +    <description role="menuitemradio" id="aria-menuitemradio"
   1.209 +                 value="conventional radio menuitem"/>
   1.210 +    <description role="separator"
   1.211 +                 value="conventional separator"/>
   1.212 +    <description role="menuitem" id="aria-menuitem2"
   1.213 +                 value="conventional menuitem"/>
   1.214 +  </vbox>
   1.215 +
   1.216 +  </vbox>
   1.217 +  </hbox>
   1.218 +</window>
   1.219 +

mercurial