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

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

Issue 32703006: Validating that types which require extendsTag actually provide it (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « no previous file | tools/dom/src/native_DOMImplementation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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', () {
« no previous file with comments | « no previous file | tools/dom/src/native_DOMImplementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698