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

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

Issue 11692011: Fixing up input element support checks for IE9. (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 void check(InputElement element, String type, [bool supported = true]) { 6 void check(InputElement element, String type, [bool supported = true]) {
7 expect(element is InputElement, true); 7 expect(element is InputElement, true);
8 if (supported) { 8 if (supported) {
9 expect(element.type, type); 9 expect(element.type, type);
10 } else { 10 } else {
11 expect(element.type, 'text'); 11 expect(element.type, 'text');
12 } 12 }
13 } 13 }
14 14
15 main() { 15 main() {
16 useHtmlIndividualConfiguration(); 16 useHtmlIndividualConfiguration();
17 17
18 group('supported_search', () {
19 test('supported', () {
20 expect(SearchInputElement.supported, true);
21 });
22 });
23
24 group('supported_url', () {
25 test('supported', () {
26 expect(UrlInputElement.supported, true);
27 });
28 });
29
30 group('supported_tel', () {
31 test('supported', () {
32 expect(TelephoneInputElement.supported, true);
33 });
34 });
35
36 group('supported_email', () {
37 test('supported', () {
38 expect(EmailInputElement.supported, true);
39 });
40 });
41
18 group('supported_datetime', () { 42 group('supported_datetime', () {
19 test('supported', () { 43 test('supported', () {
20 expect(DateTimeInputElement.supported, true); 44 expect(DateTimeInputElement.supported, true);
21 }); 45 });
22 }); 46 });
23 47
24 group('supported_date', () { 48 group('supported_date', () {
25 test('supported', () { 49 test('supported', () {
26 expect(DateInputElement.supported, true); 50 expect(DateInputElement.supported, true);
27 }); 51 });
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 expect(RangeInputElement.supported, true); 86 expect(RangeInputElement.supported, true);
63 }); 87 });
64 }); 88 });
65 89
66 group('constructors', () { 90 group('constructors', () {
67 test('hidden', () { 91 test('hidden', () {
68 check(new HiddenInputElement(), 'hidden'); 92 check(new HiddenInputElement(), 'hidden');
69 }); 93 });
70 94
71 test('search', () { 95 test('search', () {
72 check(new SearchInputElement(), 'search'); 96 check(new SearchInputElement(), 'search', SearchInputElement.supported);
73 }); 97 });
74 98
75 test('text', () { 99 test('text', () {
76 check(new TextInputElement(), 'text'); 100 check(new TextInputElement(), 'text');
77 }); 101 });
78 102
79 test('url', () { 103 test('url', () {
80 check(new UrlInputElement(), 'url'); 104 check(new UrlInputElement(), 'url', UrlInputElement.supported);
81 }); 105 });
82 106
83 test('telephone', () { 107 test('telephone', () {
84 check(new TelephoneInputElement(), 'tel'); 108 check(new TelephoneInputElement(), 'tel',
109 TelephoneInputElement.supported);
85 }); 110 });
86 111
87 test('email', () { 112 test('email', () {
88 check(new EmailInputElement(), 'email'); 113 check(new EmailInputElement(), 'email', EmailInputElement.supported);
89 }); 114 });
90 115
91 test('password', () { 116 test('password', () {
92 check(new PasswordInputElement(), 'password'); 117 check(new PasswordInputElement(), 'password');
93 }); 118 });
94 119
95 test('datetime', () { 120 test('datetime', () {
96 check(new DateTimeInputElement(), 'datetime', 121 check(new DateTimeInputElement(), 'datetime',
97 DateTimeInputElement.supported); 122 DateTimeInputElement.supported);
98 }); 123 });
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 173
149 test('reset', () { 174 test('reset', () {
150 check(new ResetButtonInputElement(), 'reset'); 175 check(new ResetButtonInputElement(), 'reset');
151 }); 176 });
152 177
153 test('button', () { 178 test('button', () {
154 check(new ButtonInputElement(), 'button'); 179 check(new ButtonInputElement(), 'button');
155 }); 180 });
156 }); 181 });
157 } 182 }
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