blob: 7ac0260565b7b6b7c057b5d5bf34afee137de702 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
</head>
<body>
<input id=test type="time" value="12:34:56.789">
<script>
async_test((t) => {
var testInput = document.getElementById('test');
var expected = [
[ "Focus", "Hours", "12" ],
[ "Focus", "Minutes", "34" ],
[ "ValueChanged", "Minutes", "05" ],
[ "ValueChanged", "Minutes", "05" ] ];
accessibilityController.addNotificationListener(
t.step_func((element, notification) => {
if (notification == 'Focus' || notification == 'ValueChanged') {
var next_expectation = expected.shift();
console.log('next_expectation: ' + JSON.stringify(next_expectation));
console.log('actual: [' + notification + ', ' + element.name.trim() + ', ' + element.valueDescription.substr(20) + ']');
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>