accessible/tests/mochitest/name/test_tree.xul

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:55cff484944b
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"?>
7
8
9 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
10 title="Accessibility Name Calculating Test.">
11
12 <script type="application/javascript"
13 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
14
15 <script type="application/javascript"
16 src="../treeview.js" />
17
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>
26
27 <script type="application/javascript">
28 <![CDATA[
29 function treeTester(aID)
30 {
31 this.DOMNode = getNode(aID);
32
33 this.invoke = function treeTester_invoke()
34 {
35 this.DOMNode.treeBoxObject.view = new nsTreeTreeView();
36 }
37
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 }
80
81 this.getID = function treeTester_getID()
82 {
83 return "Tree name testing for " + aID;
84 }
85 }
86
87 function tableTester(aID, aIsTable, aCol1ID, aCol2ID)
88 {
89 this.DOMNode = getNode(aID);
90
91 this.invoke = function tableTester_invoke()
92 {
93 this.DOMNode.treeBoxObject.view = new nsTableTreeView(2);
94 }
95
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 }
140
141 this.getID = function tableTester_getID()
142 {
143 return "Tree name testing for " + aID;
144 }
145 }
146
147 var gQueue = null;
148 function doTest()
149 {
150 var gQueue = new eventQueue(EVENT_REORDER);
151
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"));
155
156 gQueue.invoke(); // Will call SimpleTest.finish()
157 }
158
159 SimpleTest.waitForExplicitFinish();
160 addA11yLoadEvent(doTest);
161 ]]>
162 </script>
163
164 <hbox flex="1" style="overflow: auto;">
165
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>
183
184 <vbox flex="1">
185
186 <tree id="tree" flex="1">
187 <treecols>
188 <treecol id="col" flex="1" primary="true" label="column"/>
189 </treecols>
190 <treechildren/>
191 </tree>
192
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>
200
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>
208
209 </vbox> <!-- close tests area -->
210 </hbox> <!-- close main area -->
211 </window>
212

mercurial