accessible/tests/mochitest/name/test_tree.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/name/test_tree.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,212 @@
     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 +<?xml-stylesheet href="general.css"
     1.9 +                 type="text/css"?>
    1.10 +
    1.11 +
    1.12 +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    1.13 +        title="Accessibility Name Calculating Test.">
    1.14 +
    1.15 +  <script type="application/javascript"
    1.16 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
    1.17 +
    1.18 +  <script type="application/javascript"
    1.19 +          src="../treeview.js" />
    1.20 +
    1.21 +  <script type="application/javascript"
    1.22 +          src="../common.js"></script>
    1.23 +  <script type="application/javascript"
    1.24 +          src="../role.js"></script>
    1.25 +  <script type="application/javascript"
    1.26 +          src="../name.js"></script>
    1.27 +  <script type="application/javascript"
    1.28 +          src="../events.js"></script>
    1.29 +
    1.30 +  <script type="application/javascript">
    1.31 +  <![CDATA[
    1.32 +    function treeTester(aID)
    1.33 +    {
    1.34 +      this.DOMNode = getNode(aID);
    1.35 +
    1.36 +      this.invoke = function treeTester_invoke()
    1.37 +      {
    1.38 +        this.DOMNode.treeBoxObject.view = new nsTreeTreeView();
    1.39 +      }
    1.40 +
    1.41 +      this.check = function treeTester_check(aEvent)
    1.42 +      {
    1.43 +        var tree = {
    1.44 +          role: ROLE_OUTLINE,
    1.45 +          children: [
    1.46 +            {
    1.47 +              role: ROLE_LIST
    1.48 +            },
    1.49 +            {
    1.50 +              role: ROLE_OUTLINEITEM,
    1.51 +              children: [],
    1.52 +              name: "row1col"
    1.53 +            },
    1.54 +            {
    1.55 +              role: ROLE_OUTLINEITEM,
    1.56 +              children: [],
    1.57 +              name: "row2_col"
    1.58 +            },
    1.59 +            {
    1.60 +              role: ROLE_OUTLINEITEM,
    1.61 +              children: [],
    1.62 +              name: "row2.1_col"
    1.63 +            },
    1.64 +            {
    1.65 +              role: ROLE_OUTLINEITEM,
    1.66 +              children: [],
    1.67 +              name: "row2.2_col"
    1.68 +            },
    1.69 +            {
    1.70 +              role: ROLE_OUTLINEITEM,
    1.71 +              children: [],
    1.72 +              name: "row3_col"
    1.73 +            },
    1.74 +            {
    1.75 +              role: ROLE_OUTLINEITEM,
    1.76 +              children: [],
    1.77 +              name: "row4col"
    1.78 +            }
    1.79 +          ]
    1.80 +        };
    1.81 +        testAccessibleTree(this.DOMNode, tree);
    1.82 +      }
    1.83 +
    1.84 +      this.getID = function treeTester_getID()
    1.85 +      {
    1.86 +        return "Tree name testing for " + aID;
    1.87 +      }
    1.88 +    }
    1.89 +
    1.90 +    function tableTester(aID, aIsTable, aCol1ID, aCol2ID)
    1.91 +    {
    1.92 +      this.DOMNode = getNode(aID);
    1.93 +
    1.94 +      this.invoke = function tableTester_invoke()
    1.95 +      {
    1.96 +        this.DOMNode.treeBoxObject.view = new nsTableTreeView(2);
    1.97 +      }
    1.98 +
    1.99 +      this.check = function tableTester_check(aEvent)
   1.100 +      {
   1.101 +        var tree = {
   1.102 +          role: aIsTable ? ROLE_TABLE : ROLE_TREE_TABLE,
   1.103 +          children: [
   1.104 +            {
   1.105 +              role: ROLE_LIST
   1.106 +            },
   1.107 +            {
   1.108 +              role: ROLE_ROW,
   1.109 +              children: [
   1.110 +                {
   1.111 +                  role: ROLE_GRID_CELL,
   1.112 +                  children: [],
   1.113 +                  name: "row0_" + aCol1ID
   1.114 +                },
   1.115 +                {
   1.116 +                  role: ROLE_GRID_CELL,
   1.117 +                  children: [],
   1.118 +                  name: "row0_" + aCol2ID
   1.119 +                }
   1.120 +              ],
   1.121 +              name: "row0_" + aCol1ID + " row0_" + aCol2ID
   1.122 +            },
   1.123 +            {
   1.124 +              role: ROLE_ROW,
   1.125 +              children: [
   1.126 +                {
   1.127 +                  role: ROLE_GRID_CELL,
   1.128 +                  children: [],
   1.129 +                  name: "row1_" + aCol1ID
   1.130 +                },
   1.131 +                {
   1.132 +                  role: ROLE_GRID_CELL,
   1.133 +                  children: [],
   1.134 +                  name: "row1_" + aCol2ID
   1.135 +                }
   1.136 +              ],
   1.137 +              name: "row1_" + aCol1ID + " row1_" + aCol2ID
   1.138 +            }
   1.139 +          ]
   1.140 +        };
   1.141 +        testAccessibleTree(this.DOMNode, tree);
   1.142 +      }
   1.143 +
   1.144 +      this.getID = function tableTester_getID()
   1.145 +      {
   1.146 +        return "Tree name testing for " + aID;
   1.147 +      }
   1.148 +    }
   1.149 +
   1.150 +    var gQueue = null;
   1.151 +    function doTest()
   1.152 +    {
   1.153 +      var gQueue = new eventQueue(EVENT_REORDER);
   1.154 +
   1.155 +      gQueue.push(new treeTester("tree"));
   1.156 +      gQueue.push(new tableTester("table", true, "t_col1", "t_col2"));
   1.157 +      gQueue.push(new tableTester("treetable", false, "tt_col1", "tt_col2"));
   1.158 +
   1.159 +      gQueue.invoke(); // Will call SimpleTest.finish()
   1.160 +    }
   1.161 +
   1.162 +    SimpleTest.waitForExplicitFinish();
   1.163 +    addA11yLoadEvent(doTest);
   1.164 +  ]]>
   1.165 +  </script>
   1.166 +
   1.167 +  <hbox flex="1" style="overflow: auto;">
   1.168 +
   1.169 +  <body xmlns="http://www.w3.org/1999/xhtml">
   1.170 +    <a target="_blank"
   1.171 +       href="https://bugzilla.mozilla.org/show_bug.cgi?id=546812"
   1.172 +       title="Treegrid row accessible shouldn't inherit name from tree accessible">
   1.173 +      Mozilla Bug 546812
   1.174 +    </a>
   1.175 +    <a target="_blank"
   1.176 +       href="https://bugzilla.mozilla.org/show_bug.cgi?id=664376"
   1.177 +       title="Table rows of XUL trees no longer containing cell content as accessible name">
   1.178 +      Mozilla Bug 664376
   1.179 +    </a>
   1.180 +    <p id="display"></p>
   1.181 +    <div id="content" style="display: none">
   1.182 +    </div>
   1.183 +    <pre id="test">
   1.184 +    </pre>
   1.185 +  </body>
   1.186 +
   1.187 +  <vbox flex="1">
   1.188 +
   1.189 +  <tree id="tree" flex="1">
   1.190 +    <treecols>
   1.191 +      <treecol id="col" flex="1" primary="true" label="column"/>
   1.192 +    </treecols>
   1.193 +    <treechildren/>
   1.194 +  </tree>
   1.195 +
   1.196 +  <tree id="table" flex="1">
   1.197 +    <treecols>
   1.198 +      <treecol id="t_col1" flex="1" label="column"/>
   1.199 +      <treecol id="t_col2" flex="1" label="column 2"/>
   1.200 +    </treecols>
   1.201 +    <treechildren/>
   1.202 +  </tree>
   1.203 +
   1.204 +  <tree id="treetable" flex="1">
   1.205 +    <treecols>
   1.206 +      <treecol id="tt_col1" flex="1" label="column" primary="true"/>
   1.207 +      <treecol id="tt_col2" flex="1" label="column 2"/>
   1.208 +    </treecols>
   1.209 +    <treechildren/>
   1.210 +  </tree>
   1.211 +
   1.212 +  </vbox> <!-- close tests area -->
   1.213 +  </hbox> <!-- close main area -->
   1.214 +</window>
   1.215 +

mercurial