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

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

Issue 2312183003: Removed Polymer from Observatory deps (Closed)
Patch Set: Created 4 years, 3 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
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(() {
40 zonk = 'zonk';
41 });
42 }
43
44 barChanged() {
45 expect(bar, 'bar', reason: 'change in ready calls *Changed');
46 _bar.complete();
47 }
48 }
49
50 main() => initPolymer().then((zone) => zone.run(() {
51 useHtmlConfiguration();
52
53 setUp(() => Polymer.onReady);
54
55 test('bar change detected', () => _bar.future);
56 test('zonk change detected', () => _zonk.future);
57 }));
OLDNEW
« no previous file with comments | « packages/polymer/test/prop_attr_reflection_test.html ('k') | packages/polymer/test/property_change_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698