OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../js/resources/js-test-pre.js"></script> | 4 <script src="../../js/resources/js-test-pre.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <p id="description"></p> | 7 <p id="description"></p> |
8 <p> | 8 <p> |
9 Please run this with DumpRenderTree. | 9 Please run this with DumpRenderTree. |
10 </p> | 10 </p> |
(...skipping 30 matching lines...) Expand all Loading... |
41 input.focus(); | 41 input.focus(); |
42 } | 42 } |
43 | 43 |
44 beginTest('Digit keys'); | 44 beginTest('Digit keys'); |
45 keyDown('7'); | 45 keyDown('7'); |
46 keyDown('5'); | 46 keyDown('5'); |
47 keyDown('6'); | 47 keyDown('6'); |
48 keyDown('A'); | 48 keyDown('A'); |
49 shouldBeEqualToString('input.value', '07:56'); | 49 shouldBeEqualToString('input.value', '07:56'); |
50 | 50 |
| 51 beginTest('Digit keys starting with zero'); |
| 52 keyDown('0'); // -> [00]:-- -- |
| 53 keyDown('2'); // -> 02:[--] -- |
| 54 keyDown('0'); // -> 02:[00] -- |
| 55 keyDown('3'); // -> 02:03 [--] |
| 56 keyDown('P'); // -> 02:03 [PM] |
| 57 shouldBeEqualToString('input.value', '14:03'); |
| 58 |
| 59 beginTest('Digit keys and backspace key','01:01'); |
| 60 keyDown('0'); // -> [00]:-- -- |
| 61 keyDown('\b'); // -> [--]:-- -- |
| 62 keyDown('5'); // -> 05:[--] -- |
| 63 keyDown('6'); // -> 05:06 [--] |
| 64 keyDown('\b'); // -> 05:06 [--] |
| 65 keyDown('P'); // -> 05:06 [PM] |
| 66 shouldBeEqualToString('input.value', '17:06'); |
| 67 |
51 // FIXME: We should test type ahead time out. When event.leapForward() affects | 68 // FIXME: We should test type ahead time out. When event.leapForward() affects |
52 // keyboard event time stamp, we can uncomment this fragment. | 69 // keyboard event time stamp, we can uncomment this fragment. |
53 /* | 70 /* |
54 beginTest('Digit keys with type ahead timeout'); | 71 beginTest('Digit keys with type ahead timeout'); |
55 keyDown('1'); | 72 keyDown('1'); |
56 leapForward(1100); | 73 leapForward(1100); |
57 keyDown('1'); | 74 keyDown('1'); |
58 keyDown('5'); | 75 keyDown('5'); |
59 keyDown('6'); | 76 keyDown('6'); |
60 keyDown('A'); | 77 keyDown('A'); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 keyDown('2'); // -> 01:[02] | 191 keyDown('2'); // -> 01:[02] |
175 shouldBeEqualToString('input.value', '01:02'); | 192 shouldBeEqualToString('input.value', '01:02'); |
176 keyDown('leftArrow'); // -> [01]:02 | 193 keyDown('leftArrow'); // -> [01]:02 |
177 keyDown('3'); // -> [03]:02 | 194 keyDown('3'); // -> [03]:02 |
178 shouldBeEqualToString('input.value', '03:02'); | 195 shouldBeEqualToString('input.value', '03:02'); |
179 input.removeAttribute("lang"); | 196 input.removeAttribute("lang"); |
180 </script> | 197 </script> |
181 <script src="../../js/resources/js-test-post.js"></script> | 198 <script src="../../js/resources/js-test-post.js"></script> |
182 </body> | 199 </body> |
183 </html> | 200 </html> |
OLD | NEW |