summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/calendar-picker/month-picker-with-step.html
blob: 1164bc44caae15a2bc20b71ed19c8d31754dd849 (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
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
<script src="../../forms/resources/picker-common.js"></script>
<script src="resources/calendar-picker-common.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>

<input type=month id=month value="2011-04" step="9" min="2011-04">

<script>
description('Test if step limits available dates in month picker.');

openPicker(document.getElementById('month'), test1);

function test1() {
    debug("Step without min.");
    shouldBeEqualToString('availableDayCells()', '2011-04-01,2011-04-02,2011-04-03,2011-04-04,2011-04-05,2011-04-06,2011-04-07,2011-04-08,2011-04-09,2011-04-10,2011-04-11,2011-04-12,2011-04-13,2011-04-14,2011-04-15,2011-04-16,2011-04-17,2011-04-18,2011-04-19,2011-04-20,2011-04-21,2011-04-22,2011-04-23,2011-04-24,2011-04-25,2011-04-26,2011-04-27,2011-04-28,2011-04-29,2011-04-30');

    // Close popup
    eventSender.keyDown('escape');

    document.getElementById('month').min = "2011-05";
    document.getElementById('month').value = "2012-02";

    waitUntilClosing(test1AfterClosing);
}

function test1AfterClosing() {
    // Reopen popup
    openPicker(document.getElementById('month'), test2);
}

function test2() {
    debug("Step when min is set.");
    shouldBeEqualToString('availableDayCells()', '2012-02-01,2012-02-02,2012-02-03,2012-02-04,2012-02-05,2012-02-06,2012-02-07,2012-02-08,2012-02-09,2012-02-10,2012-02-11,2012-02-12,2012-02-13,2012-02-14,2012-02-15,2012-02-16,2012-02-17,2012-02-18,2012-02-19,2012-02-20,2012-02-21,2012-02-22,2012-02-23,2012-02-24,2012-02-25,2012-02-26,2012-02-27,2012-02-28,2012-02-29');
    finishJSTest();
}
</script>
</body>
</html>