| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../../../resources/testharness.js"></script> |
| <script src="../../../resources/testharnessreport.js"></script> |
| </head> |
| <body> |
| <input id="test" type="month" value="2012-10"> |
| <script> |
| async_test((t) => { |
| var testInput = document.getElementById('test'); |
| var expected = [ |
| [ "Focus", "Month", "October" ], |
| [ "Focus", "Year", "2012" ], |
| [ "ValueChanged", "Year", "0004" ], |
| [ "ValueChanged", "Year", "0004" ], |
| [ "ValueChanged", "Year", "0005" ], |
| [ "ValueChanged", "Year", "0005" ] ]; |
| |
| |
| accessibilityController.addNotificationListener( |
| t.step_func((element, notification) => { |
| if (notification == 'Focus' || notification == 'ValueChanged') { |
| var next_expectation = expected.shift(); |
| assert_equals(notification, next_expectation[0]); |
| assert_equals(element.name.trim(), next_expectation[1]); |
| assert_equals(element.valueDescription.substr(20), next_expectation[2]); |
| } |
| if (expected.length === 0) |
| t.done(); |
| })); |
| |
| testInput.focus(); |
| eventSender.keyDown('\t'); |
| eventSender.keyDown('4'); |
| eventSender.keyDown('ArrowUp'); |
| |
| window.setTimeout(function() { |
| assert_unreached("Did not receive all accessibility notifications"); |
| t.done(); |
| }, 500); |
| }, 'This test checks value changed accessibility notifications.'); |
| </script> |
| </body> |
| </html> |