| 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 | 10 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 }); | 167 }); |
| 168 }); | 168 }); |
| 169 | 169 |
| 170 group('lifecycle', () { | 170 group('lifecycle', () { |
| 171 test('onCreated', () { | 171 test('onCreated', () { |
| 172 int oldCount = customCreatedCount; | 172 int oldCount = customCreatedCount; |
| 173 var tag = nextTag; | 173 var tag = nextTag; |
| 174 document.register(tag, CustomType); | 174 document.register(tag, CustomType); |
| 175 var element = new DivElement(); | 175 var element = new DivElement(); |
| 176 element.innerHtml = '<$tag></$tag>'; | 176 element.innerHtml = '<$tag></$tag>'; |
| 177 Platform.upgradeCustomElements(element); |
| 177 document.body.nodes.add(element); | 178 document.body.nodes.add(element); |
| 178 expect(customCreatedCount, oldCount + 1); | 179 expect(customCreatedCount, oldCount + 1); |
| 179 }); | 180 }); |
| 180 }); | 181 }); |
| 181 | 182 |
| 182 group('mixins', () { | 183 group('mixins', () { |
| 183 test('can invoke mixin methods', () { | 184 test('can invoke mixin methods', () { |
| 184 var tag = nextTag; | 185 var tag = nextTag; |
| 185 document.register(tag, CustomType); | 186 document.register(tag, CustomType); |
| 186 | 187 |
| 187 var element = new Element.tag(tag); | 188 var element = new Element.tag(tag); |
| 188 element.invokeMixinMethod(); | 189 element.invokeMixinMethod(); |
| 189 expect(element.mixinMethodCalled, isTrue); | 190 expect(element.mixinMethodCalled, isTrue); |
| 190 }); | 191 }); |
| 191 }); | 192 }); |
| 192 } | 193 } |
| OLD | NEW |