OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 <script src="../../forms/resources/picker-common.js"></script> | 5 <script src="../../forms/resources/picker-common.js"></script> |
6 <script src="resources/calendar-picker-common.js"></script> | 6 <script src="resources/calendar-picker-common.js"></script> |
7 <p id="description"></p> | 7 <p id="description"></p> |
8 <div id="console"></div> | 8 <div id="console"></div> |
9 <input type="date" id="date1" value="2000-01-02"> | 9 <input type="date" id="date1" value="2000-01-02"> |
10 | 10 |
11 <script> | 11 <script> |
12 description('Tests if typing an arrow key dispatches |Focus| and |ActiveDescenda
ntChanged| a11y events.'); | 12 description('Tests if typing an arrow key dispatches |Focus| and |ActiveDescenda
ntChanged| a11y events.'); |
13 | 13 |
14 window.accessibilityController.setNotificationListener(function(axnode, type) { | 14 window.accessibilityController.setNotificationListener(function(axnode, type) { |
15 if (type == 'Focus') { | 15 if (type == 'Focus') { |
16 debug('Focused: ' + accessibilityController.focusedElement.description); | 16 debug('Focused: ' + escapeHTML(accessibilityController.focusedElement.de
scription)); |
17 } else if (type == 'ActiveDescendantChanged') { | 17 } else if (type == 'ActiveDescendantChanged') { |
18 testPassed('Received ActiveDescendantChanged'); | 18 testPassed('Received ActiveDescendantChanged'); |
19 if (++activeDescendantCounter >= 2) | 19 if (++activeDescendantCounter == 2) |
20 finishJSTest(); | 20 testButtonDescription(); |
21 } | 21 } |
22 }); | 22 }); |
23 var activeDescendantCounter = 0; | 23 var activeDescendantCounter = 0; |
24 var date1 = document.getElementById('date1'); | 24 var date1 = document.getElementById('date1'); |
25 openPicker(date1, test1); | 25 openPicker(date1, test1); |
26 | 26 |
27 function test1() { | 27 function test1() { |
28 eventSender.keyDown('rightArrow'); | 28 eventSender.keyDown('rightArrow'); |
29 } | 29 } |
| 30 |
| 31 function testButtonDescription() { |
| 32 // Focus on 'next month' button. |
| 33 eventSender.keyDown('\t', ['shiftKey']); |
| 34 // Focus on the today button. |
| 35 eventSender.keyDown('\t', ['shiftKey']); |
| 36 // Focus on 'previous month' button. |
| 37 eventSender.keyDown('\t', ['shiftKey']); |
| 38 // Focus on the month selector button. |
| 39 eventSender.keyDown('\t', ['shiftKey']); |
| 40 setTimeout(finishJSTest, 0); |
| 41 } |
30 </script> | 42 </script> |
31 </body> | 43 </body> |
32 </html> | 44 </html> |
OLD | NEW |