| 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 import 'dart:html'; | 5 import 'dart:html'; |
| 6 import 'package:unittest/unittest.dart'; | 6 import 'package:unittest/unittest.dart'; |
| 7 import 'package:unittest/html_config.dart'; | 7 import 'package:unittest/html_config.dart'; |
| 8 import 'package:polymer/platform.dart' as Platform; | 8 import 'package:polymer/platform.dart' as Platform; |
| 9 import 'package:polymer/polymer.dart'; | 9 import 'package:polymer/polymer.dart'; |
| 10 | 10 |
| 11 class XFoo extends PolymerElement { | 11 class XFoo extends PolymerElement { |
| 12 XFoo.created() : super.created(); |
| 13 |
| 12 @observable var foo = ''; | 14 @observable var foo = ''; |
| 13 @observable String baz = ''; | 15 @observable String baz = ''; |
| 14 } | 16 } |
| 15 | 17 |
| 16 class XBar extends XFoo { | 18 class XBar extends XFoo { |
| 19 XBar.created() : super.created(); |
| 20 |
| 17 @observable int zot = 3; | 21 @observable int zot = 3; |
| 18 @observable bool zim = false; | 22 @observable bool zim = false; |
| 19 @observable String str = 'str'; | 23 @observable String str = 'str'; |
| 20 @observable Object obj; | 24 @observable Object obj; |
| 21 } | 25 } |
| 22 | 26 |
| 23 class XCompose extends PolymerElement { | 27 class XCompose extends PolymerElement { |
| 28 XCompose.created() : super.created(); |
| 29 |
| 24 @observable bool zim = false; | 30 @observable bool zim = false; |
| 25 } | 31 } |
| 26 | 32 |
| 27 main() { | 33 main() { |
| 28 useHtmlConfiguration(); | 34 useHtmlConfiguration(); |
| 29 | 35 |
| 30 // Most tests use @CustomTag, here we test out the impertive register: | 36 // Most tests use @CustomTag, here we test out the impertive register: |
| 31 Polymer.register('x-foo', XFoo); | 37 Polymer.register('x-foo', XFoo); |
| 32 Polymer.register('x-bar', XBar); | 38 Polymer.register('x-bar', XBar); |
| 33 Polymer.register('x-compose', XCompose); | 39 Polymer.register('x-compose', XCompose); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 Platform.endOfMicrotask(expectAsync0(() { | 107 Platform.endOfMicrotask(expectAsync0(() { |
| 102 expect(xbar.attributes['obj'], objAttr, reason: | 108 expect(xbar.attributes['obj'], objAttr, reason: |
| 103 'do not reflect property with default type of object'); | 109 'do not reflect property with default type of object'); |
| 104 })); | 110 })); |
| 105 })); | 111 })); |
| 106 })); | 112 })); |
| 107 })); | 113 })); |
| 108 })); | 114 })); |
| 109 }); | 115 }); |
| 110 } | 116 } |
| OLD | NEW |