Index: tests/html/custom/document_register_type_extensions_test.dart |
diff --git a/tests/html/custom/document_register_type_extensions_test.dart b/tests/html/custom/document_register_type_extensions_test.dart |
index 77dc26f74c36091b1569afac647df852546b9ad7..9ce14e677e796a299a27b864ad7c267d4f31c7c6 100644 |
--- a/tests/html/custom/document_register_type_extensions_test.dart |
+++ b/tests/html/custom/document_register_type_extensions_test.dart |
@@ -65,6 +65,15 @@ class MyCanvas extends CanvasElement { |
} |
} |
+class CustomDiv extends DivElement { |
+ CustomDiv.created() : super.created(); |
+} |
+ |
+class CustomCustomDiv extends CustomDiv { |
+ static const tag = 'custom-custom'; |
+ CustomCustomDiv.created() : super.created(); |
+} |
+ |
main() { |
useHtmlIndividualConfiguration(); |
@@ -89,6 +98,7 @@ main() { |
document.register(Baz.tag, Baz); |
document.register(Qux.tag, Qux, extendsTag: 'input'); |
document.register(MyCanvas.tag, MyCanvas, extendsTag: 'canvas'); |
+ document.register(CustomCustomDiv.tag, CustomCustomDiv, extendsTag: 'div'); |
} |
setUp(loadPolyfills); |
@@ -97,7 +107,8 @@ main() { |
setUp(registerTypes); |
test('cannot register twice', () { |
- expect(() => document.register(FooBad.tag, Foo), throws); |
+ expect(() => document.register(FooBad.tag, Foo, extendsTag: 'div'), |
+ throws); |
}); |
test('cannot register for non-matching tag', () { |
@@ -105,6 +116,12 @@ main() { |
document.register('x-input-div', Bar, extendsTag: 'div'); |
}, throws); |
}); |
+ |
+ test('cannot register type extension for custom tag', () { |
+ expect(() { |
+ document.register('x-custom-tag', CustomCustomDiv); |
+ }, throws); |
+ }); |
}); |
group('construction', () { |