OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 custom_elements_test; | 5 library custom_elements_test; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 import 'dart:html'; | 7 import 'dart:html'; |
8 import 'package:unittest/html_individual_config.dart'; | 8 import 'package:unittest/html_individual_config.dart'; |
9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
10 import 'utils.dart'; | 10 import 'utils.dart'; |
(...skipping 23 matching lines...) Expand all Loading... |
34 int customCreatedCount = 0; | 34 int customCreatedCount = 0; |
35 | 35 |
36 int nextTagId = 0; | 36 int nextTagId = 0; |
37 String get nextTag => 'x-type${nextTagId++}'; | 37 String get nextTag => 'x-type${nextTagId++}'; |
38 | 38 |
39 class NotAnElement {} | 39 class NotAnElement {} |
40 | 40 |
41 main() { | 41 main() { |
42 useHtmlIndividualConfiguration(); | 42 useHtmlIndividualConfiguration(); |
43 | 43 |
44 setUp(loadPolyfills); | 44 setUp(() => customElementsReady); |
45 | 45 |
46 group('register', () { | 46 group('register', () { |
47 test('register', () { | 47 test('register', () { |
48 var tag = nextTag; | 48 var tag = nextTag; |
49 document.register(tag, CustomType); | 49 document.register(tag, CustomType); |
50 | 50 |
51 var element = new Element.tag(tag); | 51 var element = new Element.tag(tag); |
52 expect(element, isNotNull); | 52 expect(element, isNotNull); |
53 expect(element is CustomType, isTrue); | 53 expect(element is CustomType, isTrue); |
54 expect(element.createdCalled, isTrue); | 54 expect(element.createdCalled, isTrue); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 test('can invoke mixin methods', () { | 179 test('can invoke mixin methods', () { |
180 var tag = nextTag; | 180 var tag = nextTag; |
181 document.register(tag, CustomType); | 181 document.register(tag, CustomType); |
182 | 182 |
183 var element = new Element.tag(tag); | 183 var element = new Element.tag(tag); |
184 element.invokeMixinMethod(); | 184 element.invokeMixinMethod(); |
185 expect(element.mixinMethodCalled, isTrue); | 185 expect(element.mixinMethodCalled, isTrue); |
186 }); | 186 }); |
187 }); | 187 }); |
188 } | 188 } |
OLD | NEW |