| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
| <html> | |
| <head> | |
| <script src="../resources/js-test.js"></script> | |
| <script src="../resources/accessibility-helper.js"></script> | |
| </head> | |
| <body> | |
| <button id="untitledButton"></button> | |
| <div id="spinbutton" | |
| tabindex="0" | |
| role="spinbutton" | |
| aria-valuetext="5 of 9" | |
| aria-valuemin="1" | |
| aria-valuemax="9" | |
| aria-valuenow="5">42</div> | |
| <script> | |
| description("This tests that a spin button supports range value attributes."); | |
| function endsWith(str, suffix) { | |
| str = "" + str; | |
| return str.substr(str.length - suffix.length) == suffix; | |
| } | |
| var spinbutton, untitledButton; | |
| if (window.accessibilityController) { | |
| untitledButton = accessibilityController.accessibleElementById("untitledButton"); | |
| spinbutton = accessibilityController.accessibleElementById("spinbutton"); | |
| shouldBe("spinbutton.intValue", "5"); | |
| // Test range value attributes. | |
| shouldBe("endsWith(spinbutton.intValue, '5')", "true"); | |
| shouldBe("endsWith(spinbutton.minValue, '1')", "true"); | |
| shouldBe("endsWith(spinbutton.maxValue, '9')", "true"); | |
| shouldBe("endsWith(spinbutton.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("spinbutton.title", "untitledButton.title"); | |
| } | |
| </script> | |
| </body> | |
| </html> | |