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

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

Issue 794473002: Delete polymer from the Dart repo (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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
OLDNEW
(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 polymer.test.property_change_test;
6
7 import 'dart:async';
8 import 'package:polymer/polymer.dart';
9 import 'package:unittest/unittest.dart';
10 import 'package:unittest/html_config.dart';
11
12 // Dart note: this is a tad different from the JS code. We don't support putting
13 // expandos on Dart objects and then observing them. On the other hand, we want
14 // to make sure that superclass observers are correctly detected.
15
16 final _zonk = new Completer();
17 final _bar = new Completer();
18
19 @reflectable
20 class XBase extends PolymerElement {
21 @observable String zonk = '';
22
23 XBase.created() : super.created();
24
25 zonkChanged() {
26 expect(zonk, 'zonk', reason: 'change calls *Changed on superclass');
27 _zonk.complete();
28 }
29 }
30
31 @CustomTag('x-test')
32 class XTest extends XBase {
33 @observable String bar = '';
34
35 XTest.created() : super.created();
36
37 ready() {
38 bar = 'bar';
39 new Future(() { zonk = 'zonk'; });
40 }
41
42 barChanged() {
43 expect(bar, 'bar', reason: 'change in ready calls *Changed');
44 _bar.complete();
45 }
46 }
47
48 main() => initPolymer().run(() {
49 useHtmlConfiguration();
50
51 setUp(() => Polymer.onReady);
52
53 test('bar change detected', () => _bar.future);
54 test('zonk change detected', () => _zonk.future);
55 });
OLDNEW
« no previous file with comments | « pkg/polymer/test/prop_attr_reflection_test.html ('k') | pkg/polymer/test/property_change_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698