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.when_polymer_ready_test; |
| 6 |
| 7 import 'dart:async'; |
| 8 import 'dart:html'; |
| 9 |
| 10 import 'package:polymer/polymer.dart'; |
| 11 import 'package:unittest/unittest.dart'; |
| 12 import 'package:unittest/html_config.dart'; |
| 13 |
| 14 final Completer done = new Completer(); |
| 15 |
| 16 @CustomTag('x-a') |
| 17 class XA extends PolymerElement { |
| 18 XA.created() : super.created(); |
| 19 } |
| 20 |
| 21 main() { |
| 22 useHtmlConfiguration(); |
| 23 |
| 24 test('whenPolymerReady functions get called when polymer is ready', () { |
| 25 expect(querySelector('x-a') is XA, isFalse); |
| 26 initPolymer(); |
| 27 return done.future; |
| 28 }); |
| 29 } |
| 30 |
| 31 @whenPolymerReady |
| 32 void whenReady() { |
| 33 expect(querySelector('x-a') is XA, isTrue); |
| 34 done.complete(); |
| 35 } |
OLD | NEW |