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

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
« no previous file with comments | « 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 main() { 6 main() {
7 useHtmlIndividualConfiguration(); 7 useHtmlIndividualConfiguration();
8 8
9 test('hidden', () { 9 test('hidden', () {
10 var e = new HiddenInputElement(); 10 var e = new HiddenInputElement();
(...skipping 30 matching lines...) Expand all
41 expect(e is InputElement, true); 41 expect(e is InputElement, true);
42 expect(e.type, 'email'); 42 expect(e.type, 'email');
43 }); 43 });
44 44
45 test('password', () { 45 test('password', () {
46 var e = new PasswordInputElement(); 46 var e = new PasswordInputElement();
47 expect(e is InputElement, true); 47 expect(e is InputElement, true);
48 expect(e.type, 'password'); 48 expect(e.type, 'password');
49 }); 49 });
50 50
51 group('datetime', () { 51 group('supported_datetime', () {
52 test('constructor', () { 52 test('supported', () {
53 var e = new DateTimeInputElement(); 53 expect(DateTimeInputElement.supported, true);
54 expect(e is InputElement, true);
55 expect(e.type, 'datetime');
56 }); 54 });
57 }); 55 });
58 56
59 group('date', () { 57 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.
60 test('constructor', () { 58 var expectation = DateTimeInputElement.supported ? 'datetime' : 'text';
61 var e = new DateInputElement(); 59
62 expect(e is InputElement, true); 60 var e = new DateTimeInputElement();
63 expect(e.type, 'date'); 61 expect(e is InputElement, true);
62 expect(e.type, expectation);
63 });
64
65 group('supported_date', () {
66 test('supported', () {
67 expect(DateInputElement.supported, true);
64 }); 68 });
65 }); 69 });
66 70
67 group('month', () { 71 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
68 test('constructor', () { 72 var expectation = DateInputElement.supported ? 'date' : 'text';
69 var e = new MonthInputElement(); 73
70 expect(e is InputElement, true); 74 var e = new DateInputElement();
71 expect(e.type, 'month'); 75 expect(e is InputElement, true);
76 expect(e.type, expectation);
77 });
78
79 group('supported_month', () {
80 test('supported', () {
81 expect(MonthInputElement.supported, true);
72 }); 82 });
73 }); 83 });
74 84
75 group('week', () { 85 test('month', () {
76 test('constructor', () { 86 var expectation = MonthInputElement.supported ? 'month' : 'text';
77 var e = new WeekInputElement(); 87
78 expect(e is InputElement, true); 88 var e = new MonthInputElement();
79 expect(e.type, 'week'); 89 expect(e is InputElement, true);
90 expect(e.type, expectation);
91 });
92
93 group('supported_week', () {
94 test('supported', () {
95 expect(WeekInputElement.supported, true);
80 }); 96 });
81 }); 97 });
82 98
83 group('time', () { 99 test('week', () {
84 test('constructor', () { 100 var expectation = WeekInputElement.supported ? 'week' : 'text';
85 var e = new TimeInputElement(); 101
86 expect(e is InputElement, true); 102 var e = new WeekInputElement();
87 expect(e.type, 'time'); 103 expect(e is InputElement, true);
104 expect(e.type, expectation);
105 });
106
107 group('supported_time', () {
108 test('supported', () {
109 expect(TimeInputElement.supported, true);
88 }); 110 });
89 }); 111 });
90 112
91 group('datetime-local', () { 113 test('time', () {
92 test('constructor', () { 114 var expectation = TimeInputElement.supported ? 'time' : 'text';
93 var e = new LocalDateTimeInputElement(); 115
94 expect(e is InputElement, true); 116 var e = new TimeInputElement();
95 expect(e.type, 'datetime-local'); 117 expect(e is InputElement, true);
118 expect(e.type, expectation);
119 });
120
121 group('supported_datetime-local', () {
122 test('supported', () {
123 expect(LocalDateTimeInputElement.supported, true);
124 });
125 });
126
127 test('datetime-local', () {
128 var expectation = LocalDateTimeInputElement.supported ?
129 'datetime-local' : 'text';
130
131 var e = new LocalDateTimeInputElement();
132 expect(e is InputElement, true);
133 expect(e.type, expectation);
134 });
135
136 group('supported_number', () {
137 test('supported', () {
138 expect(NumberInputElement.supported, true);
96 }); 139 });
97 }); 140 });
98 141
99 test('number', () { 142 test('number', () {
143 var expectation = TimeInputElement.supported ? 'number' : 'text';
144
100 var e = new NumberInputElement(); 145 var e = new NumberInputElement();
101 expect(e is InputElement, true); 146 expect(e is InputElement, true);
102 expect(e.type, 'number'); 147 expect(e.type, expectation);
103 }); 148 });
104 149
105 group('range', () { 150 group('supported_range', () {
106 test('constructor', () { 151 test('supported', () {
107 var e = new RangeInputElement(); 152 expect(RangeInputElement.supported, true);
108 expect(e is InputElement, true);
109 expect(e.type, 'range');
110 }); 153 });
111 }); 154 });
112 155
156 test('range', () {
157 var expectation = RangeInputElement.supported ? 'range' : 'text';
158
159 var e = new RangeInputElement();
160 expect(e is InputElement, true);
161 expect(e.type, expectation);
162 });
163
113 test('checkbox', () { 164 test('checkbox', () {
114 var e = new CheckboxInputElement(); 165 var e = new CheckboxInputElement();
115 expect(e is InputElement, true); 166 expect(e is InputElement, true);
116 expect(e.type, 'checkbox'); 167 expect(e.type, 'checkbox');
117 }); 168 });
118 169
119 test('radio', () { 170 test('radio', () {
120 var e = new RadioButtonInputElement(); 171 var e = new RadioButtonInputElement();
121 expect(e is InputElement, true); 172 expect(e is InputElement, true);
122 expect(e.type, 'radio'); 173 expect(e.type, 'radio');
(...skipping 22 matching lines...) Expand all
145 expect(e is InputElement, true); 196 expect(e is InputElement, true);
146 expect(e.type, 'reset'); 197 expect(e.type, 'reset');
147 }); 198 });
148 199
149 test('button', () { 200 test('button', () {
150 var e = new ButtonInputElement(); 201 var e = new ButtonInputElement();
151 expect(e is InputElement, true); 202 expect(e is InputElement, true);
152 expect(e.type, 'button'); 203 expect(e.type, 'button');
153 }); 204 });
154 } 205 }
OLDNEW
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698