Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Side by Side Diff: pkg/polymer/test/prop_attr_reflection_test.dart

Issue 211393006: Enables codegen support in polymer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/polymer/test/build/script_compactor_test.dart ('k') | pkg/smoke/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 @published var foo = '';
15 @observable String baz = ''; 15 @published 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 @published int zot = 3;
22 @observable bool zim = false; 22 @published bool zim = false;
23 @observable String str = 'str'; 23 @published String str = 'str';
24 @observable Object obj; 24 @published Object obj;
25 } 25 }
26 26
27 class XCompose extends PolymerElement { 27 class XCompose extends PolymerElement {
28 XCompose.created() : super.created(); 28 XCompose.created() : super.created();
29 29
30 @observable bool zim = false; 30 @published bool zim = false;
31 } 31 }
32 32
33 Future onAttributeChange(Element node) { 33 Future onAttributeChange(Element node) {
34 var completer = new Completer(); 34 var completer = new Completer();
35 new MutationObserver((records, observer) { 35 new MutationObserver((records, observer) {
36 observer.disconnect(); 36 observer.disconnect();
37 completer.complete(); 37 completer.complete();
38 })..observe(node, attributes: true); 38 })..observe(node, attributes: true);
39 scheduleMicrotask(Observable.dirtyCheck); 39 scheduleMicrotask(Observable.dirtyCheck);
40 return completer.future; 40 return completer.future;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 expect(xbar.attributes.containsKey('zim'), false, reason: 110 expect(xbar.attributes.containsKey('zim'), false, reason:
111 'attribute reflects false valued boolean property as NOT ' 111 'attribute reflects false valued boolean property as NOT '
112 'having attribute'); 112 'having attribute');
113 xbar.obj = 'hi'; 113 xbar.obj = 'hi';
114 }).then((_) => onAttributeChange(xbar)).then((_) { 114 }).then((_) => onAttributeChange(xbar)).then((_) {
115 expect(xbar.attributes['obj'], 'hi', reason: 115 expect(xbar.attributes['obj'], 'hi', reason:
116 'reflect property based on current type'); 116 'reflect property based on current type');
117 }); 117 });
118 }); 118 });
119 } 119 }
OLDNEW
« no previous file with comments | « pkg/polymer/test/build/script_compactor_test.dart ('k') | pkg/smoke/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698