Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / calendar-picker / calendar-picker-datetimelocal-with-step.html
blob763c8af2f44a860550b9fed4832eca3d2dd0224f
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../../resources/js-test.js"></script>
5 <script src="../resources/picker-common.js"></script>
6 <script src="resources/calendar-picker-common.js"></script>
7 <p id="description"></p>
8 <div id="console"></div>
10 <input type="datetime-local" id="datetime" value="2012-11-20T00:00" step="302400"/>
11 <input type="datetime-local" id="datetime-bare" step="302400"/>
13 <script>
14 description('Test if step limits available dates in calendar picker on datetime input.');
16 document.getElementById('datetime-bare').value = '2012-11-20T00:00';
17 openPicker(document.getElementById('datetime-bare'), test1);
19 function test1() {
20 debug("Step without value, min nor max attributes.");
21 shouldBeEqualToString('availableDayCells()', '2012-10-28,2012-11-01,2012-11-04,2012-11-08,2012-11-11,2012-11-15,2012-11-18,2012-11-22,2012-11-25,2012-11-29');
23 // Close popup
24 eventSender.keyDown('escape');
25 waitUntilClosing(test1AfterClose);
28 function test1AfterClose() {
29 openPicker(document.getElementById('datetime'), test2);
32 function test2() {
33 debug("Step without min or max.");
34 shouldBeEqualToString('availableDayCells()', '2012-10-30,2012-11-02,2012-11-06,2012-11-09,2012-11-13,2012-11-16,2012-11-20,2012-11-23,2012-11-27,2012-11-30');
36 // Close popup
37 eventSender.keyDown('escape');
38 waitUntilClosing(test2AfterClose);
41 function test2AfterClose() {
42 document.getElementById('datetime').min = '2012-11-16T12:00';
44 // Reopen popup
45 openPicker(document.getElementById('datetime'), test3);
48 function test3() {
49 debug("Step when min is set.");
50 shouldBeEqualToString('availableDayCells()', '2012-11-16,2012-11-20,2012-11-23,2012-11-27,2012-11-30');
52 // Close popup
53 eventSender.keyDown('escape');
54 waitUntilClosing(test3AfterClose);
57 function test3AfterClose() {
58 document.getElementById('datetime').max = '2012-11-20T00:00';
60 // Reopen popup
61 openPicker(document.getElementById('datetime'), test4);
64 function test4() {
65 debug("Step when min and max are set.");
66 shouldBeEqualToString('availableDayCells()', '2012-11-16,2012-11-20');
67 finishJSTest();
70 </script>
71 </body>
72 </html>