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

Side by Side 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 7 years, 11 months 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 unified diff | Download patch | Annotate | Revision Log
« tests/html/html.status ('K') | « tests/html/html.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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]) {
7 expect(element is InputElement, true);
8 if (supported) {
9 expect(element.type, type);
10 } else {
11 expect(element.type, 'text');
12 }
13 }
14
6 main() { 15 main() {
7 useHtmlIndividualConfiguration(); 16 useHtmlIndividualConfiguration();
8 17
9 test('hidden', () { 18 group('supported_datetime', () {
10 var e = new HiddenInputElement(); 19 test('supported', () {
11 expect(e is InputElement, true); 20 expect(DateTimeInputElement.supported, true);
12 expect(e.type, 'hidden');
13 });
14
15 test('search', () {
16 var e = new SearchInputElement();
17 expect(e is InputElement, true);
18 expect(e.type, 'search');
19 });
20
21 test('text', () {
22 var e = new TextInputElement();
23 expect(e is InputElement, true);
24 expect(e.type, 'text');
25 });
26
27 test('url', () {
28 var e = new UrlInputElement();
29 expect(e is InputElement, true);
30 expect(e.type, 'url');
31 });
32
33 test('telephone', () {
34 var e = new TelephoneInputElement();
35 expect(e is InputElement, true);
36 expect(e.type, 'tel');
37 });
38
39 test('email', () {
40 var e = new EmailInputElement();
41 expect(e is InputElement, true);
42 expect(e.type, 'email');
43 });
44
45 test('password', () {
46 var e = new PasswordInputElement();
47 expect(e is InputElement, true);
48 expect(e.type, 'password');
49 });
50
51 group('datetime', () {
52 test('constructor', () {
53 var e = new DateTimeInputElement();
54 expect(e is InputElement, true);
55 expect(e.type, 'datetime');
56 }); 21 });
57 }); 22 });
58 23
59 group('date', () { 24 group('supported_date', () {
60 test('constructor', () { 25 test('supported', () {
61 var e = new DateInputElement(); 26 expect(DateInputElement.supported, true);
62 expect(e is InputElement, true);
63 expect(e.type, 'date');
64 }); 27 });
65 }); 28 });
66 29
67 group('month', () { 30 group('supported_month', () {
68 test('constructor', () { 31 test('supported', () {
69 var e = new MonthInputElement(); 32 expect(MonthInputElement.supported, true);
70 expect(e is InputElement, true);
71 expect(e.type, 'month');
72 }); 33 });
73 }); 34 });
74 35
75 group('week', () { 36 group('supported_week', () {
76 test('constructor', () { 37 test('supported', () {
77 var e = new WeekInputElement(); 38 expect(WeekInputElement.supported, true);
78 expect(e is InputElement, true);
79 expect(e.type, 'week');
80 }); 39 });
81 }); 40 });
82 41
83 group('time', () { 42 group('supported_time', () {
84 test('constructor', () { 43 test('supported', () {
85 var e = new TimeInputElement(); 44 expect(TimeInputElement.supported, true);
86 expect(e is InputElement, true);
87 expect(e.type, 'time');
88 }); 45 });
89 }); 46 });
90 47
91 group('datetime-local', () { 48 group('supported_datetime-local', () {
92 test('constructor', () { 49 test('supported', () {
93 var e = new LocalDateTimeInputElement(); 50 expect(LocalDateTimeInputElement.supported, true);
94 expect(e is InputElement, true);
95 expect(e.type, 'datetime-local');
96 }); 51 });
97 }); 52 });
98 53
99 test('number', () { 54 group('supported_number', () {
100 var e = new NumberInputElement(); 55 test('supported', () {
101 expect(e is InputElement, true); 56 expect(NumberInputElement.supported, true);
102 expect(e.type, 'number');
103 });
104
105 group('range', () {
106 test('constructor', () {
107 var e = new RangeInputElement();
108 expect(e is InputElement, true);
109 expect(e.type, 'range');
110 }); 57 });
111 }); 58 });
112 59
113 test('checkbox', () { 60 group('supported_range', () {
114 var e = new CheckboxInputElement(); 61 test('supported', () {
115 expect(e is InputElement, true); 62 expect(RangeInputElement.supported, true);
116 expect(e.type, 'checkbox'); 63 });
117 }); 64 });
118 65
119 test('radio', () { 66 group('constructors', () {
120 var e = new RadioButtonInputElement(); 67 test('hidden', () {
121 expect(e is InputElement, true); 68 check(new HiddenInputElement(), 'hidden');
122 expect(e.type, 'radio'); 69 });
123 });
124 70
125 test('file', () { 71 test('search', () {
126 var e = new FileUploadInputElement(); 72 check(new SearchInputElement(), 'search');
127 expect(e is InputElement, true); 73 });
128 expect(e.type, 'file');
129 });
130 74
131 test('submit', () { 75 test('text', () {
132 var e = new SubmitButtonInputElement(); 76 check(new TextInputElement(), 'text');
133 expect(e is InputElement, true); 77 });
134 expect(e.type, 'submit');
135 });
136 78
137 test('image', () { 79 test('url', () {
138 var e = new ImageButtonInputElement(); 80 check(new UrlInputElement(), 'url');
139 expect(e is InputElement, true); 81 });
140 expect(e.type, 'image');
141 });
142 82
143 test('reset', () { 83 test('telephone', () {
144 var e = new ResetButtonInputElement(); 84 check(new TelephoneInputElement(), 'tel');
145 expect(e is InputElement, true); 85 });
146 expect(e.type, 'reset');
147 });
148 86
149 test('button', () { 87 test('email', () {
150 var e = new ButtonInputElement(); 88 check(new EmailInputElement(), 'email');
151 expect(e is InputElement, true); 89 });
152 expect(e.type, 'button'); 90
91 test('password', () {
92 check(new PasswordInputElement(), 'password');
93 });
94
95 test('datetime', () {
96 check(new DateTimeInputElement(), 'datetime',
97 DateTimeInputElement.supported);
98 });
99
100 test('date', () {
101 check(new DateInputElement(), 'date', DateInputElement.supported);
102 });
103
104 test('month', () {
105 check(new MonthInputElement(), 'month', MonthInputElement.supported);
106 });
107
108 test('week', () {
109 check(new WeekInputElement(), 'week', WeekInputElement.supported);
110 });
111
112 test('time', () {
113 check(new TimeInputElement(), 'time', TimeInputElement.supported);
114 });
115
116 test('datetime-local', () {
117 check(new LocalDateTimeInputElement(), 'datetime-local',
118 LocalDateTimeInputElement.supported);
119 });
120
121 test('number', () {
122 check(new NumberInputElement(), 'number', NumberInputElement.supported);
123 });
124
125 test('range', () {
126 check(new RangeInputElement(), 'range', RangeInputElement.supported);
127 });
128
129 test('checkbox', () {
130 check(new CheckboxInputElement(), 'checkbox');
131 });
132
133 test('radio', () {
134 check(new RadioButtonInputElement(), 'radio');
135 });
136
137 test('file', () {
138 check(new FileUploadInputElement(), 'file');
139 });
140
141 test('submit', () {
142 check(new SubmitButtonInputElement(), 'submit');
143 });
144
145 test('image', () {
146 check(new ImageButtonInputElement(), 'image');
147 });
148
149 test('reset', () {
150 check(new ResetButtonInputElement(), 'reset');
151 });
152
153 test('button', () {
154 check(new ButtonInputElement(), 'button');
155 });
153 }); 156 });
154 } 157 }
OLDNEW
« 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