Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1494)

Unified Diff: pkg/polymer/test/mirror_loader_test.dart

Issue 219433004: Fix mirror_loader to detect whether the type is a generic class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/polymer/lib/src/mirror_loader.dart ('k') | pkg/polymer/test/mirror_loader_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/test/mirror_loader_test.dart
diff --git a/pkg/polymer/test/mirror_loader_test.dart b/pkg/polymer/test/mirror_loader_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..b54e5e2ed77e9dbef835782937b77249d90dceb3
--- /dev/null
+++ b/pkg/polymer/test/mirror_loader_test.dart
@@ -0,0 +1,49 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:html';
+
+import 'package:unittest/unittest.dart';
+import 'package:unittest/html_config.dart';
+import 'package:polymer/polymer.dart';
+
+@CustomTag('x-a')
+class XA extends PolymerElement {
+ final String x = "a";
+ XA.created() : super.created();
+}
+
+// The next classes are here as a regression test for darbug.com/17929. Our
+// loader was incorrectly trying to retrieve the reflectiveType of these
+// classes.
+class Foo<T> {}
+
+@CustomTag('x-b')
+class XB<T> extends PolymerElement {
+ final String x = "a";
+ XB.created() : super.created();
+}
+
+main() {
+ useHtmlConfiguration();
+
+ runZoned(() {
+ initPolymer().run(() {
+ setUp(() => Polymer.onReady);
+
+ test('XA was registered correctly', () {
+ expect(querySelector('x-a').shadowRoot.nodes.first.text, 'a');
+ });
+
+ test('XB was not registered', () {
+ expect(querySelector('x-b').shadowRoot, null);
+ });
+ });
+ }, onError: (e) {
+ expect(e is UnsupportedError, isTrue);
+ expect('$e', contains(
+ 'Custom element classes cannot have type-parameters: XB'));
+ });
+}
« no previous file with comments | « pkg/polymer/lib/src/mirror_loader.dart ('k') | pkg/polymer/test/mirror_loader_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698