summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-ax-aria-attributes.html
blob: bb829e060daea6ba8b2baea70411ab5cc2d883d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body>
<input id="test" type="week" value="2012-W10">
<script>
description('This test checks aria-help attribute of fields in multiple fields week input UI.');

function focusedFieldValueDescription()
{
    var element = accessibilityController.focusedElement;
    return element.description + ', ' +  element.valueDescription + ', ' + element.minValue + ', ' + element.maxValue;
}

var testInput = document.getElementById('test');

if (!window.accessibilityController || !window.eventSender)
    debug('Please run inside DRT or WTR.');
else {
    debug('Non-empty value');
    testInput.focus();
    shouldBeEqualToString('focusedFieldValueDescription()', 'Week, AXValueDescription: 10, 1, 53');
    eventSender.keyDown('\t');
    shouldBeEqualToString('focusedFieldValueDescription()', 'Year, AXValueDescription: 2012, 1, 275760');

    debug('Empty value');
    eventSender.keyDown('\b');
    shouldBeEqualToString('focusedFieldValueDescription()', 'Year, AXValueDescription: blank, 1, 275760');
    eventSender.keyDown('\t', ['shiftKey']);
    eventSender.keyDown('\b');
    shouldBeEqualToString('focusedFieldValueDescription()', 'Week, AXValueDescription: blank, 1, 53');

    debug('');
    testInput.remove();
}
</script>
</body>
</html>