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

Unified Diff: tests/html/custom_elements_test.dart

Issue 23189009: Modify custom elements to inherit from HtmlElement (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Regenerate dart:html Created 7 years, 4 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 | « sdk/lib/html/dartium/html_dartium.dart ('k') | 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_elements_test.dart
diff --git a/tests/html/custom_elements_test.dart b/tests/html/custom_elements_test.dart
index 7f53e029ecff5379f3dee0b335e9e2f8c04493ad..44257c9028b1b3ce9517e69fe60fae5060176288 100644
--- a/tests/html/custom_elements_test.dart
+++ b/tests/html/custom_elements_test.dart
@@ -7,7 +7,7 @@ import '../../pkg/unittest/lib/unittest.dart';
import '../../pkg/unittest/lib/html_individual_config.dart';
import 'dart:html';
-class CustomType extends Element {
+class CustomType extends HtmlElement {
factory CustomType() => null;
bool onCreatedCalled; // = false;
void onCreated() {
@@ -112,15 +112,27 @@ main() {
expect(queried is CustomType, isTrue);
expect(queried.onCreatedCalled, isTrue);
});
+
+ test('query id', () {
+ document.register('x-type9', CustomType);
+ var element = new DivElement();
+ element.innerHtml = '<x-type9 id="someid"></x-type9>';
+ document.body.nodes.add(element);
+ var queried = query('#someid');
+
+ expect(queried, isNotNull);
+ expect(queried is CustomType, isTrue);
+ expect(queried.id, "someid");
+ });
});
group('lifecycle', () {
test('onCreated', () {
int oldCount = customCreatedCount;
- document.register('x-type9', CustomType);
+ document.register('x-type10', CustomType);
var element = new DivElement();
- element.innerHtml = '<x-type9></x-type9>';
+ element.innerHtml = '<x-type10></x-type10>';
document.body.nodes.add(element);
expect(customCreatedCount, oldCount + 1);
});
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/src/native_DOMImplementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698