accessible/tests/mochitest/attributes/test_obj_group.xul

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

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

mercurial