| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library custom_element_constructor_test; |
| 6 import '../../pkg/unittest/lib/unittest.dart'; |
| 7 import '../../pkg/unittest/lib/html_individual_config.dart'; |
| 8 import 'dart:html'; |
| 9 |
| 10 class CustomA extends HtmlElement { |
| 11 static final tag = 'x-a'; |
| 12 factory CustomA() => new Element.tag(tag); |
| 13 |
| 14 static int ncallbacks = 0; |
| 15 |
| 16 void onCreated() { |
| 17 ncallbacks++; |
| 18 } |
| 19 } |
| 20 |
| 21 main() { |
| 22 useHtmlIndividualConfiguration(); |
| 23 |
| 24 // Adapted from Blink's |
| 25 // fast/dom/custom/constructor-calls-created-synchronously test. |
| 26 group('calls_created_synchronously', () { |
| 27 test('createdCallback', () { |
| 28 document.register(CustomA.tag, CustomA); |
| 29 var x = new CustomA(); |
| 30 expect(CustomA.ncallbacks, 1); |
| 31 }); |
| 32 }); |
| 33 } |
| OLD | NEW |