Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / calendar-picker / month-picker-with-step.html
blob1164bc44caae15a2bc20b71ed19c8d31754dd849
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 <script src="../../forms/resources/picker-common.js"></script>
6 <script src="resources/calendar-picker-common.js"></script>
7 </head>
8 <body>
9 <p id="description"></p>
10 <div id="console"></div>
12 <input type=month id=month value="2011-04" step="9" min="2011-04">
14 <script>
15 description('Test if step limits available dates in month picker.');
17 openPicker(document.getElementById('month'), test1);
19 function test1() {
20 debug("Step without min.");
21 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');
23 // Close popup
24 eventSender.keyDown('escape');
26 document.getElementById('month').min = "2011-05";
27 document.getElementById('month').value = "2012-02";
29 waitUntilClosing(test1AfterClosing);
32 function test1AfterClosing() {
33 // Reopen popup
34 openPicker(document.getElementById('month'), test2);
37 function test2() {
38 debug("Step when min is set.");
39 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');
40 finishJSTest();
42 </script>
43 </body>
44 </html>