Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/accessibility/aom-boolean-properties.html |
| diff --git a/third_party/WebKit/LayoutTests/accessibility/aom-boolean-properties.html b/third_party/WebKit/LayoutTests/accessibility/aom-boolean-properties.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..917b81ede28ea3d731840cf0815de8cb2299354a |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/accessibility/aom-boolean-properties.html |
| @@ -0,0 +1,161 @@ |
| +<!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="region" id="atomic" aria-atomic="true"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("atomic"); |
| + var axNode = accessibilityController.accessibleElementById("atomic"); |
| + assert_equals(axNode.isAtomic, true); |
| + node.accessibleNode.atomic = false; |
| + assert_equals(axNode.isAtomic, false); |
| + 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
|
| + assert_equals(axNode.isAtomic, false); |
| + assert_equals(node.accessibleNode.atomic, false); |
| +}, "Boolean AOM properties reflect ARIA, and can't be cleared."); |
| + |
| +test(function(t) { |
| + var node = document.getElementById("atomic"); |
| + var axNode = accessibilityController.accessibleElementById("atomic"); |
| + assert_equals(axNode.isAtomic, false); |
| + node.accessibleNode.atomic = true; |
| + assert_equals(axNode.isAtomic, true); |
| +}, "AccessibleNode.atomic"); |
| +</script> |
| + |
| +<div role="status" id="busy"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("busy"); |
| + var axNode = accessibilityController.accessibleElementById("busy"); |
| + assert_equals(axNode.isBusy, false); |
| + node.accessibleNode.busy = true; |
| + assert_equals(axNode.isBusy, true); |
| +}, "AccessibleNode.busy"); |
| +</script> |
| + |
| +<div role="checkbox" id="disabled"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("disabled"); |
| + var axNode = accessibilityController.accessibleElementById("disabled"); |
| + assert_equals(axNode.isEnabled, true); |
| + node.accessibleNode.disabled = true; |
| + assert_equals(axNode.isEnabled, false); |
| +}, "AccessibleNode.disabled"); |
| +</script> |
| + |
| +<div role="button" id="expanded"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("expanded"); |
| + var axNode = accessibilityController.accessibleElementById("expanded"); |
| + assert_equals(axNode.isExpanded, false); |
| + node.accessibleNode.expanded = true; |
| + assert_equals(axNode.isExpanded, true); |
| +}, "AccessibleNode.expanded"); |
| +</script> |
| + |
| +<div role="region" id="hidden"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("hidden"); |
| + var axNode = accessibilityController.accessibleElementById("hidden"); |
| + assert_true(axNode != null); |
| + node.accessibleNode.hidden = true; |
| + axNode = accessibilityController.accessibleElementById("hidden"); |
| + assert_true(axNode == null); |
| +}, "AccessibleNode.hidden"); |
| +</script> |
| + |
| +<div role="dialog" id="modal"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("modal"); |
| + var axNode = accessibilityController.accessibleElementById("modal"); |
| + assert_equals(axNode.isModal, false); |
| + node.accessibleNode.modal = true; |
| + assert_equals(axNode.isModal, true); |
| +}, "AccessibleNode.modal"); |
| +</script> |
| + |
| +<div role="textbox" id="multiline"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("multiline"); |
| + var axNode = accessibilityController.accessibleElementById("multiline"); |
| + assert_equals(axNode.isMultiLine, false); |
| + node.accessibleNode.multiline = true; |
| + assert_equals(axNode.isMultiLine, true); |
| +}, "AccessibleNode.multiline"); |
| +</script> |
| + |
| +<div role="listbox" id="multiselectable"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("multiselectable"); |
| + var axNode = accessibilityController.accessibleElementById("multiselectable"); |
| + assert_equals(axNode.isMultiSelectable, false); |
| + node.accessibleNode.multiselectable = true; |
| + assert_equals(axNode.isMultiSelectable, true); |
| +}, "AccessibleNode.multiselectable"); |
| +</script> |
| + |
| +<div role="textbox" id="readOnly"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("readOnly"); |
| + var axNode = accessibilityController.accessibleElementById("readOnly"); |
| + assert_equals(axNode.isAttributeSettable("AXValue"), true); |
| + node.accessibleNode.readOnly = true; |
| + assert_equals(axNode.isAttributeSettable("AXValue"), false); |
| +}, "AccessibleNode.readOnly"); |
| +</script> |
| + |
| +<div role="textbox" id="required"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("required"); |
| + var axNode = accessibilityController.accessibleElementById("required"); |
| + assert_equals(axNode.isRequired, false); |
| + node.accessibleNode.required = true; |
| + assert_equals(axNode.isRequired, true); |
| +}, "AccessibleNode.required"); |
| +</script> |
| + |
| +<div role="option" id="selected"></div> |
| + |
| +<script> |
| +test(function(t) { |
| + var node = document.getElementById("selected"); |
| + var axNode = accessibilityController.accessibleElementById("selected"); |
| + assert_equals(axNode.isSelected, false); |
| + node.accessibleNode.selected = true; |
| + assert_equals(axNode.isSelected, true); |
| +}, "AccessibleNode.selected"); |
| +</script> |