| 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..816f1a3603b4c6e316b0f5316c169dc58e7d640f
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/accessibility/aom-string-properties.html
|
| @@ -0,0 +1,198 @@
|
| +<!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, "");
|
| + 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";
|
| + assert_equals(axNode.isChecked, true);
|
| + node.accessibleNode.checked = "mixed";
|
| + assert_equals(axNode.isChecked, false);
|
| + assert_equals(axNode.isButtonStateMixed, true);
|
| +
|
| + // It also works to set it to just true or false (no quotes).
|
| + node.accessibleNode.checked = true;
|
| + assert_equals(axNode.isChecked, true);
|
| + node.accessibleNode.checked = false;
|
| + assert_equals(axNode.isChecked, false);
|
| +
|
| +}, "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");
|
| + assert_equals(axNode.nameFrom, "placeholder");
|
| +}, "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";
|
| + assert_equals(axNode.role, "AXRole: AXComboBox");
|
| + node.accessibleNode.role = "banana button";
|
| + assert_equals(axNode.role, "AXRole: AXButton");
|
| +}, "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, "");
|
| + 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>
|
|
|