| 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 |
| 8 import 'package:unittest/unittest.dart'; |
| 9 import 'package:unittest/html_config.dart'; |
| 10 import 'package:polymer/polymer.dart'; |
| 11 |
| 12 @CustomTag('x-a') |
| 13 class XA extends PolymerElement { |
| 14 final String x = "a"; |
| 15 XA.created() : super.created(); |
| 16 } |
| 17 |
| 18 // The next classes are here as a regression test for darbug.com/17929. Our |
| 19 // loader was incorrectly trying to retrieve the reflectiveType of these |
| 20 // classes. |
| 21 class Foo<T> {} |
| 22 |
| 23 @CustomTag('x-b') |
| 24 class XB<T> extends PolymerElement { |
| 25 final String x = "a"; |
| 26 XB.created() : super.created(); |
| 27 } |
| 28 |
| 29 main() { |
| 30 useHtmlConfiguration(); |
| 31 |
| 32 runZoned(() { |
| 33 initPolymer().run(() { |
| 34 setUp(() => Polymer.onReady); |
| 35 |
| 36 test('XA was registered correctly', () { |
| 37 expect(querySelector('x-a').shadowRoot.nodes.first.text, 'a'); |
| 38 }); |
| 39 |
| 40 test('XB was not registered', () { |
| 41 expect(querySelector('x-b').shadowRoot, null); |
| 42 }); |
| 43 }); |
| 44 }, onError: (e) { |
| 45 expect(e is UnsupportedError, isTrue); |
| 46 expect('$e', contains( |
| 47 'Custom element classes cannot have type-parameters: XB')); |
| 48 }); |
| 49 } |
| OLD | NEW |