accessible/tests/mochitest/name/test_tree.xul

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     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="general.css"
     6                  type="text/css"?>
     9 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    10         title="Accessibility Name Calculating Test.">
    12   <script type="application/javascript"
    13           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
    15   <script type="application/javascript"
    16           src="../treeview.js" />
    18   <script type="application/javascript"
    19           src="../common.js"></script>
    20   <script type="application/javascript"
    21           src="../role.js"></script>
    22   <script type="application/javascript"
    23           src="../name.js"></script>
    24   <script type="application/javascript"
    25           src="../events.js"></script>
    27   <script type="application/javascript">
    28   <![CDATA[
    29     function treeTester(aID)
    30     {
    31       this.DOMNode = getNode(aID);
    33       this.invoke = function treeTester_invoke()
    34       {
    35         this.DOMNode.treeBoxObject.view = new nsTreeTreeView();
    36       }
    38       this.check = function treeTester_check(aEvent)
    39       {
    40         var tree = {
    41           role: ROLE_OUTLINE,
    42           children: [
    43             {
    44               role: ROLE_LIST
    45             },
    46             {
    47               role: ROLE_OUTLINEITEM,
    48               children: [],
    49               name: "row1col"
    50             },
    51             {
    52               role: ROLE_OUTLINEITEM,
    53               children: [],
    54               name: "row2_col"
    55             },
    56             {
    57               role: ROLE_OUTLINEITEM,
    58               children: [],
    59               name: "row2.1_col"
    60             },
    61             {
    62               role: ROLE_OUTLINEITEM,
    63               children: [],
    64               name: "row2.2_col"
    65             },
    66             {
    67               role: ROLE_OUTLINEITEM,
    68               children: [],
    69               name: "row3_col"
    70             },
    71             {
    72               role: ROLE_OUTLINEITEM,
    73               children: [],
    74               name: "row4col"
    75             }
    76           ]
    77         };
    78         testAccessibleTree(this.DOMNode, tree);
    79       }
    81       this.getID = function treeTester_getID()
    82       {
    83         return "Tree name testing for " + aID;
    84       }
    85     }
    87     function tableTester(aID, aIsTable, aCol1ID, aCol2ID)
    88     {
    89       this.DOMNode = getNode(aID);
    91       this.invoke = function tableTester_invoke()
    92       {
    93         this.DOMNode.treeBoxObject.view = new nsTableTreeView(2);
    94       }
    96       this.check = function tableTester_check(aEvent)
    97       {
    98         var tree = {
    99           role: aIsTable ? ROLE_TABLE : ROLE_TREE_TABLE,
   100           children: [
   101             {
   102               role: ROLE_LIST
   103             },
   104             {
   105               role: ROLE_ROW,
   106               children: [
   107                 {
   108                   role: ROLE_GRID_CELL,
   109                   children: [],
   110                   name: "row0_" + aCol1ID
   111                 },
   112                 {
   113                   role: ROLE_GRID_CELL,
   114                   children: [],
   115                   name: "row0_" + aCol2ID
   116                 }
   117               ],
   118               name: "row0_" + aCol1ID + " row0_" + aCol2ID
   119             },
   120             {
   121               role: ROLE_ROW,
   122               children: [
   123                 {
   124                   role: ROLE_GRID_CELL,
   125                   children: [],
   126                   name: "row1_" + aCol1ID
   127                 },
   128                 {
   129                   role: ROLE_GRID_CELL,
   130                   children: [],
   131                   name: "row1_" + aCol2ID
   132                 }
   133               ],
   134               name: "row1_" + aCol1ID + " row1_" + aCol2ID
   135             }
   136           ]
   137         };
   138         testAccessibleTree(this.DOMNode, tree);
   139       }
   141       this.getID = function tableTester_getID()
   142       {
   143         return "Tree name testing for " + aID;
   144       }
   145     }
   147     var gQueue = null;
   148     function doTest()
   149     {
   150       var gQueue = new eventQueue(EVENT_REORDER);
   152       gQueue.push(new treeTester("tree"));
   153       gQueue.push(new tableTester("table", true, "t_col1", "t_col2"));
   154       gQueue.push(new tableTester("treetable", false, "tt_col1", "tt_col2"));
   156       gQueue.invoke(); // Will call SimpleTest.finish()
   157     }
   159     SimpleTest.waitForExplicitFinish();
   160     addA11yLoadEvent(doTest);
   161   ]]>
   162   </script>
   164   <hbox flex="1" style="overflow: auto;">
   166   <body xmlns="http://www.w3.org/1999/xhtml">
   167     <a target="_blank"
   168        href="https://bugzilla.mozilla.org/show_bug.cgi?id=546812"
   169        title="Treegrid row accessible shouldn't inherit name from tree accessible">
   170       Mozilla Bug 546812
   171     </a>
   172     <a target="_blank"
   173        href="https://bugzilla.mozilla.org/show_bug.cgi?id=664376"
   174        title="Table rows of XUL trees no longer containing cell content as accessible name">
   175       Mozilla Bug 664376
   176     </a>
   177     <p id="display"></p>
   178     <div id="content" style="display: none">
   179     </div>
   180     <pre id="test">
   181     </pre>
   182   </body>
   184   <vbox flex="1">
   186   <tree id="tree" flex="1">
   187     <treecols>
   188       <treecol id="col" flex="1" primary="true" label="column"/>
   189     </treecols>
   190     <treechildren/>
   191   </tree>
   193   <tree id="table" flex="1">
   194     <treecols>
   195       <treecol id="t_col1" flex="1" label="column"/>
   196       <treecol id="t_col2" flex="1" label="column 2"/>
   197     </treecols>
   198     <treechildren/>
   199   </tree>
   201   <tree id="treetable" flex="1">
   202     <treecols>
   203       <treecol id="tt_col1" flex="1" label="column" primary="true"/>
   204       <treecol id="tt_col2" flex="1" label="column 2"/>
   205     </treecols>
   206     <treechildren/>
   207   </tree>
   209   </vbox> <!-- close tests area -->
   210   </hbox> <!-- close main area -->
   211 </window>

mercurial