| <script src="../resources/js-test.js"></script> |
| <button id="untitled"></button> |
| aria-valuenow="5">42</div> |
| description("This tests that a spin button supports range value attributes.") |
| if (window.testRunner && window.accessibilityController) { |
| function endsWith(str, suffix) { |
| return str.substr(str.length - suffix.length) == suffix; |
| var untitled = document.getElementById('untitled'); |
| window.axUntitled = accessibilityController.focusedElement; |
| var spin = document.getElementById('spin'); |
| window.axSpin = accessibilityController.focusedElement; |
| // Test range value attributes. |
| shouldBe("endsWith(axSpin.intValue, '5')", "true"); |
| shouldBe("endsWith(axSpin.minValue, '1')", "true"); |
| shouldBe("endsWith(axSpin.maxValue, '9')", "true"); |
| shouldBe("endsWith(axSpin.valueDescription, '5 of 9')", "true"); |
| // Make sure the title doesn't come from the inner text. It should just be empty if |
| // not otherwise specified. |
| shouldBe("axSpin.title", "axUntitled.title"); |