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

Unified Diff: tests/html/custom/document_register_basic_test.dart

Issue 555123002: Filter abstract classes when computing candidate classes for custom elements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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
Index: tests/html/custom/document_register_basic_test.dart
diff --git a/tests/html/custom/document_register_basic_test.dart b/tests/html/custom/document_register_basic_test.dart
index e127ebf648d526adaae8c38b4688aa900920af6b..cf11b6373de8cdda251fcca254c34c98d7e3fb0d 100644
--- a/tests/html/custom/document_register_basic_test.dart
+++ b/tests/html/custom/document_register_basic_test.dart
@@ -35,9 +35,13 @@ class Baz extends Foo {
class BadB {
}
-class BadE implements HtmlElement {
- static final tag = 'x-tag-e';
- factory BadE() => new Element.tag(tag);
+abstract class BadC extends HtmlElement {
+ BadC.created() : super.created();
+}
+
+class BadF implements HtmlElement {
+ static final tag = 'x-tag-f';
+ factory BadF() => new Element.tag(tag);
}
main() {
@@ -56,14 +60,17 @@ main() {
// Invalid user type. Doesn't inherit from HtmlElement.
expect(() => document.registerElement('x-bad-b', BadB), throws);
+ // Cannot register abstract class.
+ expect(() => document.registerElement('x-bad-c', BadC), throws);
karlklose 2014/09/09 13:02:22 You could make this a multitest with label OK and
herhut 2014/09/09 13:33:26 Just for the record: It seems this is not supporte
+
// Not a type.
- expect(() => document.registerElement('x-bad-c', null), throws);
+ expect(() => document.registerElement('x-bad-d', null), throws);
// Cannot register system type.
- expect(() => document.registerElement('x-bad-d', Object), throws);
+ expect(() => document.registerElement('x-bad-e', Object), throws);
// Must extend HtmlElement, not just implement it.
- expect(() => document.registerElement(BadE.tag, BadE), throws);
+ expect(() => document.registerElement(BadF.tag, BadF), throws);
// Constructor initiated instantiation
var createdFoo = new Foo();
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js_backend/custom_elements_analysis.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698