blob: 15ddb94c14d79376b43e2bc483ce4da52669d4a3 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../resources/multiple-fields-ax-aria-attributes.js"></script>
</head>
<body>
<input id="test" type="month" value="2012-10" aria-label="TestLabel" title="TestTitle">
<script>
test(function(t) {
var testInput = document.getElementById('test');
testInput.focus();
assert_equals(focusedElementDescription(),
'Month TestLabel, ---------, "October", TestTitle, intValue:10, range:1-12');
eventSender.keyDown('\t');
assert_equals(focusedElementDescription(),
'Year TestLabel, ----, "2012", TestTitle, intValue:2012, range:1-275760');
}, 'Non-empty value');
test(function(t) {
eventSender.keyDown('Backspace');
assert_equals(focusedElementDescription(),
'Year TestLabel, ----, "", TestTitle, intValue:0, range:1-275760');
eventSender.keyDown('\t', ['shiftKey']);
eventSender.keyDown('Backspace');
assert_equals(focusedElementDescription(),
'Month TestLabel, ---------, "", TestTitle, intValue:0, range:1-12');
}, 'Empty value');
</script>
</body>
</html>