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

Unified Diff: tests/html/document_test.dart

Issue 11846003: Adding supported checks for getCssCanvasContext. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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') | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/document_test.dart
diff --git a/tests/html/document_test.dart b/tests/html/document_test.dart
index eb5d36398fe9e39928d31080a408c6db57fb2ccf..fece53edeb88ec190262a1557e2db16633a76591 100644
--- a/tests/html/document_test.dart
+++ b/tests/html/document_test.dart
@@ -13,12 +13,31 @@ main() {
var isUnknownElement =
predicate((x) => x is UnknownElement, 'is UnknownElement');
+ test('CreateElement', () {
+ // FIXME: nifty way crashes, do it boring way.
+ expect(new Element.tag('span'), isElement);
+ expect(new Element.tag('div'), isDivElement);
+ expect(new Element.tag('a'), isAnchorElement);
+ expect(new Element.tag('bad_name'), isUnknownElement);
+ });
+
+ group('supports_cssCanvasContext', () {
+ test('supports_cssCanvasContext', () {
+ expect(HtmlDocument.supportsCssCanvasContext, true);
+ });
+ });
+
group('getCssCanvasContext', () {
test('getCssCanvasContext 2d', () {
- var context = document.getCssCanvasContext('2d', 'testContext', 10, 20);
- expect(context is CanvasRenderingContext2D, true);
- expect(context.canvas.width, 10);
- expect(context.canvas.height, 20);
+ var expectation = HtmlDocument.supportsCssCanvasContext ?
+ returnsNormally : throws;
+
+ expect(() {
+ var context = document.getCssCanvasContext('2d', 'testContext', 10, 20);
+ expect(context is CanvasRenderingContext2D, true);
+ expect(context.canvas.width, 10);
+ expect(context.canvas.height, 20);
+ }, expectation);
});
});
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698