Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/accessibility/aom-string-properties.html |
| diff --git a/third_party/WebKit/LayoutTests/accessibility/aom-string-properties.html b/third_party/WebKit/LayoutTests/accessibility/aom-string-properties.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6fbad555a683a127d4e77f978c93e8af1783bc7b |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/accessibility/aom-string-properties.html |
| @@ -0,0 +1,188 @@ |
| +<!DOCTYPE HTML> |
| +<script src="../resources/gc.js"></script> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| + |
| +<!-- |
| + |
| +Accessibility Object Model |
| +Explainer: https://github.com/WICG/aom/blob/master/explainer.md |
| +Spec: https://wicg.github.io/aom/spec/ |
| + |
| +--> |
| + |
| +<script> |
| +if (window.internals) |
| + internals.runtimeFlags.accessibilityObjectModelEnabled = true; |
| +</script> |
| + |
| +<div role="combobox" id="autocomplete"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("autocomplete"); |
| + var axNode = accessibilityController.accessibleElementById("autocomplete"); |
| + assert_equals(axNode.autocomplete, ""); |
|
aboxhall
2017/03/31 00:23:38
Is this equivalent to "none"? Per https://www.w3.o
dmazzoni
2017/03/31 04:34:57
Yes, if we had an enum this would be the same as "
|
| + node.accessibleNode.autocomplete = "inline"; |
| + assert_equals(axNode.autocomplete, "inline"); |
| +}, "AccessibleNode.autocomplete"); |
| +</script> |
| + |
| +<div role="checkbox" id="checked"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("checked"); |
| + var axNode = accessibilityController.accessibleElementById("checked"); |
| + assert_equals(axNode.isChecked, false); |
| + node.accessibleNode.checked = "true"; |
|
aboxhall
2017/03/31 00:23:38
Do we want to enable using boolean true/false as a
dmazzoni
2017/03/31 04:34:58
Hmmm, not sure I like that since this is actually
aboxhall
2017/03/31 04:41:54
Yeah, I realise it's a tristate, but "mixed" is so
|
| + assert_equals(axNode.isChecked, true); |
| + node.accessibleNode.checked = "mixed"; |
| + assert_equals(axNode.isChecked, false); |
| + assert_equals(axNode.isButtonStateMixed, true); |
| +}, "AccessibleNode.checked"); |
| +</script> |
| + |
| +<div role="tab" id="current"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("current"); |
| + var axNode = accessibilityController.accessibleElementById("current"); |
| + assert_equals(axNode.current, ""); |
| + node.accessibleNode.current = "page"; |
| + assert_equals(axNode.current, "page"); |
| +}, "AccessibleNode.current"); |
| +</script> |
| + |
| +<div role="textbox" id="invalid"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("invalid"); |
| + var axNode = accessibilityController.accessibleElementById("invalid"); |
| + assert_equals(axNode.invalid, ""); |
| + node.accessibleNode.invalid = "spelling"; |
| + assert_equals(axNode.invalid, "spelling"); |
| +}, "AccessibleNode.invalid"); |
| +</script> |
| + |
| +<div role="button" id="keyShortcuts"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("keyShortcuts"); |
| + var axNode = accessibilityController.accessibleElementById("keyShortcuts"); |
| + assert_equals(axNode.keyShortcuts, ""); |
| + node.accessibleNode.keyShortcuts = "Ctrl+F"; |
| + assert_equals(axNode.keyShortcuts, "Ctrl+F"); |
| +}, "AccessibleNode.keyShortcuts"); |
| +</script> |
| + |
| +<div role="heading" id="label">Inner text</div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("label"); |
| + var axNode = accessibilityController.accessibleElementById("label"); |
| + assert_equals(axNode.name, "Inner text"); |
| + node.accessibleNode.label = "Label"; |
| + assert_equals(axNode.name, "Label"); |
| +}, "AccessibleNode.label"); |
| +</script> |
| + |
| +<div role="banner" id="live"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("live"); |
| + var axNode = accessibilityController.accessibleElementById("live"); |
| + assert_equals(axNode.live, ""); |
| + node.accessibleNode.live = "polite"; |
| + assert_equals(axNode.live, "polite"); |
| +}, "AccessibleNode.live"); |
| +</script> |
| + |
| +<div role="slider" id="orientation"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("orientation"); |
| + var axNode = accessibilityController.accessibleElementById("orientation"); |
| + assert_equals(axNode.orientation, "AXOrientation: AXHorizontalOrientation"); |
| + node.accessibleNode.orientation = "vertical"; |
| + assert_equals(axNode.orientation, "AXOrientation: AXVerticalOrientation"); |
| +}, "AccessibleNode.orientation"); |
| +</script> |
| + |
| +<input id="placeholder"> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("placeholder"); |
| + var axNode = accessibilityController.accessibleElementById("placeholder"); |
| + assert_equals(axNode.name, ""); |
| + node.accessibleNode.placeholder = "Placeholder"; |
| + assert_equals(axNode.name, "Placeholder"); |
|
aboxhall
2017/03/31 00:23:39
Why not check axNode.placeholder directly here (as
dmazzoni
2017/03/31 04:34:57
We actually don't return anything from "placeholde
aboxhall
2017/04/03 23:20:24
Oh nice :)
|
| +}, "AccessibleNode.placeholder"); |
| +</script> |
| + |
| +<div role="banner" id="relevant"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("relevant"); |
| + var axNode = accessibilityController.accessibleElementById("relevant"); |
| + assert_equals(axNode.relevant, "additions text"); |
| + node.accessibleNode.relevant = "additions"; |
| + assert_equals(axNode.relevant, "additions"); |
| +}, "AccessibleNode.relevant"); |
| +</script> |
| + |
| +<div role="button" id="role"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("role"); |
| + var axNode = accessibilityController.accessibleElementById("role"); |
| + assert_equals(axNode.role, "AXRole: AXButton"); |
| + node.accessibleNode.role = "combobox"; |
|
aboxhall
2017/03/31 00:23:38
Test role fallback as well, i.e. node.accessibleNo
dmazzoni
2017/03/31 04:34:57
Done.
|
| + assert_equals(axNode.role, "AXRole: AXComboBox"); |
| +}, "AccessibleNode.role"); |
| +</script> |
| + |
| +<div role="button" id="roleDescription"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("roleDescription"); |
| + var axNode = accessibilityController.accessibleElementById("roleDescription"); |
| + assert_equals(axNode.roleDescription, ""); |
| + node.accessibleNode.roleDescription = "Push Button"; |
| + assert_equals(axNode.roleDescription, "Push Button"); |
| +}, "AccessibleNode.roleDescription"); |
| +</script> |
| + |
| +<div role="columnheader" id="sort"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("sort"); |
| + var axNode = accessibilityController.accessibleElementById("sort"); |
| + assert_equals(axNode.sort, ""); |
|
aboxhall
2017/03/31 00:23:39
Similarly, should this be explicitly "none"? Maybe
dmazzoni
2017/03/31 04:34:57
Yeah, this is just supposed to match what we retur
|
| + node.accessibleNode.sort = "ascending"; |
| + assert_equals(axNode.sort, "ascending"); |
| +}, "AccessibleNode.sort"); |
| +</script> |
| + |
| +<div role="slider" id="valueText" aria-valuetext="5"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("valueText"); |
| + var axNode = accessibilityController.accessibleElementById("valueText"); |
| + assert_equals(axNode.valueDescription, "AXValueDescription: 5"); |
| + node.accessibleNode.valueText = "Five"; |
| + assert_equals(axNode.valueDescription, "AXValueDescription: Five"); |
| +}, "AccessibleNode.valueText"); |
| +</script> |