summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/suggestion-picker/time-suggestion-picker-min-max-attribute.html
blob: e6eaea663a09ce3ad62f348f3792924ddccbb436 (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
<!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=time id=time value="01:00" min="01:02" max="2012-01-04" list=suggestions>
<datalist id=suggestions>
    <option>01:00</option>
    <option>01:01</option>
    <option>01:02</option>
    <option>01:03</option>
    <option>01:04</option>
    <option>01:05</option>
    <option>01:06</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")');

window.onload = function() {
    openPicker(document.getElementById('time'), test);
};

function test() {
    popupWindow.focus();

    shouldBe('entryValues().length', '5');
    shouldBeEqualToString('entryValues()[0]', '01:02');
    shouldBeEqualToString('entryValues()[1]', '01:03');
    shouldBeEqualToString('entryValues()[2]', '01:04');
    shouldBeEqualToString('entryValues()[3]', '01:05');
    shouldBeEqualToString('entryValues()[4]', '01:06');

    finishJSTest();
}

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