Chromium Code Reviews| Index: pkg/polymer/test/nested_binding_test.dart |
| diff --git a/pkg/polymer/test/nested_binding_test.dart b/pkg/polymer/test/nested_binding_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..221e730590861a936d71915ae58140159479975d |
| --- /dev/null |
| +++ b/pkg/polymer/test/nested_binding_test.dart |
| @@ -0,0 +1,44 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +library polymer.test.nested_binding_test; |
| + |
| +import 'dart:async'; |
| +import 'dart:html'; |
| +import 'dart:mirrors'; |
| +import 'package:polymer/polymer.dart'; |
| +import 'package:unittest/unittest.dart'; |
| +import 'package:unittest/html_config.dart'; |
| +import 'package:unittest/matcher.dart'; |
| + |
| +@CustomTag('my-test') |
| +class MyTest extends PolymerElement { |
| + final List fruits = toObservable(['apples', 'oranges', 'pears']); |
| + |
| + final _testDone = new Completer(); |
| + |
| + MyTest.created() : super.created(); |
| + |
| + _runTest(_) { |
| + expect($['fruit'].text.trim(), 'Short name: [pears]'); |
| + _testDone.complete(); |
| + } |
| + |
| + ready() { |
| + onMutation($['fruit']).then(_runTest); |
| + } |
| + |
| +} |
| + |
| +main() { |
| + 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,
|
| + |
| + initPolymer(); |
| + useHtmlConfiguration(); |
| + |
| + setUp(() => Polymer.onReady); |
| + |
| + test('ready called', () => |
| + (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 :)
|
| +} |