| 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, | |
| 38 reason: 'attribute template stamped'); | |
| 39 expect($['tbody'].children[1].children.length, 4, | |
| 40 reason: 'attribute sub-template stamped'); | |
| 41 } | |
| 42 } | |
| 43 | |
| 44 main() => initPolymer().run(() { | |
| 45 useHtmlConfiguration(); | |
| 46 | |
| 47 setUp(() => Polymer.onReady); | |
| 48 | |
| 49 test('declaration-tests-ran', () { | |
| 50 expect(testsRun, 2, reason: 'decoration-tests-ran'); | |
| 51 }); | |
| 52 }); | |
| OLD | NEW |