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

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

Issue 30283002: Adding validation that Custom element constructor has zero args (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/created_callback_test.dart
diff --git a/tests/html/custom/created_callback_test.dart b/tests/html/custom/created_callback_test.dart
index 1ca50fdf24a2e9ff700c6ad869eb71110dcd536e..a7fc2ee5fabe39aff4a61e025c6cd351a4735f81 100644
--- a/tests/html/custom/created_callback_test.dart
+++ b/tests/html/custom/created_callback_test.dart
@@ -147,6 +147,12 @@ main() {
expect(e is ErrorConstructorElement, isFalse);
});
+ test('cannot register created with params', () {
+ expect(() {
+ document.register('x-created-with-params', CreatedWithParametersElement);
+ }, throws);
+ });
+
test('created cannot be called from nested constructor',
NestedCreatedConstructorElement.test);
@@ -273,6 +279,10 @@ class NestedCreatedConstructorElement extends HtmlElement {
}
}
+class CreatedWithParametersElement extends HtmlElement {
+ CreatedWithParametersElement.created(ignoredParam) : super.created();
+}
+
void expectGlobalError(Function test) {
js.context['testExpectsGlobalError'] = true;
try {
« 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