Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE HTML> | |
| 2 <script src="../resources/gc.js"></script> | |
| 3 <script src="../resources/testharness.js"></script> | |
| 4 <script src="../resources/testharnessreport.js"></script> | |
| 5 | |
| 6 <!-- | |
| 7 | |
| 8 Accessibility Object Model | |
| 9 Explainer: https://github.com/WICG/aom/blob/master/explainer.md | |
| 10 Spec: https://wicg.github.io/aom/spec/ | |
| 11 | |
| 12 --> | |
| 13 | |
| 14 <script> | |
| 15 if (window.internals) | |
| 16 internals.runtimeFlags.accessibilityObjectModelEnabled = true; | |
| 17 </script> | |
| 18 | |
| 19 <div role="region" id="atomic" aria-atomic="true"></div> | |
| 20 | |
| 21 <script> | |
| 22 test(function(t) { | |
| 23 var node = document.getElementById("atomic"); | |
| 24 var axNode = accessibilityController.accessibleElementById("atomic"); | |
| 25 assert_equals(axNode.isAtomic, true); | |
| 26 node.accessibleNode.atomic = false; | |
| 27 assert_equals(axNode.isAtomic, false); | |
| 28 node.accessibleNode.atomic = null; | |
|
dmazzoni
2017/04/21 07:11:37
@aboxhall, what should happen here?
The spec says
dmazzoni
2017/05/08 05:31:14
Resolved now, with new tests, based on the latest
| |
| 29 assert_equals(axNode.isAtomic, false); | |
| 30 assert_equals(node.accessibleNode.atomic, false); | |
| 31 }, "Boolean AOM properties reflect ARIA, and can't be cleared."); | |
| 32 | |
| 33 test(function(t) { | |
| 34 var node = document.getElementById("atomic"); | |
| 35 var axNode = accessibilityController.accessibleElementById("atomic"); | |
| 36 assert_equals(axNode.isAtomic, false); | |
| 37 node.accessibleNode.atomic = true; | |
| 38 assert_equals(axNode.isAtomic, true); | |
| 39 }, "AccessibleNode.atomic"); | |
| 40 </script> | |
| 41 | |
| 42 <div role="status" id="busy"></div> | |
| 43 | |
| 44 <script> | |
| 45 test(function(t) { | |
| 46 var node = document.getElementById("busy"); | |
| 47 var axNode = accessibilityController.accessibleElementById("busy"); | |
| 48 assert_equals(axNode.isBusy, false); | |
| 49 node.accessibleNode.busy = true; | |
| 50 assert_equals(axNode.isBusy, true); | |
| 51 }, "AccessibleNode.busy"); | |
| 52 </script> | |
| 53 | |
| 54 <div role="checkbox" id="disabled"></div> | |
| 55 | |
| 56 <script> | |
| 57 test(function(t) { | |
| 58 var node = document.getElementById("disabled"); | |
| 59 var axNode = accessibilityController.accessibleElementById("disabled"); | |
| 60 assert_equals(axNode.isEnabled, true); | |
| 61 node.accessibleNode.disabled = true; | |
| 62 assert_equals(axNode.isEnabled, false); | |
| 63 }, "AccessibleNode.disabled"); | |
| 64 </script> | |
| 65 | |
| 66 <div role="button" id="expanded"></div> | |
| 67 | |
| 68 <script> | |
| 69 test(function(t) { | |
| 70 var node = document.getElementById("expanded"); | |
| 71 var axNode = accessibilityController.accessibleElementById("expanded"); | |
| 72 assert_equals(axNode.isExpanded, false); | |
| 73 node.accessibleNode.expanded = true; | |
| 74 assert_equals(axNode.isExpanded, true); | |
| 75 }, "AccessibleNode.expanded"); | |
| 76 </script> | |
| 77 | |
| 78 <div role="region" id="hidden"></div> | |
| 79 | |
| 80 <script> | |
| 81 test(function(t) { | |
| 82 var node = document.getElementById("hidden"); | |
| 83 var axNode = accessibilityController.accessibleElementById("hidden"); | |
| 84 assert_true(axNode != null); | |
| 85 node.accessibleNode.hidden = true; | |
| 86 axNode = accessibilityController.accessibleElementById("hidden"); | |
| 87 assert_true(axNode == null); | |
| 88 }, "AccessibleNode.hidden"); | |
| 89 </script> | |
| 90 | |
| 91 <div role="dialog" id="modal"></div> | |
| 92 | |
| 93 <script> | |
| 94 test(function(t) { | |
| 95 var node = document.getElementById("modal"); | |
| 96 var axNode = accessibilityController.accessibleElementById("modal"); | |
| 97 assert_equals(axNode.isModal, false); | |
| 98 node.accessibleNode.modal = true; | |
| 99 assert_equals(axNode.isModal, true); | |
| 100 }, "AccessibleNode.modal"); | |
| 101 </script> | |
| 102 | |
| 103 <div role="textbox" id="multiline"></div> | |
| 104 | |
| 105 <script> | |
| 106 test(function(t) { | |
| 107 var node = document.getElementById("multiline"); | |
| 108 var axNode = accessibilityController.accessibleElementById("multiline"); | |
| 109 assert_equals(axNode.isMultiLine, false); | |
| 110 node.accessibleNode.multiline = true; | |
| 111 assert_equals(axNode.isMultiLine, true); | |
| 112 }, "AccessibleNode.multiline"); | |
| 113 </script> | |
| 114 | |
| 115 <div role="listbox" id="multiselectable"></div> | |
| 116 | |
| 117 <script> | |
| 118 test(function(t) { | |
| 119 var node = document.getElementById("multiselectable"); | |
| 120 var axNode = accessibilityController.accessibleElementById("multiselectable" ); | |
| 121 assert_equals(axNode.isMultiSelectable, false); | |
| 122 node.accessibleNode.multiselectable = true; | |
| 123 assert_equals(axNode.isMultiSelectable, true); | |
| 124 }, "AccessibleNode.multiselectable"); | |
| 125 </script> | |
| 126 | |
| 127 <div role="textbox" id="readOnly"></div> | |
| 128 | |
| 129 <script> | |
| 130 test(function(t) { | |
| 131 var node = document.getElementById("readOnly"); | |
| 132 var axNode = accessibilityController.accessibleElementById("readOnly"); | |
| 133 assert_equals(axNode.isAttributeSettable("AXValue"), true); | |
| 134 node.accessibleNode.readOnly = true; | |
| 135 assert_equals(axNode.isAttributeSettable("AXValue"), false); | |
| 136 }, "AccessibleNode.readOnly"); | |
| 137 </script> | |
| 138 | |
| 139 <div role="textbox" id="required"></div> | |
| 140 | |
| 141 <script> | |
| 142 test(function(t) { | |
| 143 var node = document.getElementById("required"); | |
| 144 var axNode = accessibilityController.accessibleElementById("required"); | |
| 145 assert_equals(axNode.isRequired, false); | |
| 146 node.accessibleNode.required = true; | |
| 147 assert_equals(axNode.isRequired, true); | |
| 148 }, "AccessibleNode.required"); | |
| 149 </script> | |
| 150 | |
| 151 <div role="option" id="selected"></div> | |
| 152 | |
| 153 <script> | |
| 154 test(function(t) { | |
| 155 var node = document.getElementById("selected"); | |
| 156 var axNode = accessibilityController.accessibleElementById("selected"); | |
| 157 assert_equals(axNode.isSelected, false); | |
| 158 node.accessibleNode.selected = true; | |
| 159 assert_equals(axNode.isSelected, true); | |
| 160 }, "AccessibleNode.selected"); | |
| 161 </script> | |
| OLD | NEW |