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

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

Issue 29033003: Fixing custom element type extensions in Dartium to have correct native type ID (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 | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/scripts/systemnative.py » ('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 5acba993974d642a42a683e20cf0c9c875f3919d..10b06ef00baaa2a538692183bcc6a5141c57f6af 100644
--- a/tests/html/custom/document_register_type_extensions_test.dart
+++ b/tests/html/custom/document_register_type_extensions_test.dart
@@ -45,6 +45,26 @@ class FooBad extends DivElement {
FooBad.created() : super.created();
}
+class MyCanvas extends CanvasElement {
+ static const tag = 'my-canvas';
+ factory MyCanvas() => new Element.tag('canvas', tag);
+
+ MyCanvas.created() : super.created();
+
+ void fillAsRed() {
+ width = 100;
+ height = 100;
+
+ var context = this.getContext('2d');
+ context.fillStyle = 'red';
+ context.fillRect(0, 0, width, height);
+ context.fill();
+
+ var data = context.getImageData(0, 0, 1, 1).data;
+ expect(data, [255, 0, 0, 255]);
+ }
+}
+
main() {
useHtmlIndividualConfiguration();
@@ -68,6 +88,7 @@ main() {
document.register(Bar.tag, Bar, extendsTag: 'input');
document.register(Baz.tag, Baz);
document.register(Qux.tag, Qux, extendsTag: 'input');
+ document.register(MyCanvas.tag, MyCanvas, extendsTag: 'canvas');
}
setUp(loadPolyfills);
@@ -267,4 +288,13 @@ main() {
expect(divBarParsed is DivElement, isTrue);
});
});
+
+ group('functional', () {
+ setUp(registerTypes);
+
+ test('canvas', () {
+ var canvas = new MyCanvas();
+ canvas.fillAsRed();
+ });
+ });
}
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/scripts/systemnative.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698