OLD | NEW |
1 import 'dart:html'; | 1 import 'dart:html'; |
2 | 2 |
3 import 'package:expect/minitest.dart'; | 3 import 'package:expect/minitest.dart'; |
4 | 4 |
5 void check(InputElement element, String type, [bool supported = true]) { | 5 void check(InputElement element, String type, [bool supported = true]) { |
6 expect(element is InputElement, true); | 6 expect(element is InputElement, true); |
7 if (supported) { | 7 if (supported) { |
8 expect(element.type, type); | 8 expect(element.type, type); |
9 } else { | 9 } else { |
10 expect(element.type, 'text'); | 10 expect(element.type, 'text'); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 test('text', () { | 90 test('text', () { |
91 check(new TextInputElement(), 'text'); | 91 check(new TextInputElement(), 'text'); |
92 }); | 92 }); |
93 | 93 |
94 test('url', () { | 94 test('url', () { |
95 check(new UrlInputElement(), 'url', UrlInputElement.supported); | 95 check(new UrlInputElement(), 'url', UrlInputElement.supported); |
96 }); | 96 }); |
97 | 97 |
98 test('telephone', () { | 98 test('telephone', () { |
99 check(new TelephoneInputElement(), 'tel', | 99 check( |
100 TelephoneInputElement.supported); | 100 new TelephoneInputElement(), 'tel', TelephoneInputElement.supported); |
101 }); | 101 }); |
102 | 102 |
103 test('email', () { | 103 test('email', () { |
104 check(new EmailInputElement(), 'email', EmailInputElement.supported); | 104 check(new EmailInputElement(), 'email', EmailInputElement.supported); |
105 }); | 105 }); |
106 | 106 |
107 test('password', () { | 107 test('password', () { |
108 check(new PasswordInputElement(), 'password'); | 108 check(new PasswordInputElement(), 'password'); |
109 }); | 109 }); |
110 | 110 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 }); | 183 }); |
184 test('valueSetNullProxy', () { | 184 test('valueSetNullProxy', () { |
185 final e = new TextInputElement(); | 185 final e = new TextInputElement(); |
186 e.value = _undefined; | 186 e.value = _undefined; |
187 expect(e.value, ''); | 187 expect(e.value, ''); |
188 }); | 188 }); |
189 }); | 189 }); |
190 } | 190 } |
191 | 191 |
192 dynamic _undefined = (() => new List(5)[0])(); | 192 dynamic _undefined = (() => new List(5)[0])(); |
OLD | NEW |