OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> |
| 4 |
| 5 <div id="treeitem1" role="treeitem" tabindex="-1">X</div> |
| 6 <div id="option1" role="option" tabindex="-1">X</div> |
| 7 <div id="tab1" role="tab" tabindex="-1">X</div> |
| 8 <div id="gridcell1" role="gridcell" tabindex="-1">X</div> |
| 9 <div id="checkbox1" role="checkbox" tabindex="-1"">X</div> |
| 10 |
| 11 <div id="treeitem2" role="treeitem" tabindex="-1" aria-selected="true">X</div> |
| 12 <div id="option2" role="option" tabindex="-1" aria-selected="true">X</div> |
| 13 <div id="tab2" role="tab" tabindex="-1" aria-selected="true">X</div> |
| 14 <div id="gridcell2" role="gridcell" tabindex="-1" aria-selected="true">X</div> |
| 15 <div id="checkbox2" role="checkbox" tabindex="-1" aria-selected="true">X</div> |
| 16 |
| 17 <div id="treeitem3" role="treeitem" tabindex="-1" aria-selected="true" aria-disa
bled="true">X</div> |
| 18 <div id="option3" role="option" tabindex="-1" aria-selected="true" aria-disabled
="true">X</div> |
| 19 <div id="tab3" role="tab" tabindex="-1" aria-selected="true" aria-disabled="true
">X</div> |
| 20 <div id="gridcell3" role="gridcell" tabindex="-1" aria-selected="true" aria-disa
bled="true">X</div> |
| 21 |
| 22 <script> |
| 23 var listbox = document.getElementById("listbox"); |
| 24 |
| 25 function axElementById(id) { |
| 26 return accessibilityController.accessibleElementById(id); |
| 27 } |
| 28 |
| 29 test(function(t) { |
| 30 var ax = axElementById("treeitem1"); |
| 31 assert_equals(ax.isEnabled, true); |
| 32 }, "Tree item enabled"); |
| 33 |
| 34 test(function(t) { |
| 35 var ax = axElementById("option1"); |
| 36 assert_equals(ax.isEnabled, true); |
| 37 }, "Option enabled"); |
| 38 |
| 39 test(function(t) { |
| 40 var ax = axElementById("tab1"); |
| 41 assert_equals(ax.isEnabled, true); |
| 42 }, "Tab enabled"); |
| 43 |
| 44 test(function(t) { |
| 45 var ax = axElementById("gridcell1"); |
| 46 assert_equals(ax.isEnabled, true); |
| 47 }, "Grid cell enabled"); |
| 48 |
| 49 test(function(t) { |
| 50 var ax = axElementById("checkbox1"); |
| 51 assert_equals(ax.isEnabled, true); |
| 52 }, "Check boxs enabled"); |
| 53 |
| 54 test(function(t) { |
| 55 var ax = axElementById("treeitem1"); |
| 56 assert_equals(ax.isSelectable, true); |
| 57 }, "Tree item selectable"); |
| 58 |
| 59 test(function(t) { |
| 60 var ax = axElementById("option1"); |
| 61 assert_equals(ax.isSelectable, true); |
| 62 }, "Option selectable"); |
| 63 |
| 64 test(function(t) { |
| 65 var ax = axElementById("tab1"); |
| 66 assert_equals(ax.isSelectable, true); |
| 67 }, "Tab selectable"); |
| 68 |
| 69 test(function(t) { |
| 70 var ax = axElementById("gridcell1"); |
| 71 assert_equals(ax.isSelectable, true); |
| 72 }, "Grid cell selectable"); |
| 73 |
| 74 test(function(t) { |
| 75 var ax = axElementById("checkbox1"); |
| 76 assert_equals(ax.isSelectable, false); |
| 77 }, "Check box not selectable because it is not a selectable role"); |
| 78 |
| 79 test(function(t) { |
| 80 var ax = axElementById("treeitem2"); |
| 81 assert_equals(ax.isSelected, true); |
| 82 }, "Tree item selected"); |
| 83 |
| 84 test(function(t) { |
| 85 var ax = axElementById("option2"); |
| 86 assert_equals(ax.isSelected, true); |
| 87 }, "Option selected"); |
| 88 |
| 89 test(function(t) { |
| 90 var ax = axElementById("tab2"); |
| 91 assert_equals(ax.isSelected, true); |
| 92 }, "Tab selected"); |
| 93 |
| 94 test(function(t) { |
| 95 var ax = axElementById("gridcell2"); |
| 96 assert_equals(ax.isSelected, true); |
| 97 }, "Grid cell selected"); |
| 98 |
| 99 test(function(t) { |
| 100 var ax = axElementById("checkbox2"); |
| 101 assert_equals(ax.isSelected, false); |
| 102 }, "Check box not selected because it is not a selectable role"); |
| 103 |
| 104 test(function(t) { |
| 105 var ax = axElementById("treeitem3"); |
| 106 assert_equals(ax.isSelectable, false); |
| 107 }, "Tree item not selectable if disabled"); |
| 108 |
| 109 test(function(t) { |
| 110 var ax = axElementById("option3"); |
| 111 assert_equals(ax.isSelectable, false); |
| 112 }, "Option not selectable if disabled"); |
| 113 |
| 114 test(function(t) { |
| 115 var ax = axElementById("tab3"); |
| 116 assert_equals(ax.isSelectable, false); |
| 117 }, "Tab not selectable if disabled"); |
| 118 |
| 119 test(function(t) { |
| 120 var ax = axElementById("gridcell3"); |
| 121 assert_equals(ax.isSelectable, false); |
| 122 }, "Grid cell not selectable if disabled"); |
| 123 |
| 124 test(function(t) { |
| 125 var ax = axElementById("treeitem3"); |
| 126 assert_equals(ax.isSelected, false); |
| 127 }, "Tree item not selected if disabled"); |
| 128 |
| 129 test(function(t) { |
| 130 var ax = axElementById("option3"); |
| 131 assert_equals(ax.isSelected, false); |
| 132 }, "Option not selected if disabled"); |
| 133 |
| 134 test(function(t) { |
| 135 var ax = axElementById("tab3"); |
| 136 assert_equals(ax.isSelected, false); |
| 137 }, "Tab not selected if disabled"); |
| 138 |
| 139 test(function(t) { |
| 140 var ax = axElementById("gridcell3"); |
| 141 assert_equals(ax.isSelected, false); |
| 142 }, "Grid cell not selected if disabled"); |
| 143 |
| 144 |
| 145 |
| 146 </script> |
OLD | NEW |