summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/suggestion-picker/week-suggestion-picker-min-max-attribute.html
blob: da9e5b91b231b2904a3b34f7c9413a51b95d9cbb (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
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
<script src="../../forms/resources/picker-common.js"></script>
<script src="resources/suggestion-picker-common.js"></script>
</head>
<body style="background-color: #bbbbbb;">
<p id="description"></p>
<div id="console"></div>
<input type=week id=week value="2012-W12" min="2012-W02" max="2012-W08" list=suggestions>
<datalist id=suggestions>
    <option>2012-W01</option>
    <option>2012-W02</option>
    <option>2012-W03</option>
    <option>2012-W04</option>
    <option>2012-W05</option>
    <option>2012-W06</option>
    <option>2012-W07</option>
    <option>2012-W08</option>
    <option>2012-W09</option>
    <option>2012-W10</option>
</datalist>
<script>
description('Tests that min/max attributes filter out suggestions as expected.');

debug('Check that page popup doesn\'t exist at first.');
shouldBeNull('document.getElementById("mock-page-popup")');

openPicker(document.getElementById('week'), test);

function test() {
    popupWindow.focus();

    shouldBe('entryValues().length', '8');
    shouldBeEqualToString('entryValues()[0]', '2012-W02');
    shouldBeEqualToString('entryValues()[1]', '2012-W03');
    shouldBeEqualToString('entryValues()[2]', '2012-W04');
    shouldBeEqualToString('entryValues()[3]', '2012-W05');
    shouldBeEqualToString('entryValues()[4]', '2012-W06');
    shouldBeEqualToString('entryValues()[5]', '2012-W07');
    shouldBeEqualToString('entryValues()[6]', '2012-W08');
    shouldBeEqualToString('entryValues()[7]', '@openCalendarPicker');

    finishJSTest();
}

</script>
</body>
</html>