OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library element_types_constructors_test4; | |
6 | |
7 import 'package:unittest/unittest.dart'; | |
8 import 'package:unittest/html_individual_config.dart'; | |
9 import 'dart:html'; | 5 import 'dart:html'; |
10 | 6 |
| 7 import 'package:minitest/minitest.dart'; |
| 8 |
11 main() { | 9 main() { |
12 useHtmlIndividualConfiguration(); | |
13 | |
14 check(String name, bool fn(), [bool supported = true]) { | 10 check(String name, bool fn(), [bool supported = true]) { |
15 test(name, () { | 11 test(name, () { |
16 var expectation = supported ? returnsNormally : throws; | 12 var expectation = supported ? returnsNormally : throws; |
17 expect(() { | 13 expect(() { |
18 expect(fn(), isTrue); | 14 expect(fn(), isTrue); |
19 }, expectation); | 15 }, expectation); |
20 }); | 16 }); |
21 } | 17 } |
22 | 18 |
23 group('constructors', () { | 19 group('constructors', () { |
24 check('p', () => new ParagraphElement() is ParagraphElement); | 20 check('p', () => new ParagraphElement() is ParagraphElement); |
25 check('param', () => new ParamElement() is ParamElement); | 21 check('param', () => new ParamElement() is ParamElement); |
26 check('pre', () => new PreElement() is PreElement); | 22 check('pre', () => new PreElement() is PreElement); |
27 check('progress', () => new ProgressElement() is ProgressElement, | 23 check('progress', () => new ProgressElement() is ProgressElement, |
28 ProgressElement.supported); | 24 ProgressElement.supported); |
29 check('q', () => new QuoteElement() is QuoteElement); | 25 check('q', () => new QuoteElement() is QuoteElement); |
30 check('script', () => new ScriptElement() is ScriptElement); | 26 check('script', () => new ScriptElement() is ScriptElement); |
31 check('select', () => new SelectElement() is SelectElement); | 27 check('select', () => new SelectElement() is SelectElement); |
32 check('shadow', | 28 check('shadow', |
33 () => new ShadowElement() is ShadowElement, ShadowElement.supported); | 29 () => new ShadowElement() is ShadowElement, ShadowElement.supported); |
34 check('source', () => new SourceElement() is SourceElement); | 30 check('source', () => new SourceElement() is SourceElement); |
35 check('span', () => new SpanElement() is SpanElement); | 31 check('span', () => new SpanElement() is SpanElement); |
36 check('style', () => new StyleElement() is StyleElement); | 32 check('style', () => new StyleElement() is StyleElement); |
37 }); | 33 }); |
38 } | 34 } |
OLD | NEW |