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

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

Issue 216113008: Adding test for InputElement.valueAsNumber (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « no previous file | 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 {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 136 }
137 }); 137 });
138 138
139 test('datetime-local', () { 139 test('datetime-local', () {
140 check(new LocalDateTimeInputElement(), 'datetime-local', 140 check(new LocalDateTimeInputElement(), 'datetime-local',
141 LocalDateTimeInputElement.supported); 141 LocalDateTimeInputElement.supported);
142 }); 142 });
143 143
144 test('number', () { 144 test('number', () {
145 check(new NumberInputElement(), 'number', NumberInputElement.supported); 145 check(new NumberInputElement(), 'number', NumberInputElement.supported);
146 if (NumberInputElement.supported) {
147 var element = new NumberInputElement();
148 element.value = '123';
149 expect(element.valueAsNumber, 123);
150 }
146 }); 151 });
147 152
148 test('range', () { 153 test('range', () {
149 check(new RangeInputElement(), 'range', RangeInputElement.supported); 154 check(new RangeInputElement(), 'range', RangeInputElement.supported);
150 }); 155 });
151 156
152 test('checkbox', () { 157 test('checkbox', () {
153 check(new CheckboxInputElement(), 'checkbox'); 158 check(new CheckboxInputElement(), 'checkbox');
154 }); 159 });
155 160
(...skipping 23 matching lines...) Expand all
179 }); 184 });
180 185
181 group('attributes', () { 186 group('attributes', () {
182 test('valueSetNull', () { 187 test('valueSetNull', () {
183 final e = new TextInputElement(); 188 final e = new TextInputElement();
184 e.value = null; 189 e.value = null;
185 expect(e.value, ''); 190 expect(e.value, '');
186 }); 191 });
187 }); 192 });
188 } 193 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698