Chromium Code Reviews| 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:async'; | 5 import 'dart:async'; |
| 6 import 'dart:html'; | 6 import 'dart:html'; |
| 7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
| 8 import 'package:unittest/html_config.dart'; | 8 import 'package:unittest/html_config.dart'; |
| 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(); | 12 XFoo.created() : super.created(); |
| 13 | 13 |
| 14 @observable var foo = ''; | 14 @observable var foo = ''; |
| 15 @observable String baz = ''; | 15 @observable String baz = ''; |
| 16 } | 16 } |
| 17 | 17 |
| 18 class XBar extends XFoo { | 18 class XBar extends XFoo { |
| 19 XBar.created() : super.created(); | 19 XBar.created() : super.created(); |
| 20 | 20 |
| 21 @observable int zot = 3; | 21 @observable int zot = 3; |
| 22 @observable bool zim = false; | 22 @observable bool zim = false; |
| 23 @observable String str = 'str'; | 23 @observable String str = 'str'; |
| 24 @observable Object obj; | 24 // TODO(sigmund): change this type to Object (see dartbug.com/16962) |
|
Siggi Cherem (dart-lang)
2014/02/21 03:55:13
FYI - I managed to revert this workaround (I made
| |
| 25 @observable var obj; | |
| 25 } | 26 } |
| 26 | 27 |
| 27 class XCompose extends PolymerElement { | 28 class XCompose extends PolymerElement { |
| 28 XCompose.created() : super.created(); | 29 XCompose.created() : super.created(); |
| 29 | 30 |
| 30 @observable bool zim = false; | 31 @observable bool zim = false; |
| 31 } | 32 } |
| 32 | 33 |
| 33 Future onAttributeChange(Element node) { | 34 Future onAttributeChange(Element node) { |
| 34 var completer = new Completer(); | 35 var completer = new Completer(); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 expect(xbar.attributes.containsKey('zim'), false, reason: | 111 expect(xbar.attributes.containsKey('zim'), false, reason: |
| 111 'attribute reflects false valued boolean property as NOT ' | 112 'attribute reflects false valued boolean property as NOT ' |
| 112 'having attribute'); | 113 'having attribute'); |
| 113 xbar.obj = 'hi'; | 114 xbar.obj = 'hi'; |
| 114 }).then((_) => onAttributeChange(xbar)).then((_) { | 115 }).then((_) => onAttributeChange(xbar)).then((_) { |
| 115 expect(xbar.attributes['obj'], 'hi', reason: | 116 expect(xbar.attributes['obj'], 'hi', reason: |
| 116 'reflect property based on current type'); | 117 'reflect property based on current type'); |
| 117 }); | 118 }); |
| 118 }); | 119 }); |
| 119 } | 120 } |
| OLD | NEW |