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

Side by Side Diff: tests/html/input_element_test.dart

Issue 11691005: Revert "Filling in supported platforms for InputElement types." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 12 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 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
15 main() { 6 main() {
16 useHtmlIndividualConfiguration(); 7 useHtmlIndividualConfiguration();
17 8
18 group('supported_datetime', () { 9 test('hidden', () {
19 test('supported', () { 10 var e = new HiddenInputElement();
20 expect(DateTimeInputElement.supported, true); 11 expect(e is InputElement, 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');
21 }); 56 });
22 }); 57 });
23 58
24 group('supported_date', () { 59 group('date', () {
25 test('supported', () { 60 test('constructor', () {
26 expect(DateInputElement.supported, true); 61 var e = new DateInputElement();
62 expect(e is InputElement, true);
63 expect(e.type, 'date');
27 }); 64 });
28 }); 65 });
29 66
30 group('supported_month', () { 67 group('month', () {
31 test('supported', () { 68 test('constructor', () {
32 expect(MonthInputElement.supported, true); 69 var e = new MonthInputElement();
70 expect(e is InputElement, true);
71 expect(e.type, 'month');
33 }); 72 });
34 }); 73 });
35 74
36 group('supported_week', () { 75 group('week', () {
37 test('supported', () { 76 test('constructor', () {
38 expect(WeekInputElement.supported, true); 77 var e = new WeekInputElement();
78 expect(e is InputElement, true);
79 expect(e.type, 'week');
39 }); 80 });
40 }); 81 });
41 82
42 group('supported_time', () { 83 group('time', () {
43 test('supported', () { 84 test('constructor', () {
44 expect(TimeInputElement.supported, true); 85 var e = new TimeInputElement();
86 expect(e is InputElement, true);
87 expect(e.type, 'time');
45 }); 88 });
46 }); 89 });
47 90
48 group('supported_datetime-local', () { 91 group('datetime-local', () {
49 test('supported', () { 92 test('constructor', () {
50 expect(LocalDateTimeInputElement.supported, true); 93 var e = new LocalDateTimeInputElement();
94 expect(e is InputElement, true);
95 expect(e.type, 'datetime-local');
51 }); 96 });
52 }); 97 });
53 98
54 group('supported_number', () { 99 test('number', () {
55 test('supported', () { 100 var e = new NumberInputElement();
56 expect(NumberInputElement.supported, true); 101 expect(e is InputElement, 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');
57 }); 110 });
58 }); 111 });
59 112
60 group('supported_range', () { 113 test('checkbox', () {
61 test('supported', () { 114 var e = new CheckboxInputElement();
62 expect(RangeInputElement.supported, true); 115 expect(e is InputElement, true);
63 }); 116 expect(e.type, 'checkbox');
64 }); 117 });
65 118
66 group('constructors', () { 119 test('radio', () {
67 test('hidden', () { 120 var e = new RadioButtonInputElement();
68 check(new HiddenInputElement(), 'hidden'); 121 expect(e is InputElement, true);
69 }); 122 expect(e.type, 'radio');
123 });
70 124
71 test('search', () { 125 test('file', () {
72 check(new SearchInputElement(), 'search'); 126 var e = new FileUploadInputElement();
73 }); 127 expect(e is InputElement, true);
128 expect(e.type, 'file');
129 });
74 130
75 test('text', () { 131 test('submit', () {
76 check(new TextInputElement(), 'text'); 132 var e = new SubmitButtonInputElement();
77 }); 133 expect(e is InputElement, true);
134 expect(e.type, 'submit');
135 });
78 136
79 test('url', () { 137 test('image', () {
80 check(new UrlInputElement(), 'url'); 138 var e = new ImageButtonInputElement();
81 }); 139 expect(e is InputElement, true);
140 expect(e.type, 'image');
141 });
82 142
83 test('telephone', () { 143 test('reset', () {
84 check(new TelephoneInputElement(), 'tel'); 144 var e = new ResetButtonInputElement();
85 }); 145 expect(e is InputElement, true);
146 expect(e.type, 'reset');
147 });
86 148
87 test('email', () { 149 test('button', () {
88 check(new EmailInputElement(), 'email'); 150 var e = new ButtonInputElement();
89 }); 151 expect(e is InputElement, true);
90 152 expect(e.type, 'button');
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 });
156 }); 153 });
157 } 154 }
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