blob: a69121c35bc13008b2a5cf5195dea74406d68c85 [file] [log] [blame]
dmazzoni@google.com85f30792012-09-07 17:07:25 +00001<!DOCTYPE HTML>
2<html>
3<body>
mark.lam@apple.coma931ab22013-09-08 01:18:24 +00004<script src="../resources/js-test-pre.js"></script>
dmazzoni@google.com85f30792012-09-07 17:07:25 +00005
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>
18description("This tests that a spin button supports range value attributes.")
19
20if (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.coma931ab22013-09-08 01:18:24 +000049<script src="../resources/js-test-post.js"></script>
dmazzoni@google.com85f30792012-09-07 17:07:25 +000050</body>
51</html>