OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../../../fast/js/resources/js-test-pre.js"></script> |
| 5 <script src="../resources/multiple-fields-ax-aria-attributes.js"></script> |
5 </head> | 6 </head> |
6 <body> | 7 <body> |
7 <input id=test type="time" value="12:34:56.789"> | 8 <input id=test type="time" value="12:34:56.789"> |
8 <script> | 9 <script> |
9 description('This test checks aria-help attribute of fields in multiple fields t
ime input UI.'); | 10 description('This test checks aria-help attribute of fields in multiple fields t
ime input UI.'); |
10 | 11 |
11 function enableAccessibility() | 12 function enableAccessibility() |
12 { | 13 { |
13 if (!window.accessibilityController) { | 14 if (!window.accessibilityController) { |
14 debug("Please run inside DumpRenderTree."); | 15 debug("Please run inside DumpRenderTree."); |
15 return; | 16 return; |
16 } | 17 } |
17 } | 18 } |
18 | 19 |
19 function focusedFieldValueDescription() | |
20 { | |
21 if (!window.accessibilityController) | |
22 return; | |
23 var element = accessibilityController.focusedElement | |
24 return element.helpText + ", " + element.valueDescription + ", " + element.
minValue + ", " + element.maxValue; | |
25 } | |
26 | |
27 function keyDown(key, modifiers) | 20 function keyDown(key, modifiers) |
28 { | 21 { |
29 if (!window.eventSender) | 22 if (!window.eventSender) |
30 return; | 23 return; |
31 eventSender.keyDown(key, modifiers); | 24 eventSender.keyDown(key, modifiers); |
32 } | 25 } |
33 | 26 |
34 var testInput = document.getElementById("test"); | 27 var testInput = document.getElementById("test"); |
35 | 28 |
36 enableAccessibility(); | 29 enableAccessibility(); |
37 testInput.focus(); | 30 testInput.focus(); |
38 | 31 |
39 debug('Non-empty value'); | 32 debug('Non-empty value'); |
40 testInput.focus(); | 33 testInput.focus(); |
41 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Hours, AXValueD
escription: 12, 1, 12'); | 34 checkFocusedElementAXAttributes('AXHelp: Hours, AXValueDescription: 12, intValue
:12, range:1-12'); |
42 keyDown('\t'); | 35 keyDown('\t'); |
43 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Minutes, AXValu
eDescription: 34, 0, 59'); | 36 checkFocusedElementAXAttributes('AXHelp: Minutes, AXValueDescription: 34, intVal
ue:34, range:0-59'); |
44 keyDown('\t'); | 37 keyDown('\t'); |
45 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Seconds, AXValu
eDescription: 56, 0, 59'); | 38 checkFocusedElementAXAttributes('AXHelp: Seconds, AXValueDescription: 56, intVal
ue:56, range:0-59'); |
46 keyDown('\t'); | 39 keyDown('\t'); |
47 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Milliseconds, A
XValueDescription: 789, 0, 999'); | 40 checkFocusedElementAXAttributes('AXHelp: Milliseconds, AXValueDescription: 789,
intValue:789, range:0-999'); |
48 keyDown('\t'); | 41 keyDown('\t'); |
49 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: AM/PM, AXValueD
escription: PM, 1, 2'); | 42 checkFocusedElementAXAttributes('AXHelp: AM/PM, AXValueDescription: PM, intValue
:2, range:1-2'); |
50 | 43 |
51 debug('Empty value'); | 44 debug('Empty value'); |
52 keyDown('\b'); | 45 keyDown('\b'); |
53 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: AM/PM, AXValueD
escription: blank, 1, 2'); | 46 checkFocusedElementAXAttributes('AXHelp: AM/PM, AXValueDescription: blank, intVa
lue:0, range:1-2'); |
54 keyDown('\t', ['shiftKey']); | 47 keyDown('\t', ['shiftKey']); |
55 keyDown('\b'); | 48 keyDown('\b'); |
56 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Milliseconds, A
XValueDescription: blank, 0, 999'); | 49 checkFocusedElementAXAttributes('AXHelp: Milliseconds, AXValueDescription: blank
, intValue:0, range:0-999'); |
57 keyDown('\t', ['shiftKey']); | 50 keyDown('\t', ['shiftKey']); |
58 keyDown('\b'); | 51 keyDown('\b'); |
59 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Seconds, AXValu
eDescription: blank, 0, 59'); | 52 checkFocusedElementAXAttributes('AXHelp: Seconds, AXValueDescription: blank, int
Value:0, range:0-59'); |
60 keyDown('\t', ['shiftKey']); | 53 keyDown('\t', ['shiftKey']); |
61 keyDown('\b'); | 54 keyDown('\b'); |
62 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Minutes, AXValu
eDescription: blank, 0, 59'); | 55 checkFocusedElementAXAttributes('AXHelp: Minutes, AXValueDescription: blank, int
Value:0, range:0-59'); |
63 keyDown('\t', ['shiftKey']); | 56 keyDown('\t', ['shiftKey']); |
64 keyDown('\b'); | 57 keyDown('\b'); |
65 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Hours, AXValueD
escription: blank, 1, 12'); | 58 checkFocusedElementAXAttributes('AXHelp: Hours, AXValueDescription: blank, intVa
lue:0, range:1-12'); |
66 | 59 |
67 debug(''); | 60 debug(''); |
68 testInput.parentNode.removeChild(testInput); | 61 testInput.parentNode.removeChild(testInput); |
69 </script> | 62 </script> |
70 <script src="../../../fast/js/resources/js-test-post.js"></script> | 63 <script src="../../../fast/js/resources/js-test-post.js"></script> |
71 </body> | 64 </body> |
72 </html> | 65 </html> |
OLD | NEW |