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: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/polymer.dart'; | 8 import 'package:polymer/polymer.dart'; |
| 9 | 9 |
| 10 @CustomTag('my-child-element') | 10 @CustomTag('my-child-element') |
| 11 class MyChildElement extends PolymerElement { | 11 class MyChildElement extends PolymerElement { |
| 12 @published int camelCase; | 12 @published int camelCase; |
| 13 @published int lowercase; | 13 @published int lowercase; |
| 14 | 14 |
| 15 @reflectable get attributes => super.attributes; | |
|
Siggi Cherem (dart-lang)
2014/03/21 01:43:46
this turned out to be a bug in the test: "attribut
Jennifer Messerly
2014/03/21 20:08:54
hmmm, I'm confused now :(. I thought we shouldn't
Siggi Cherem (dart-lang)
2014/03/21 21:09:47
soon: we are still not generating code in polymer,
Jennifer Messerly
2014/03/22 00:37:56
ah, gotcha!
| |
| 16 | |
| 15 MyChildElement.created() : super.created(); | 17 MyChildElement.created() : super.created(); |
| 16 | 18 |
| 17 // Make this a no-op, so we can verify the initial | 19 // Make this a no-op, so we can verify the initial |
| 18 // reflectPropertyToAttribute works. | 20 // reflectPropertyToAttribute works. |
| 19 observeAttributeProperty(name) { } | 21 observeAttributeProperty(name) { } |
| 20 } | 22 } |
| 21 | 23 |
| 22 @CustomTag('my-element') | 24 @CustomTag('my-element') |
| 23 class MyElement extends PolymerElement { | 25 class MyElement extends PolymerElement { |
| 24 @observable int volume = 11; | 26 @observable int volume = 11; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 35 test('attribute reflected to property name', () { | 37 test('attribute reflected to property name', () { |
| 36 var child = querySelector('my-element') | 38 var child = querySelector('my-element') |
| 37 .shadowRoot.querySelector('my-child-element'); | 39 .shadowRoot.querySelector('my-child-element'); |
| 38 expect(child.lowercase, 11); | 40 expect(child.lowercase, 11); |
| 39 expect(child.camelCase, 11); | 41 expect(child.camelCase, 11); |
| 40 | 42 |
| 41 expect('11', child.attributes['lowercase']); | 43 expect('11', child.attributes['lowercase']); |
| 42 expect('11', child.attributes['camelcase']); | 44 expect('11', child.attributes['camelcase']); |
| 43 }); | 45 }); |
| 44 } | 46 } |
| OLD | NEW |