OLD | NEW |
1 import 'package:unittest/unittest.dart'; | 1 import 'package:unittest/unittest.dart'; |
2 import 'package:unittest/html_config.dart'; | 2 import 'package:unittest/html_config.dart'; |
3 import 'dart:html'; | 3 import 'dart:html'; |
4 import '../utils.dart'; | 4 import '../utils.dart'; |
5 | 5 |
6 main() { | 6 main() { |
7 useHtmlConfiguration(); | 7 useHtmlConfiguration(); |
8 | 8 |
9 setUp(() => customElementsReady); | 9 setUp(() => customElementsReady); |
10 | 10 |
11 test('can register custom template with webcomponents-lite polyfill', () { | 11 test('can register custom template with webcomponents-lite polyfill', () { |
12 document.registerElement('my-element', MyElement, extendsTag: 'template'); | 12 document.registerElement('my-element', MyElement, extendsTag: 'template'); |
13 var e = new Element.tag('template', 'my-element'); | 13 var e = new Element.tag('template', 'my-element'); |
14 document.body.append(e); | 14 document.body.append(e); |
15 expect(e is TemplateElement, isTrue); | 15 expect(e is TemplateElement, isTrue); |
16 expect(e.method(), 'value'); | 16 expect(e.method(), 'value'); |
17 }); | 17 }); |
18 } | 18 } |
19 | 19 |
20 | |
21 class MyElement extends TemplateElement { | 20 class MyElement extends TemplateElement { |
22 MyElement.created() : super.created(); | 21 MyElement.created() : super.created(); |
23 method() => 'value'; | 22 method() => 'value'; |
24 } | 23 } |
OLD | NEW |