| 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 | |
| 11 int testsRun = 0; | |
| 12 | |
| 13 @CustomTag('decoration-test') | |
| 14 class DecorationTest extends PolymerElement { | |
| 15 List<int> options = [1, 2, 3, 4]; | |
| 16 | |
| 17 DecorationTest.created() : super.created(); | |
| 18 | |
| 19 ready() { | |
| 20 this.test(); | |
| 21 testsRun++; | |
| 22 } | |
| 23 | |
| 24 test() { | |
| 25 expect($['select'].children.length, 5, | |
| 26 reason: 'attribute template stamped'); | |
| 27 } | |
| 28 } | |
| 29 | |
| 30 @CustomTag('decoration-test2') | |
| 31 class DecorationTest2 extends DecorationTest { | |
| 32 List<List<int>> arrs = [[1, 2, 3], [4, 5, 6]]; | |
| 33 | |
| 34 DecorationTest2.created() : super.created(); | |
| 35 | |
| 36 test() { | |
| 37 expect($['tbody'].children.length, 3, reason: 'attribute template stamped'); | |
| 38 expect($['tbody'].children[1].children.length, 4, | |
| 39 reason: 'attribute sub-template stamped'); | |
| 40 } | |
| 41 } | |
| 42 | |
| 43 main() => initPolymer().then((zone) => zone.run(() { | |
| 44 useHtmlConfiguration(); | |
| 45 | |
| 46 setUp(() => Polymer.onReady); | |
| 47 | |
| 48 test('declaration-tests-ran', () { | |
| 49 expect(testsRun, 2, reason: 'decoration-tests-ran'); | |
| 50 }); | |
| 51 })); | |
| OLD | NEW |