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

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

mercurial