OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 <script src="../../forms/resources/picker-common.js"></script> | 5 <script src="../../forms/resources/picker-common.js"></script> |
6 <script src="resources/suggestion-picker-common.js"></script> | 6 <script src="resources/suggestion-picker-common.js"></script> |
7 </head> | 7 </head> |
8 <body style="background-color: #bbbbbb;"> | 8 <body style="background-color: #bbbbbb;"> |
9 <p id="description"></p> | 9 <p id="description"></p> |
10 <div id="console"></div> | 10 <div id="console"></div> |
11 <input type=month id=month value="2012-12" min="2012-02" max="2012-05" list=sugg
estions> | 11 <input type=month id=month value="2012-12" min="2012-02" max="2012-05" list=sugg
estions> |
12 <datalist id=suggestions> | 12 <datalist id=suggestions> |
13 <option>2012-01</option> | 13 <option>2012-01</option> |
14 <option>2012-02</option> | 14 <option>2012-02</option> |
15 <option>2012-03</option> | 15 <option>2012-03</option> |
16 <option>2012-04</option> | 16 <option>2012-04</option> |
17 <option>2012-05</option> | 17 <option>2012-05</option> |
18 <option>2012-06</option> | 18 <option>2012-06</option> |
19 <option>2012-07</option> | 19 <option>2012-07</option> |
20 <option>2012-08</option> | 20 <option>2012-08</option> |
21 <option>2012-09</option> | 21 <option>2012-09</option> |
22 <option>2012-10</option> | 22 <option>2012-10</option> |
23 </datalist> | 23 </datalist> |
24 <script> | 24 <script> |
25 description('Tests that min/max attributes filter out suggestions as expected.')
; | 25 description('Tests that min/max attributes filter out suggestions as expected.')
; |
26 | 26 |
27 debug('Check that page popup doesn\'t exist at first.'); | 27 debug('Check that page popup doesn\'t exist at first.'); |
28 shouldBeNull('document.getElementById("mock-page-popup")'); | 28 shouldBeNull('document.getElementById("mock-page-popup")'); |
29 | 29 |
30 openPickerWithMock(document.getElementById('month'), test); | 30 openPicker(document.getElementById('month'), test); |
31 | 31 |
32 function test() { | 32 function test() { |
33 popupWindow.focus(); | 33 popupWindow.focus(); |
34 | 34 |
35 shouldBe('entryValues().length', '5'); | 35 shouldBe('entryValues().length', '5'); |
36 shouldBeEqualToString('entryValues()[0]', '2012-02'); | 36 shouldBeEqualToString('entryValues()[0]', '2012-02'); |
37 shouldBeEqualToString('entryValues()[1]', '2012-03'); | 37 shouldBeEqualToString('entryValues()[1]', '2012-03'); |
38 shouldBeEqualToString('entryValues()[2]', '2012-04'); | 38 shouldBeEqualToString('entryValues()[2]', '2012-04'); |
39 shouldBeEqualToString('entryValues()[3]', '2012-05'); | 39 shouldBeEqualToString('entryValues()[3]', '2012-05'); |
40 shouldBeEqualToString('entryValues()[4]', '@openCalendarPicker'); | 40 shouldBeEqualToString('entryValues()[4]', '@openCalendarPicker'); |
41 | 41 |
42 finishJSTest(); | 42 finishJSTest(); |
43 } | 43 } |
44 | 44 |
45 </script> | 45 </script> |
46 </body> | 46 </body> |
47 </html> | 47 </html> |
OLD | NEW |