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 </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 DRT or WTR. | 9 Please run this with DRT or WTR. |
10 </p> | 10 </p> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 debug('==> Focus on the year field.'); | 65 debug('==> Focus on the year field.'); |
66 mouseClickOn(108, center); | 66 mouseClickOn(108, center); |
67 keyDown('upArrow'); | 67 keyDown('upArrow'); |
68 shouldBeEqualToString('input.value', '2346-08-20T10:00'); | 68 shouldBeEqualToString('input.value', '2346-08-20T10:00'); |
69 mouseClickOn(input.offsetWidth - spinButtonOffset, center - 1); | 69 mouseClickOn(input.offsetWidth - spinButtonOffset, center - 1); |
70 shouldBeEqualToString('input.value', '2347-08-20T10:00'); | 70 shouldBeEqualToString('input.value', '2347-08-20T10:00'); |
71 mouseClickOn(input.offsetWidth - spinButtonOffset, center + 1); | 71 mouseClickOn(input.offsetWidth - spinButtonOffset, center + 1); |
72 shouldBeEqualToString('input.value', '2346-08-20T10:00'); | 72 shouldBeEqualToString('input.value', '2346-08-20T10:00'); |
73 shouldBeZero('window.getSelection().rangeCount'); // No text selection. | 73 shouldBeZero('window.getSelection().rangeCount'); // No text selection. |
74 | 74 |
75 // With ICU 52 on Linux/Android, a comma is used to delimete date and time and | |
76 // the hour and time field positions are shifted. | |
77 var commaOffset = window.internals.oldestShadowRoot(input).textContent.indexOf(' , ') == -1 ? 0 : 16; | |
78 | |
75 debug(''); | 79 debug(''); |
76 debug('==> Focus on the hour field.'); | 80 debug('==> Focus on the hour field.'); |
tkent
2014/06/03 01:45:07
Optional: We can get a shadow node for the hour fi
| |
77 mouseClickOn(190, center); | 81 mouseClickOn(190 + commaOffset, center); |
78 keyDown('upArrow'); | 82 keyDown('upArrow'); |
79 shouldBeEqualToString('input.value', '2346-08-20T11:00'); | 83 shouldBeEqualToString('input.value', '2346-08-20T11:00'); |
80 mouseClickOn(input.offsetWidth - spinButtonOffset, center - 1); | 84 mouseClickOn(input.offsetWidth - spinButtonOffset, center - 1); |
81 shouldBeEqualToString('input.value', '2346-08-20T00:00'); | 85 shouldBeEqualToString('input.value', '2346-08-20T00:00'); |
82 mouseClickOn(input.offsetWidth - spinButtonOffset, center + 1); | 86 mouseClickOn(input.offsetWidth - spinButtonOffset, center + 1); |
83 shouldBeEqualToString('input.value', '2346-08-20T11:00'); | 87 shouldBeEqualToString('input.value', '2346-08-20T11:00'); |
84 shouldBeZero('window.getSelection().rangeCount'); // No text selection. | 88 shouldBeZero('window.getSelection().rangeCount'); // No text selection. |
85 | 89 |
86 debug(''); | 90 debug(''); |
87 debug('==> Focus on the minute field.'); | 91 debug('==> Focus on the minute field.'); |
88 mouseClickOn(240, center); | 92 mouseClickOn(240 + commaOffset, center); |
89 keyDown('upArrow'); | 93 keyDown('upArrow'); |
90 shouldBeEqualToString('input.value', '2346-08-20T11:01'); | 94 shouldBeEqualToString('input.value', '2346-08-20T11:01'); |
91 mouseClickOn(input.offsetWidth - spinButtonOffset, center - 1); | 95 mouseClickOn(input.offsetWidth - spinButtonOffset, center - 1); |
92 shouldBeEqualToString('input.value', '2346-08-20T11:02'); | 96 shouldBeEqualToString('input.value', '2346-08-20T11:02'); |
93 mouseClickOn(input.offsetWidth - spinButtonOffset, center + 1); | 97 mouseClickOn(input.offsetWidth - spinButtonOffset, center + 1); |
94 shouldBeEqualToString('input.value', '2346-08-20T11:01'); | 98 shouldBeEqualToString('input.value', '2346-08-20T11:01'); |
95 shouldBeZero('window.getSelection().rangeCount'); // No text selection. | 99 shouldBeZero('window.getSelection().rangeCount'); // No text selection. |
96 | 100 |
101 // Set the value explicitly to prevent a earlier failure from leading to a | |
102 // failure in the subsequent tests. | |
103 input.value= '2346-08-20T11:01'; | |
97 debug(''); | 104 debug(''); |
98 debug('==> Click on a disabled field.'); | 105 debug('==> Click on a disabled field.'); |
99 input.disabled = true; | 106 input.disabled = true; |
100 mouseClickOn(12, center); | 107 mouseClickOn(12, center); |
101 keyDown('upArrow'); | 108 keyDown('upArrow'); |
102 shouldBeEqualToString('input.value', '2346-08-20T11:01'); | 109 shouldBeEqualToString('input.value', '2346-08-20T11:01'); |
103 input.disabled = false; | 110 input.disabled = false; |
104 | 111 |
105 debug(''); | 112 debug(''); |
106 debug('==> Click on a read-only field.'); | 113 debug('==> Click on a read-only field.'); |
(...skipping 13 matching lines...) Expand all Loading... | |
120 mouseClickOn(input.offsetWidth - clearButtonOffset, center); | 127 mouseClickOn(input.offsetWidth - clearButtonOffset, center); |
121 shouldBeEqualToString('input.value', '2346-08-20T11:01'); | 128 shouldBeEqualToString('input.value', '2346-08-20T11:01'); |
122 input.disabled = false; | 129 input.disabled = false; |
123 mouseClickOn(input.offsetWidth - clearButtonOffset, center); | 130 mouseClickOn(input.offsetWidth - clearButtonOffset, center); |
124 shouldBeEqualToString('input.value', ''); | 131 shouldBeEqualToString('input.value', ''); |
125 | 132 |
126 debug(''); | 133 debug(''); |
127 </script> | 134 </script> |
128 </body> | 135 </body> |
129 </html> | 136 </html> |
OLD | NEW |