OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <body> | 2 <body> |
3 <input type="datetime-local" id="test1"> | 3 <input type="datetime-local" id="test1"> |
4 <input type="datetime-local" id="test2" min="1999-01-01T00:00" max="2000-12-31T2
3:59"> | 4 <input type="datetime-local" id="test2" min="1999-01-01T00:00" max="2000-12-31T2
3:59"> |
5 <script> | 5 <script> |
6 function fieldsText(input) { | 6 function fieldsText(input) { |
7 return window.internals.oldestShadowRoot(input).textContent; | 7 return window.internals.oldestShadowRoot(input).textContent; |
8 } | 8 } |
9 | 9 |
| 10 // On Linux/Android with a newer ICU, date and time are separated by ','. |
| 11 function insertCommaIfNecessary(expected, input) { |
| 12 return (fieldsText(input).indexOf(', ') == -1) ? expected : |
| 13 expected.replace(' ', ', '); |
| 14 } |
| 15 |
10 function back(newState) { | 16 function back(newState) { |
11 parent.state = newState; | 17 parent.state = newState; |
12 history.back(); | 18 history.back(); |
13 } | 19 } |
14 | 20 |
15 function forward(newState) { | 21 function forward(newState) { |
16 parent.state = newState; | 22 parent.state = newState; |
17 history.forward(); | 23 history.forward(); |
18 } | 24 } |
19 | 25 |
(...skipping 26 matching lines...) Expand all Loading... |
46 } | 52 } |
47 case 'backTo1': | 53 case 'backTo1': |
48 parent.testCases.push( | 54 parent.testCases.push( |
49 { | 55 { |
50 'description' : 'Went back to a page. Checking a form contro
l which had a full value', | 56 'description' : 'Went back to a page. Checking a form contro
l which had a full value', |
51 'actual' : testInput1.value, | 57 'actual' : testInput1.value, |
52 'expected' : '12012-10-09T01:23' }, | 58 'expected' : '12012-10-09T01:23' }, |
53 { | 59 { |
54 'description' : 'Went back to a page. Checking a form contro
l which had a partial value', | 60 'description' : 'Went back to a page. Checking a form contro
l which had a partial value', |
55 'actual' : fieldsText(testInput2), | 61 'actual' : fieldsText(testInput2), |
56 'expected' : '01/dd/1999 --:00 --' | 62 'expected' : insertCommaIfNecessary('01/dd/1999 --:00 --', t
estInput1) |
57 }); | 63 }); |
58 forward('forwardTo2'); | 64 forward('forwardTo2'); |
59 break; | 65 break; |
60 case 'backTo1Second': | 66 case 'backTo1Second': |
61 parent.finishTest(); | 67 parent.finishTest(); |
62 break; | 68 break; |
63 default: | 69 default: |
64 parent.failed('Unexpected state(' + parent.state + ')'); | 70 parent.failed('Unexpected state(' + parent.state + ')'); |
65 break; | 71 break; |
66 } | 72 } |
(...skipping 17 matching lines...) Expand all Loading... |
84 case 'forwardTo2': | 90 case 'forwardTo2': |
85 parent.testCases.push( | 91 parent.testCases.push( |
86 { | 92 { |
87 'description' : 'Went forward to a page. Checking a form con
trol which had a full value', | 93 'description' : 'Went forward to a page. Checking a form con
trol which had a full value', |
88 'actual' : testInput1.value, | 94 'actual' : testInput1.value, |
89 'expected' : '0001-11-17T23:55' | 95 'expected' : '0001-11-17T23:55' |
90 }, | 96 }, |
91 { | 97 { |
92 'description' : 'Went forward to a page. Checking a form con
trol which had a partial value', | 98 'description' : 'Went forward to a page. Checking a form con
trol which had a partial value', |
93 'actual' : fieldsText(testInput2), | 99 'actual' : fieldsText(testInput2), |
94 'expected' : 'mm/31/yyyy 12:-- PM' | 100 'expected' : insertCommaIfNecessary('mm/31/yyyy 12:-- PM', t
estInput1) |
95 }); | 101 }); |
96 back('backTo1Second'); | 102 back('backTo1Second'); |
97 break; | 103 break; |
98 default: | 104 default: |
99 parent.failed('Unexpected state(' + parent.state + ')'); | 105 parent.failed('Unexpected state(' + parent.state + ')'); |
100 break; | 106 break; |
101 } | 107 } |
102 break; | 108 break; |
103 | 109 |
104 default: | 110 default: |
105 parent.failed('Unexpected page(' + pageName + ')'); | 111 parent.failed('Unexpected page(' + pageName + ')'); |
106 break; | 112 break; |
107 } | 113 } |
108 }; | 114 }; |
109 </script> | 115 </script> |
110 </body> | 116 </body> |
OLD | NEW |