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=time id=time value="01:00" min="01:02" max="2012-01-04" list=suggest
ions> | 11 <input type=time id=time value="01:00" min="01:02" max="2012-01-04" list=suggest
ions> |
12 <datalist id=suggestions> | 12 <datalist id=suggestions> |
13 <option>01:00</option> | 13 <option>01:00</option> |
14 <option>01:01</option> | 14 <option>01:01</option> |
15 <option>01:02</option> | 15 <option>01:02</option> |
16 <option>01:03</option> | 16 <option>01:03</option> |
17 <option>01:04</option> | 17 <option>01:04</option> |
18 <option>01:05</option> | 18 <option>01:05</option> |
19 <option>01:06</option> | 19 <option>01:06</option> |
20 </datalist> | 20 </datalist> |
21 <script> | 21 <script> |
22 description('Tests that min/max attributes filter out suggestions as expected.')
; | 22 description('Tests that min/max attributes filter out suggestions as expected.')
; |
23 | 23 |
24 debug('Check that page popup doesn\'t exist at first.'); | 24 debug('Check that page popup doesn\'t exist at first.'); |
25 shouldBeNull('document.getElementById("mock-page-popup")'); | 25 shouldBeNull('document.getElementById("mock-page-popup")'); |
26 | 26 |
27 window.onload = function() { | 27 window.onload = function() { |
28 openPickerWithMock(document.getElementById('time'), test); | 28 openPicker(document.getElementById('time'), test); |
29 }; | 29 }; |
30 | 30 |
31 function test() { | 31 function test() { |
32 popupWindow.focus(); | 32 popupWindow.focus(); |
33 | 33 |
34 shouldBe('entryValues().length', '5'); | 34 shouldBe('entryValues().length', '5'); |
35 shouldBeEqualToString('entryValues()[0]', '01:02'); | 35 shouldBeEqualToString('entryValues()[0]', '01:02'); |
36 shouldBeEqualToString('entryValues()[1]', '01:03'); | 36 shouldBeEqualToString('entryValues()[1]', '01:03'); |
37 shouldBeEqualToString('entryValues()[2]', '01:04'); | 37 shouldBeEqualToString('entryValues()[2]', '01:04'); |
38 shouldBeEqualToString('entryValues()[3]', '01:05'); | 38 shouldBeEqualToString('entryValues()[3]', '01:05'); |
39 shouldBeEqualToString('entryValues()[4]', '01:06'); | 39 shouldBeEqualToString('entryValues()[4]', '01:06'); |
40 | 40 |
41 finishJSTest(); | 41 finishJSTest(); |
42 } | 42 } |
43 | 43 |
44 </script> | 44 </script> |
45 </body> | 45 </body> |
46 </html> | 46 </html> |
OLD | NEW |