OLD | NEW |
1 library input_element_test; | 1 library input_element_test; |
2 import '../../pkg/unittest/lib/unittest.dart'; | 2 import '../../pkg/unittest/lib/unittest.dart'; |
3 import '../../pkg/unittest/lib/html_individual_config.dart'; | 3 import '../../pkg/unittest/lib/html_individual_config.dart'; |
4 import 'dart:html'; | 4 import 'dart:html'; |
5 | 5 |
6 void check(InputElement element, String type, [bool supported = true]) { | 6 void check(InputElement element, String type, [bool supported = true]) { |
7 expect(element is InputElement, true); | 7 expect(element is InputElement, true); |
8 if (supported) { | 8 if (supported) { |
9 expect(element.type, type); | 9 expect(element.type, type); |
10 } else { | 10 } else { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 test('month', () { | 118 test('month', () { |
119 check(new MonthInputElement(), 'month', MonthInputElement.supported); | 119 check(new MonthInputElement(), 'month', MonthInputElement.supported); |
120 }); | 120 }); |
121 | 121 |
122 test('week', () { | 122 test('week', () { |
123 check(new WeekInputElement(), 'week', WeekInputElement.supported); | 123 check(new WeekInputElement(), 'week', WeekInputElement.supported); |
124 }); | 124 }); |
125 | 125 |
126 test('time', () { | 126 test('time', () { |
127 check(new TimeInputElement(), 'time', TimeInputElement.supported); | 127 check(new TimeInputElement(), 'time', TimeInputElement.supported); |
| 128 if (TimeInputElement.supported) { |
| 129 // Bug 8836 Re-enable once Dartium supports DateTime properties. |
| 130 // var element = new TimeInputElement(); |
| 131 // var now = new DateTime.now(); |
| 132 // element.valueAsDate = now; |
| 133 // expect(element.valueAsDate is DateTime, isTrue); |
| 134 |
| 135 // Bug 8813, setting it is just going to the epoch. |
| 136 //expect(element.valueAsDate, now); |
| 137 } |
128 }); | 138 }); |
129 | 139 |
130 test('datetime-local', () { | 140 test('datetime-local', () { |
131 check(new LocalDateTimeInputElement(), 'datetime-local', | 141 check(new LocalDateTimeInputElement(), 'datetime-local', |
132 LocalDateTimeInputElement.supported); | 142 LocalDateTimeInputElement.supported); |
133 }); | 143 }); |
134 | 144 |
135 test('number', () { | 145 test('number', () { |
136 check(new NumberInputElement(), 'number', NumberInputElement.supported); | 146 check(new NumberInputElement(), 'number', NumberInputElement.supported); |
137 }); | 147 }); |
(...skipping 24 matching lines...) Expand all Loading... |
162 | 172 |
163 test('reset', () { | 173 test('reset', () { |
164 check(new ResetButtonInputElement(), 'reset'); | 174 check(new ResetButtonInputElement(), 'reset'); |
165 }); | 175 }); |
166 | 176 |
167 test('button', () { | 177 test('button', () { |
168 check(new ButtonInputElement(), 'button'); | 178 check(new ButtonInputElement(), 'button'); |
169 }); | 179 }); |
170 }); | 180 }); |
171 } | 181 } |
OLD | NEW |