dmazzoni@google.com | 85f3079 | 2012-09-07 17:07:25 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML> |
| 2 | <html> |
| 3 | <body> |
mark.lam@apple.com | a931ab2 | 2013-09-08 01:18:24 +0000 | [diff] [blame] | 4 | <script src="../resources/js-test-pre.js"></script> |
dmazzoni@google.com | 85f3079 | 2012-09-07 17:07:25 +0000 | [diff] [blame] | 5 | |
| 6 | <button id="untitled"></button> |
| 7 | |
| 8 | <div id="spin" |
| 9 | tabindex="0" |
| 10 | role="spinbutton" |
| 11 | aria-valuetext="5 of 9" |
| 12 | aria-valuemin="1" |
| 13 | aria-valuemax="9" |
| 14 | aria-valuenow="5">42</div> |
| 15 | |
| 16 | <div id="console"></div> |
| 17 | <script> |
| 18 | description("This tests that a spin button supports range value attributes.") |
| 19 | |
| 20 | if (window.testRunner && window.accessibilityController) { |
| 21 | window.testRunner.dumpAsText(); |
| 22 | |
| 23 | function endsWith(str, suffix) { |
| 24 | str = '' + str; |
| 25 | return str.substr(str.length - suffix.length) == suffix; |
| 26 | } |
| 27 | |
| 28 | var untitled = document.getElementById('untitled'); |
| 29 | untitled.focus(); |
| 30 | window.axUntitled = accessibilityController.focusedElement; |
| 31 | |
| 32 | var spin = document.getElementById('spin'); |
| 33 | spin.focus(); |
| 34 | window.axSpin = accessibilityController.focusedElement; |
| 35 | |
| 36 | // Test range value attributes. |
| 37 | shouldBe("endsWith(axSpin.intValue, '5')", "true"); |
| 38 | shouldBe("endsWith(axSpin.minValue, '1')", "true"); |
| 39 | shouldBe("endsWith(axSpin.maxValue, '9')", "true"); |
| 40 | shouldBe("endsWith(axSpin.valueDescription, '5 of 9')", "true"); |
| 41 | |
| 42 | // Make sure the title doesn't come from the inner text. It should just be empty if |
| 43 | // not otherwise specified. |
| 44 | shouldBe("axSpin.title", "axUntitled.title"); |
| 45 | } |
| 46 | |
| 47 | </script> |
| 48 | |
mark.lam@apple.com | a931ab2 | 2013-09-08 01:18:24 +0000 | [diff] [blame] | 49 | <script src="../resources/js-test-post.js"></script> |
dmazzoni@google.com | 85f3079 | 2012-09-07 17:07:25 +0000 | [diff] [blame] | 50 | </body> |
| 51 | </html> |