Chromium Code Reviews| Index: tests/html/input_element_test.dart |
| diff --git a/tests/html/input_element_test.dart b/tests/html/input_element_test.dart |
| index d8c80ce1730ee39f1c32a156e2b920428be8ac8e..c385b423744878ac2e84b4edbf1d06abd19fa3b4 100644 |
| --- a/tests/html/input_element_test.dart |
| +++ b/tests/html/input_element_test.dart |
| @@ -48,68 +48,119 @@ main() { |
| expect(e.type, 'password'); |
| }); |
| - group('datetime', () { |
| - test('constructor', () { |
| - var e = new DateTimeInputElement(); |
| - expect(e is InputElement, true); |
| - expect(e.type, 'datetime'); |
| + group('supported_datetime', () { |
| + test('supported', () { |
| + expect(DateTimeInputElement.supported, true); |
| }); |
| }); |
| - group('date', () { |
| - test('constructor', () { |
| - var e = new DateInputElement(); |
| - expect(e is InputElement, true); |
| - expect(e.type, 'date'); |
| + test('datetime', () { |
|
Emily Fortuna
2012/12/27 22:39:45
can these tests be refactored so that there's less
blois
2012/12/27 23:09:36
Good suggestion, done.
|
| + var expectation = DateTimeInputElement.supported ? 'datetime' : 'text'; |
| + |
| + var e = new DateTimeInputElement(); |
| + expect(e is InputElement, true); |
| + expect(e.type, expectation); |
| + }); |
| + |
| + group('supported_date', () { |
| + test('supported', () { |
| + expect(DateInputElement.supported, true); |
| + }); |
| + }); |
| + |
| + test('date', () { |
|
Emily Fortuna
2012/12/27 22:39:45
also, are you certain these tests that are not par
blois
2012/12/27 23:09:36
You're correct- I found this out yesterday after I
|
| + var expectation = DateInputElement.supported ? 'date' : 'text'; |
| + |
| + var e = new DateInputElement(); |
| + expect(e is InputElement, true); |
| + expect(e.type, expectation); |
| + }); |
| + |
| + group('supported_month', () { |
| + test('supported', () { |
| + expect(MonthInputElement.supported, true); |
| }); |
| }); |
| - group('month', () { |
| - test('constructor', () { |
| - var e = new MonthInputElement(); |
| - expect(e is InputElement, true); |
| - expect(e.type, 'month'); |
| + test('month', () { |
| + var expectation = MonthInputElement.supported ? 'month' : 'text'; |
| + |
| + var e = new MonthInputElement(); |
| + expect(e is InputElement, true); |
| + expect(e.type, expectation); |
| + }); |
| + |
| + group('supported_week', () { |
| + test('supported', () { |
| + expect(WeekInputElement.supported, true); |
| }); |
| }); |
| - group('week', () { |
| - test('constructor', () { |
| - var e = new WeekInputElement(); |
| - expect(e is InputElement, true); |
| - expect(e.type, 'week'); |
| + test('week', () { |
| + var expectation = WeekInputElement.supported ? 'week' : 'text'; |
| + |
| + var e = new WeekInputElement(); |
| + expect(e is InputElement, true); |
| + expect(e.type, expectation); |
| + }); |
| + |
| + group('supported_time', () { |
| + test('supported', () { |
| + expect(TimeInputElement.supported, true); |
| }); |
| }); |
| - group('time', () { |
| - test('constructor', () { |
| - var e = new TimeInputElement(); |
| - expect(e is InputElement, true); |
| - expect(e.type, 'time'); |
| + test('time', () { |
| + var expectation = TimeInputElement.supported ? 'time' : 'text'; |
| + |
| + var e = new TimeInputElement(); |
| + expect(e is InputElement, true); |
| + expect(e.type, expectation); |
| + }); |
| + |
| + group('supported_datetime-local', () { |
| + test('supported', () { |
| + expect(LocalDateTimeInputElement.supported, true); |
| }); |
| }); |
| - group('datetime-local', () { |
| - test('constructor', () { |
| - var e = new LocalDateTimeInputElement(); |
| - expect(e is InputElement, true); |
| - expect(e.type, 'datetime-local'); |
| + test('datetime-local', () { |
| + var expectation = LocalDateTimeInputElement.supported ? |
| + 'datetime-local' : 'text'; |
| + |
| + var e = new LocalDateTimeInputElement(); |
| + expect(e is InputElement, true); |
| + expect(e.type, expectation); |
| + }); |
| + |
| + group('supported_number', () { |
| + test('supported', () { |
| + expect(NumberInputElement.supported, true); |
| }); |
| }); |
| test('number', () { |
| + var expectation = TimeInputElement.supported ? 'number' : 'text'; |
| + |
| var e = new NumberInputElement(); |
| expect(e is InputElement, true); |
| - expect(e.type, 'number'); |
| + expect(e.type, expectation); |
| }); |
| - group('range', () { |
| - test('constructor', () { |
| - var e = new RangeInputElement(); |
| - expect(e is InputElement, true); |
| - expect(e.type, 'range'); |
| + group('supported_range', () { |
| + test('supported', () { |
| + expect(RangeInputElement.supported, true); |
| }); |
| }); |
| + test('range', () { |
| + var expectation = RangeInputElement.supported ? 'range' : 'text'; |
| + |
| + var e = new RangeInputElement(); |
| + expect(e is InputElement, true); |
| + expect(e.type, expectation); |
| + }); |
| + |
| test('checkbox', () { |
| var e = new CheckboxInputElement(); |
| expect(e is InputElement, true); |