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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 keyDown('2'); // -> 01:[02] | 190 keyDown('2'); // -> 01:[02] |
174 shouldBeEqualToString('input.value', '01:02'); | 191 shouldBeEqualToString('input.value', '01:02'); |
175 keyDown('\t', ['shiftKey']); // -> [01]:02 | 192 keyDown('\t', ['shiftKey']); // -> [01]:02 |
176 keyDown('3'); // -> [03]:02 | 193 keyDown('3'); // -> [03]:02 |
177 shouldBeEqualToString('input.value', '03:02'); | 194 shouldBeEqualToString('input.value', '03:02'); |
178 input.removeAttribute("lang"); | 195 input.removeAttribute("lang"); |
179 </script> | 196 </script> |
180 <script src="../../js/resources/js-test-post.js"></script> | 197 <script src="../../js/resources/js-test-post.js"></script> |
181 </body> | 198 </body> |
182 </html> | 199 </html> |
OLD | NEW |