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 import 'dart:async'; | |
| 6 import 'dart:html'; | |
| 7 import 'package:polymer/polymer.dart'; | |
| 8 import 'package:unittest/unittest.dart'; | |
| 9 import 'package:unittest/html_config.dart'; | |
| 10 import 'package:unittest/matcher.dart'; | |
| 11 | |
| 12 @CustomTag('x-foo') | |
| 13 class XFoo extends PolymerElement { | |
| 14 @observable var foo = 'foo!'; | |
| 15 final _ready = new Completer(); | |
| 16 Future onTestDone; | |
| 17 | |
| 18 XFoo.created() : super.created() { | |
| 19 onTestDone = _ready.future.then(_runTest); | |
| 20 } | |
| 21 | |
| 22 _runTest(_) { | |
| 23 expect(foo, $['foo'].attributes['foo']); | |
| 24 expect($['bool'].attributes['foo'], ''); | |
| 25 expect($['bool'].attributes, isNot(contains('foo?'))); | |
| 26 expect($['content'].innerHtml, foo); | |
| 27 // | |
|
Siggi Cherem (dart-lang)
2013/10/24 00:50:43
remove?
Jennifer Messerly
2013/10/24 00:58:59
sure. I think that was from original :)
| |
| 28 expect(foo, $['bar'].attributes['foo']); | |
| 29 expect($['barBool'].attributes['foo'], ''); | |
| 30 expect($['barBool'].attributes, isNot(contains('foo?'))); | |
| 31 expect($['barContent'].innerHtml, foo); | |
| 32 } | |
| 33 | |
| 34 ready() => _ready.complete(); | |
| 35 } | |
| 36 | |
| 37 main() { | |
| 38 initPolymer(); | |
| 39 useHtmlConfiguration(); | |
| 40 | |
| 41 setUp(() => Polymer.onReady); | |
| 42 | |
| 43 test('ready called', () => query('x-foo').xtag.onTestDone); | |
|
Siggi Cherem (dart-lang)
2013/10/24 00:50:43
remove xtag
Jennifer Messerly
2013/10/24 00:58:59
Done.
| |
| 44 } | |
| OLD | NEW |