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="date" value="2012-10-09"> | 8 <input id="test" type="date"> |
8 <script> | 9 <script> |
9 description('This test checks aria-help attribute of fields in multiple fields d
ate input UI.'); | 10 description('This test checks aria-help attribute of fields in multiple fields d
ate input UI.'); |
10 | 11 |
11 function focusedFieldValueDescription() | |
12 { | |
13 var element = accessibilityController.focusedElement; | |
14 return element.helpText + ', ' + element.valueDescription + ', ' + element.
minValue + ', ' + element.maxValue; | |
15 } | |
16 | |
17 var testInput = document.getElementById('test'); | 12 var testInput = document.getElementById('test'); |
18 | 13 |
19 if (!window.accessibilityController || !window.eventSender) | 14 if (!window.accessibilityController || !window.eventSender) |
20 debug('Please run inside DRT or WTR.'); | 15 debug('Please run inside DRT or WTR.'); |
21 else { | 16 else { |
| 17 testInput.focus(); |
| 18 debug('Initial empty state'); |
| 19 checkFocusedElementAXAttributes('AXHelp: Month, AXValueDescription: blank, i
ntValue:0, range:1-12'); |
| 20 eventSender.keyDown('\t'); |
| 21 checkFocusedElementAXAttributes('AXHelp: Day, AXValueDescription: blank, int
Value:0, range:1-31'); |
| 22 eventSender.keyDown('\t'); |
| 23 checkFocusedElementAXAttributes('AXHelp: Year, AXValueDescription: blank, in
tValue:0, range:1-275760'); |
| 24 |
| 25 eventSender.keyDown('\t', ['shiftKey']); |
| 26 eventSender.keyDown('\t', ['shiftKey']); |
22 debug('Non-empty value'); | 27 debug('Non-empty value'); |
23 testInput.focus(); | 28 testInput.value = "2012-10-09"; |
24 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Month, AXVa
lueDescription: 10, 1, 12'); | 29 checkFocusedElementAXAttributes('AXHelp: Month, AXValueDescription: 10, intV
alue:10, range:1-12'); |
25 eventSender.keyDown('\t'); | 30 eventSender.keyDown('\t'); |
26 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Day, AXValu
eDescription: 09, 1, 31'); | 31 checkFocusedElementAXAttributes('AXHelp: Day, AXValueDescription: 09, intVal
ue:9, range:1-31'); |
27 eventSender.keyDown('\t'); | 32 eventSender.keyDown('\t'); |
28 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Year, AXVal
ueDescription: 2012, 1, 275760'); | 33 checkFocusedElementAXAttributes('AXHelp: Year, AXValueDescription: 2012, int
Value:2012, range:1-275760'); |
29 | 34 |
30 debug('Empty value'); | 35 debug('Empty value'); |
31 eventSender.keyDown('\b'); | 36 eventSender.keyDown('\b'); |
32 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Year, AXVal
ueDescription: blank, 1, 275760'); | 37 checkFocusedElementAXAttributes('AXHelp: Year, AXValueDescription: blank, in
tValue:0, range:1-275760'); |
33 eventSender.keyDown('\t', ['shiftKey']); | 38 eventSender.keyDown('\t', ['shiftKey']); |
34 eventSender.keyDown('\b'); | 39 eventSender.keyDown('\b'); |
35 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Day, AXValu
eDescription: blank, 1, 31'); | 40 checkFocusedElementAXAttributes('AXHelp: Day, AXValueDescription: blank, int
Value:0, range:1-31'); |
36 eventSender.keyDown('\t', ['shiftKey']); | 41 eventSender.keyDown('\t', ['shiftKey']); |
37 eventSender.keyDown('\b'); | 42 eventSender.keyDown('\b'); |
38 shouldBeEqualToString('focusedFieldValueDescription()', 'AXHelp: Month, AXVa
lueDescription: blank, 1, 12'); | 43 checkFocusedElementAXAttributes('AXHelp: Month, AXValueDescription: blank, i
ntValue:0, range:1-12'); |
39 | 44 |
40 debug(''); | 45 debug(''); |
41 testInput.parentNode.removeChild(testInput); | 46 testInput.parentNode.removeChild(testInput); |
42 } | 47 } |
43 </script> | 48 </script> |
44 <script src="../../../fast/js/resources/js-test-post.js"></script> | 49 <script src="../../../fast/js/resources/js-test-post.js"></script> |
45 </body> | 50 </body> |
46 </html> | 51 </html> |
OLD | NEW |