Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: tests/html/input_element_test.dart

Issue 11659031: Filling in supported platforms for InputElement types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« tests/html/html.status ('K') | « tests/html/html.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c4946cf6944a22dd49df57f15a2c3b0aeb38e209 100644
--- a/tests/html/input_element_test.dart
+++ b/tests/html/input_element_test.dart
@@ -3,152 +3,155 @@ import '../../pkg/unittest/lib/unittest.dart';
import '../../pkg/unittest/lib/html_individual_config.dart';
import 'dart:html';
+void check(InputElement element, String type, [bool supported = true]) {
+ expect(element is InputElement, true);
+ if (supported) {
+ expect(element.type, type);
+ } else {
+ expect(element.type, 'text');
+ }
+}
+
main() {
useHtmlIndividualConfiguration();
- test('hidden', () {
- var e = new HiddenInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'hidden');
+ group('supported_datetime', () {
+ test('supported', () {
+ expect(DateTimeInputElement.supported, true);
+ });
});
- test('search', () {
- var e = new SearchInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'search');
+ group('supported_date', () {
+ test('supported', () {
+ expect(DateInputElement.supported, true);
+ });
});
- test('text', () {
- var e = new TextInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'text');
+ group('supported_month', () {
+ test('supported', () {
+ expect(MonthInputElement.supported, true);
+ });
});
- test('url', () {
- var e = new UrlInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'url');
+ group('supported_week', () {
+ test('supported', () {
+ expect(WeekInputElement.supported, true);
+ });
});
- test('telephone', () {
- var e = new TelephoneInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'tel');
+ group('supported_time', () {
+ test('supported', () {
+ expect(TimeInputElement.supported, true);
+ });
});
- test('email', () {
- var e = new EmailInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'email');
+ group('supported_datetime-local', () {
+ test('supported', () {
+ expect(LocalDateTimeInputElement.supported, true);
+ });
});
- test('password', () {
- var e = new PasswordInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'password');
+ group('supported_number', () {
+ test('supported', () {
+ expect(NumberInputElement.supported, true);
+ });
});
- group('datetime', () {
- test('constructor', () {
- var e = new DateTimeInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'datetime');
+ group('supported_range', () {
+ test('supported', () {
+ expect(RangeInputElement.supported, true);
});
});
- group('date', () {
- test('constructor', () {
- var e = new DateInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'date');
+ group('constructors', () {
+ test('hidden', () {
+ check(new HiddenInputElement(), 'hidden');
});
- });
- group('month', () {
- test('constructor', () {
- var e = new MonthInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'month');
+ test('search', () {
+ check(new SearchInputElement(), 'search');
});
- });
- group('week', () {
- test('constructor', () {
- var e = new WeekInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'week');
+ test('text', () {
+ check(new TextInputElement(), 'text');
});
- });
- group('time', () {
- test('constructor', () {
- var e = new TimeInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'time');
+ test('url', () {
+ check(new UrlInputElement(), 'url');
});
- });
- group('datetime-local', () {
- test('constructor', () {
- var e = new LocalDateTimeInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'datetime-local');
+ test('telephone', () {
+ check(new TelephoneInputElement(), 'tel');
});
- });
- test('number', () {
- var e = new NumberInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'number');
- });
+ test('email', () {
+ check(new EmailInputElement(), 'email');
+ });
- group('range', () {
- test('constructor', () {
- var e = new RangeInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'range');
+ test('password', () {
+ check(new PasswordInputElement(), 'password');
});
- });
- test('checkbox', () {
- var e = new CheckboxInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'checkbox');
- });
+ test('datetime', () {
+ check(new DateTimeInputElement(), 'datetime',
+ DateTimeInputElement.supported);
+ });
- test('radio', () {
- var e = new RadioButtonInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'radio');
- });
+ test('date', () {
+ check(new DateInputElement(), 'date', DateInputElement.supported);
+ });
- test('file', () {
- var e = new FileUploadInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'file');
- });
+ test('month', () {
+ check(new MonthInputElement(), 'month', MonthInputElement.supported);
+ });
- test('submit', () {
- var e = new SubmitButtonInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'submit');
- });
+ test('week', () {
+ check(new WeekInputElement(), 'week', WeekInputElement.supported);
+ });
- test('image', () {
- var e = new ImageButtonInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'image');
- });
+ test('time', () {
+ check(new TimeInputElement(), 'time', TimeInputElement.supported);
+ });
- test('reset', () {
- var e = new ResetButtonInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'reset');
- });
+ test('datetime-local', () {
+ check(new LocalDateTimeInputElement(), 'datetime-local',
+ LocalDateTimeInputElement.supported);
+ });
+
+ test('number', () {
+ check(new NumberInputElement(), 'number', NumberInputElement.supported);
+ });
+
+ test('range', () {
+ check(new RangeInputElement(), 'range', RangeInputElement.supported);
+ });
+
+ test('checkbox', () {
+ check(new CheckboxInputElement(), 'checkbox');
+ });
- test('button', () {
- var e = new ButtonInputElement();
- expect(e is InputElement, true);
- expect(e.type, 'button');
+ test('radio', () {
+ check(new RadioButtonInputElement(), 'radio');
+ });
+
+ test('file', () {
+ check(new FileUploadInputElement(), 'file');
+ });
+
+ test('submit', () {
+ check(new SubmitButtonInputElement(), 'submit');
+ });
+
+ test('image', () {
+ check(new ImageButtonInputElement(), 'image');
+ });
+
+ test('reset', () {
+ check(new ResetButtonInputElement(), 'reset');
+ });
+
+ test('button', () {
+ check(new ButtonInputElement(), 'button');
+ });
});
}
« tests/html/html.status ('K') | « tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698