tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_obj_group.xhtml (6630B)


      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="Accessibility Group Attributes ('level', 'setsize', 'posinset') Test.">
      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="../events.js" />
     15  <script type="application/javascript"
     16          src="../attributes.js" />
     17 
     18  <script type="application/javascript">
     19  <![CDATA[
     20    function openMenu(aID)
     21    {
     22      this.menuNode = getNode(aID);
     23 
     24      this.eventSeq = [
     25        new invokerChecker(EVENT_FOCUS, this.menuNode)
     26      ];
     27 
     28      this.invoke = function openMenu_invoke()
     29      {
     30        this.menuNode.open = true;
     31      }
     32 
     33      this.finalCheck = function openMenu_finalCheck()
     34      {
     35        testGroupAttrs("menu_item1.1", 1, 1);
     36        testGroupAttrs("menu_item1.2", 1, 3);
     37        testGroupAttrs("menu_item1.4", 2, 3);
     38        testGroupAttrs("menu_item2", 3, 3);
     39      }
     40 
     41      this.getID = function openMenu_getID()
     42      {
     43        return "open menu " + prettyName(aID);
     44      }
     45    }
     46 
     47    function openSubMenu(aID)
     48    {
     49      this.menuNode = getNode(aID);
     50 
     51      this.eventSeq = [
     52        new invokerChecker(EVENT_FOCUS, this.menuNode)
     53      ];
     54 
     55      this.invoke = function openSubMenu_invoke()
     56      {
     57        this.menuNode.open = true;
     58      }
     59 
     60      this.finalCheck = function openSubMenu_finalCheck()
     61      {
     62        testGroupAttrs("menu_item2.1", 1, 2, 1);
     63        testGroupAttrs("menu_item2.2", 2, 2, 1);
     64      }
     65 
     66      this.getID = function openSubMenu_getID()
     67      {
     68        return "open submenu " + prettyName(aID);
     69      }
     70    }
     71 
     72    //gA11yEventDumpToConsole = true; // debug stuff
     73 
     74    var gQueue = null;
     75    function doTest()
     76    {
     77      //////////////////////////////////////////////////////////////////////////
     78      // xul:listbox (bug 417317)
     79      testGroupAttrs("listitem1", 1, 4);
     80      testGroupAttrs("listitem2", 2, 4);
     81      testGroupAttrs("listitem3", 3, 4);
     82      testGroupAttrs("listitem4", 4, 4);
     83 
     84      //////////////////////////////////////////////////////////////////////////
     85      // xul:tab
     86      testGroupAttrs("tab1", 1, 2);
     87      testGroupAttrs("tab2", 2, 2);
     88 
     89      //////////////////////////////////////////////////////////////////////////
     90      // xul:radio
     91      testGroupAttrs("radio1", 1, 2);
     92      testGroupAttrs("radio2", 2, 2);
     93 
     94      //////////////////////////////////////////////////////////////////////////
     95      // xul:menulist
     96      testGroupAttrs("menulist1.1", 1);
     97      testGroupAttrs("menulist1.2", 2);
     98      testGroupAttrs("menulist1.3", 3);
     99      testGroupAttrs("menulist1.4", 4);
    100 
    101      //////////////////////////////////////////////////////////////////////////
    102      // ARIA menu (bug 441888)
    103      testGroupAttrs("aria-menuitem", 1, 3);
    104      testGroupAttrs("aria-menuitemcheckbox", 2, 3);
    105      testGroupAttrs("aria-menuitemradio", 3, 3);
    106      testGroupAttrs("aria-menuitem2", 1, 1);
    107 
    108      //////////////////////////////////////////////////////////////////////////
    109      // xul:menu (bug 443881)
    110      gQueue = new eventQueue();
    111      gQueue.push(new openMenu("menu_item1"));
    112      gQueue.push(new openSubMenu("menu_item2"));
    113      gQueue.invoke(); // SimpleTest.finish();
    114    }
    115 
    116    SimpleTest.waitForExplicitFinish();
    117    addA11yLoadEvent(doTest);
    118  ]]>
    119  </script>
    120 
    121  <hbox flex="1" style="overflow: auto;">
    122  <body xmlns="http://www.w3.org/1999/xhtml">
    123    <a target="_blank"
    124       href="https://bugzilla.mozilla.org/show_bug.cgi?id=417317"
    125       title="Certain types of LISTITEM accessibles no longer get attributes set like 'x of y', regression from fix for bug 389926">
    126      Mozilla Bug 417317
    127    </a><br/>
    128    <a target="_blank"
    129       href="https://bugzilla.mozilla.org/show_bug.cgi?id=443881"
    130       title="take into account separators in xul menus when group attributes are calculating">
    131      Mozilla Bug 443881
    132    </a><br/>
    133    <a target="_blank"
    134       href="https://bugzilla.mozilla.org/show_bug.cgi?id=441888"
    135       title="ARIA checked menu items are not included in the total list of menu items">
    136      Mozilla Bug 441888
    137    </a><br/>
    138 
    139    <p id="display"></p>
    140    <div id="content" style="display: none">
    141    </div>
    142    <pre id="test">
    143    </pre>
    144  </body>
    145 
    146  <vbox flex="1">
    147 
    148  <richlistbox>
    149    <richlistitem id="listitem1"/>
    150    <richlistitem id="listitem2"><label value="listitem2"/></richlistitem>
    151    <richlistitem id="listitem3"/>
    152    <richlistitem id="listitem4"><label value="listitem4"/></richlistitem>
    153  </richlistbox>
    154 
    155  <menubar>
    156    <menu label="item1" id="menu_item1">
    157      <menupopup>
    158        <menuitem label="item1.1" id="menu_item1.1"/>
    159        <menuseparator/>
    160        <menuitem label="item1.2" id="menu_item1.2"/>
    161        <menuitem label="item1.3" hidden="true"/>
    162        <menuitem label="item1.4" id="menu_item1.4"/>
    163        <menu label="item2" id="menu_item2">
    164          <menupopup>
    165            <menuitem label="item2.1" id="menu_item2.1"/>
    166            <menuitem label="item2.2" id="menu_item2.2"/>
    167          </menupopup>
    168        </menu>
    169      </menupopup>
    170    </menu>
    171  </menubar>
    172 
    173  <tabbox>
    174    <tabs>
    175      <tab id="tab1" label="tab1"/>
    176      <tab id="tab2" label="tab3"/>
    177    </tabs>
    178    <tabpanels>
    179      <tabpanel/>
    180      <tabpanel/>
    181    </tabpanels>
    182  </tabbox>
    183 
    184  <radiogroup>
    185    <radio id="radio1" label="radio1"/>
    186    <radio id="radio2" label="radio2"/>
    187  </radiogroup>
    188 
    189  <menulist id="menulist1" label="Vehicle">
    190    <menupopup>
    191      <menuitem id="menulist1.1" label="Car"/>
    192      <menuitem id="menulist1.2" label="Taxi"/>
    193      <menuitem id="menulist1.3" label="Bus" selected="true"/>
    194      <menuitem id="menulist1.4" label="Train"/>
    195    </menupopup>
    196  </menulist>
    197 
    198  <vbox>
    199    <div role="menu">
    200      <description role="menuitem" id="aria-menuitem"
    201                  value="conventional menuitem"/>
    202      <description role="menuitemcheckbox" id="aria-menuitemcheckbox"
    203                  value="conventional checkbox menuitem"/>
    204      <description role="menuitem" hidden="true"/>
    205      <description role="menuitemradio" id="aria-menuitemradio"
    206                  value="conventional radio menuitem"/>
    207      <description role="separator"
    208                  value="conventional separator"/>
    209      <description role="menuitem" id="aria-menuitem2"
    210                  value="conventional menuitem"/>
    211    </div>
    212  </vbox>
    213 
    214  </vbox>
    215  </hbox>
    216 </window>