Chromium Code Reviews| OLD | NEW |
|---|---|
| (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.nested_binding_test; | |
| 6 | |
| 7 import 'dart:async'; | |
| 8 import 'dart:html'; | |
| 9 import 'dart:mirrors'; | |
| 10 import 'package:polymer/polymer.dart'; | |
| 11 import 'package:unittest/unittest.dart'; | |
| 12 import 'package:unittest/html_config.dart'; | |
| 13 import 'package:unittest/matcher.dart'; | |
| 14 | |
| 15 @CustomTag('my-test') | |
| 16 class MyTest extends PolymerElement { | |
| 17 final List fruits = toObservable(['apples', 'oranges', 'pears']); | |
| 18 | |
| 19 final _testDone = new Completer(); | |
| 20 | |
| 21 MyTest.created() : super.created(); | |
| 22 | |
| 23 _runTest(_) { | |
| 24 expect($['fruit'].text.trim(), 'Short name: [pears]'); | |
| 25 _testDone.complete(); | |
| 26 } | |
| 27 | |
| 28 ready() { | |
| 29 onMutation($['fruit']).then(_runTest); | |
| 30 } | |
| 31 | |
| 32 } | |
| 33 | |
| 34 main() { | |
| 35 reflectClass(String); // so we can call string.length | |
|
Siggi Cherem (dart-lang)
2013/11/01 01:54:33
didn't know this was also a hint for dart2js. Is t
Jennifer Messerly
2013/11/01 02:14:56
clarified comment. this line doesn't do anything,
| |
| 36 | |
| 37 initPolymer(); | |
| 38 useHtmlConfiguration(); | |
| 39 | |
| 40 setUp(() => Polymer.onReady); | |
| 41 | |
| 42 test('ready called', () => | |
| 43 (query('my-test') as MyTest)._testDone.future as Future); | |
|
Siggi Cherem (dart-lang)
2013/11/01 01:54:33
remove as Future?
Jennifer Messerly
2013/11/01 02:14:56
good catch :)
| |
| 44 } | |
| OLD | NEW |