| 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 import 'dart:html'; | 5 import 'dart:html'; |
| 6 | 6 |
| 7 import 'package:minitest/minitest.dart'; | 7 import 'package:expect/minitest.dart'; |
| 8 | 8 |
| 9 main() { | 9 main() { |
| 10 check(String name, bool fn(), [bool supported = true]) { | 10 check(String name, bool fn(), [bool supported = true]) { |
| 11 test(name, () { | 11 test(name, () { |
| 12 var expectation = supported ? returnsNormally : throws; | 12 var expectation = supported ? returnsNormally : throws; |
| 13 expect(() { | 13 expect(() { |
| 14 expect(fn(), isTrue); | 14 expect(fn(), isTrue); |
| 15 }, expectation); | 15 }, expectation); |
| 16 }); | 16 }); |
| 17 } | 17 } |
| 18 | 18 |
| 19 group('constructors', () { | 19 group('constructors', () { |
| 20 check('table', () => new TableElement() is TableElement); | 20 check('table', () => new TableElement() is TableElement); |
| 21 check('template', () => new TemplateElement() is TemplateElement, | 21 check('template', () => new TemplateElement() is TemplateElement, |
| 22 TemplateElement.supported); | 22 TemplateElement.supported); |
| 23 check('textarea', () => new TextAreaElement() is TextAreaElement); | 23 check('textarea', () => new TextAreaElement() is TextAreaElement); |
| 24 check('title', () => new TitleElement() is TitleElement); | 24 check('title', () => new TitleElement() is TitleElement); |
| 25 check('td', () => new TableCellElement() is TableCellElement); | 25 check('td', () => new TableCellElement() is TableCellElement); |
| 26 check('col', () => new TableColElement() is TableColElement); | 26 check('col', () => new TableColElement() is TableColElement); |
| 27 check('colgroup', () => new Element.tag('colgroup') is TableColElement); | 27 check('colgroup', () => new Element.tag('colgroup') is TableColElement); |
| 28 check('tr', () => new TableRowElement() is TableRowElement); | 28 check('tr', () => new TableRowElement() is TableRowElement); |
| 29 check('tbody', () => new Element.tag('tbody') is TableSectionElement); | 29 check('tbody', () => new Element.tag('tbody') is TableSectionElement); |
| 30 check('tfoot', () => new Element.tag('tfoot') is TableSectionElement); | 30 check('tfoot', () => new Element.tag('tfoot') is TableSectionElement); |
| 31 check('thead', () => new Element.tag('thead') is TableSectionElement); | 31 check('thead', () => new Element.tag('thead') is TableSectionElement); |
| 32 check('track', () => new TrackElement() is TrackElement, | 32 check('track', () => new TrackElement() is TrackElement, |
| 33 TrackElement.supported); | 33 TrackElement.supported); |
| 34 }); | 34 }); |
| 35 } | 35 } |
| OLD | NEW |