Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / accessibility / spinbutton-value.html
blob1e613005935ce10516ebba82335bf00b3aa04606
1 <!DOCTYPE HTML>
2 <html>
3 <body>
4 <script src="../resources/js-test.js"></script>
6 <button id="untitled"></button>
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>
16 <div id="console"></div>
17 <script>
18 description("This tests that a spin button supports range value attributes.")
20 if (window.testRunner && window.accessibilityController) {
21 window.testRunner.dumpAsText();
23 function endsWith(str, suffix) {
24 str = '' + str;
25 return str.substr(str.length - suffix.length) == suffix;
28 var untitled = document.getElementById('untitled');
29 untitled.focus();
30 window.axUntitled = accessibilityController.focusedElement;
32 var spin = document.getElementById('spin');
33 spin.focus();
34 window.axSpin = accessibilityController.focusedElement;
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");
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.deprecatedTitle", "axUntitled.deprecatedTitle");
47 </script>
49 </body>
50 </html>