accessible/tests/mochitest/selectable/test_aria.html

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.

michael@0 1 <html>
michael@0 2
michael@0 3 <head>
michael@0 4 <title>nsIAccessibleSelectable ARIA widgets testing</title>
michael@0 5
michael@0 6 <link rel="stylesheet" type="text/css"
michael@0 7 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
michael@0 8
michael@0 9 </style>
michael@0 10
michael@0 11 <script type="application/javascript"
michael@0 12 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
michael@0 13
michael@0 14 <script type="application/javascript"
michael@0 15 src="../common.js"></script>
michael@0 16 <script type="application/javascript"
michael@0 17 src="../role.js"></script>
michael@0 18 <script type="application/javascript"
michael@0 19 src="../states.js"></script>
michael@0 20 <script type="application/javascript"
michael@0 21 src="../selectable.js"></script>
michael@0 22
michael@0 23 <script type="application/javascript">
michael@0 24 function testSelectable(aID, aSelectableChildren)
michael@0 25 {
michael@0 26 var acc = getAccessible(aID, [nsIAccessibleSelectable]);
michael@0 27
michael@0 28 testSelectableSelection(acc, []);
michael@0 29
michael@0 30 acc.selectAll();
michael@0 31 testSelectableSelection(acc, aSelectableChildren);
michael@0 32
michael@0 33 acc.unselectAll();
michael@0 34 testSelectableSelection(acc, []);
michael@0 35 }
michael@0 36
michael@0 37 function doTest()
michael@0 38 {
michael@0 39 //////////////////////////////////////////////////////////////////////////
michael@0 40 // role="tablist"
michael@0 41
michael@0 42 id = "tablist";
michael@0 43 ok(isAccessible(id, [nsIAccessibleSelectable]),
michael@0 44 "No selectable accessible for " + id);
michael@0 45
michael@0 46 testSelectableSelection(id, [ ]);
michael@0 47
michael@0 48 //////////////////////////////////////////////////////////////////////////
michael@0 49 // role="listbox"
michael@0 50
michael@0 51 id = "listbox1";
michael@0 52 ok(isAccessible(id, [nsIAccessibleSelectable]),
michael@0 53 "No selectable accessible for " + id);
michael@0 54
michael@0 55 testSelectableSelection(id, [ ]);
michael@0 56
michael@0 57 //////////////////////////////////////////////////////////////////////////
michael@0 58 // role="listbox" aria-multiselectable
michael@0 59
michael@0 60 id = "listbox2";
michael@0 61 ok(isAccessible(id, [nsIAccessibleSelectable]),
michael@0 62 "No selectable accessible for " + id);
michael@0 63
michael@0 64 testSelectableSelection(id, [ ]);
michael@0 65
michael@0 66 select = getAccessible(id, [nsIAccessibleSelectable]);
michael@0 67 select.addItemToSelection(0);
michael@0 68 testSelectableSelection(id, [ "listbox2_item1" ]);
michael@0 69 select.removeItemFromSelection(0);
michael@0 70 testSelectableSelection(id, [ ]);
michael@0 71 select.selectAll();
michael@0 72 testSelectableSelection(id, [ "listbox2_item1", "listbox2_item2" ]);
michael@0 73 select.unselectAll();
michael@0 74 testSelectableSelection(id, [ ]);
michael@0 75
michael@0 76 //////////////////////////////////////////////////////////////////////////
michael@0 77 // role="grid"
michael@0 78
michael@0 79 id = "grid1";
michael@0 80 ok(isAccessible(id, [nsIAccessibleSelectable]),
michael@0 81 "No selectable accessible for " + id);
michael@0 82
michael@0 83 testSelectableSelection(id, [ ]);
michael@0 84
michael@0 85 //////////////////////////////////////////////////////////////////////////
michael@0 86 // role="tree"
michael@0 87
michael@0 88 id = "tree1";
michael@0 89 ok(isAccessible(id, [nsIAccessibleSelectable]),
michael@0 90 "No selectable accessible for " + id);
michael@0 91
michael@0 92 testSelectableSelection(id, [ ]);
michael@0 93
michael@0 94 //////////////////////////////////////////////////////////////////////////
michael@0 95 // role="treegrid"
michael@0 96
michael@0 97 id = "treegrid1";
michael@0 98 ok(isAccessible(id, [nsIAccessibleSelectable]),
michael@0 99 "No selectable accessible for " + id);
michael@0 100
michael@0 101 testSelectableSelection(id, [ ]);
michael@0 102
michael@0 103 //////////////////////////////////////////////////////////////////////////
michael@0 104 // role="grid" aria-multiselectable, selectable children in subtree
michael@0 105
michael@0 106 id = "grid2";
michael@0 107 ok(isAccessible(id, [nsIAccessibleSelectable]),
michael@0 108 "No selectable accessible for " + id);
michael@0 109
michael@0 110 testSelectable(id,
michael@0 111 ["grid2_colhead1", "grid2_colhead2", "grid2_colhead3",
michael@0 112 "grid2_rowhead", "grid2_cell1", "grid2_cell2"]);
michael@0 113
michael@0 114 SimpleTest.finish();
michael@0 115 }
michael@0 116
michael@0 117 SimpleTest.waitForExplicitFinish();
michael@0 118 addA11yLoadEvent(doTest);
michael@0 119 </script>
michael@0 120
michael@0 121 </head>
michael@0 122
michael@0 123 <body>
michael@0 124
michael@0 125 <a target="_blank"
michael@0 126 href="https://bugzilla.mozilla.org/show_bug.cgi?id=530014"
michael@0 127 title="ARIA single selectable widget should implement nsIAccessibleSelectable">
michael@0 128 Mozilla Bug 530014
michael@0 129 </a>
michael@0 130 <a target="_blank"
michael@0 131 href="https://bugzilla.mozilla.org/show_bug.cgi?id=566551"
michael@0 132 title="ARIA grid and accessible selectable methods shouldn't use GetNextSibling">
michael@0 133 Mozilla Bug 566551
michael@0 134 </a>
michael@0 135 <a target="_blank"
michael@0 136 href="https://bugzilla.mozilla.org/show_bug.cgi?id=590176"
michael@0 137 title="add pseudo SelectAccessible interface">
michael@0 138 Mozilla Bug 590176
michael@0 139 </a>
michael@0 140 <a target="_blank"
michael@0 141 href="https://bugzilla.mozilla.org/show_bug.cgi?id=804040"
michael@0 142 title="Selection event not fired when selection of ARIA tab changes">
michael@0 143 Mozilla Bug 804040
michael@0 144 </a>
michael@0 145 <p id="display"></p>
michael@0 146 <div id="content" style="display: none"></div>
michael@0 147 <pre id="test">
michael@0 148 </pre>
michael@0 149
michael@0 150 <div role="tablist" id="tablist">
michael@0 151 <div role="tab">tab1</div>
michael@0 152 <div role="tab">tab2</div>
michael@0 153 </div>
michael@0 154
michael@0 155 <div role="listbox" id="listbox1">
michael@0 156 <div role="option">item1</div>
michael@0 157 <div role="option">item2</div>
michael@0 158 </div>
michael@0 159
michael@0 160 <div role="listbox" id="listbox2" aria-multiselectable="true">
michael@0 161 <div role="option" id="listbox2_item1">item1</div>
michael@0 162 <div role="option" id="listbox2_item2">item2</div>
michael@0 163 </div>
michael@0 164
michael@0 165 <div role="grid" id="grid1">
michael@0 166 <div role="row">
michael@0 167 <span role="gridcell">cell</span>
michael@0 168 <span role="gridcell">cell</span>
michael@0 169 </div>
michael@0 170 <div role="row">
michael@0 171 <span role="gridcell">cell</span>
michael@0 172 <span role="gridcell">cell</span>
michael@0 173 </div>
michael@0 174 </div>
michael@0 175
michael@0 176 <div role="tree" id="tree1">
michael@0 177 <div role="treeitem">
michael@0 178 item1
michael@0 179 <div role="group">
michael@0 180 <div role="treeitem">item1.1</div>
michael@0 181 </div>
michael@0 182 </div>
michael@0 183 <div>item2</div>
michael@0 184 </div>
michael@0 185
michael@0 186 <div role="treegrid" id="treegrid1">
michael@0 187 <div role="row" aria-level="1">
michael@0 188 <span role="gridcell">cell</span>
michael@0 189 <span role="gridcell">cell</span>
michael@0 190 </div>
michael@0 191 <div role="row" aria-level="2">
michael@0 192 <span role="gridcell">cell</span>
michael@0 193 <span role="gridcell">cell</span>
michael@0 194 </div>
michael@0 195 <div role="row" aria-level="1">
michael@0 196 <span role="gridcell">cell</span>
michael@0 197 <span role="gridcell">cell</span>
michael@0 198 </div>
michael@0 199 </div>
michael@0 200
michael@0 201 <table tabindex="0" border="2" cellspacing="0" id="grid2" role="grid"
michael@0 202 aria-multiselectable="true">
michael@0 203 <thead>
michael@0 204 <tr>
michael@0 205 <th tabindex="-1" role="columnheader" id="grid2_colhead1"
michael@0 206 style="width:6em">Entry #</th>
michael@0 207 <th tabindex="-1" role="columnheader" id="grid2_colhead2"
michael@0 208 style="width:10em">Date</th>
michael@0 209 <th tabindex="-1" role="columnheader" id="grid2_colhead3"
michael@0 210 style="width:20em">Expense</th>
michael@0 211 </tr>
michael@0 212 </thead>
michael@0 213 <tbody>
michael@0 214 <tr>
michael@0 215 <td tabindex="-1" role="rowheader" id="grid2_rowhead"
michael@0 216 aria-readonly="true">1</td>
michael@0 217 <td tabindex="-1" role="gridcell" id="grid2_cell1"
michael@0 218 aria-selected="false">03/14/05</td>
michael@0 219 <td tabindex="-1" role="gridcell" id="grid2_cell2"
michael@0 220 aria-selected="false">Conference Fee</td>
michael@0 221 </tr>
michael@0 222 </tobdy>
michael@0 223 </table>
michael@0 224 </body>
michael@0 225 </html>

mercurial