Index: tests/html/document_test.dart |
diff --git a/tests/html/document_test.dart b/tests/html/document_test.dart |
index 2f44c2f1e0d076d1378df77447836e1562e0314b..0c6ca43e8788f3779ad9c5eebf9c7ebe8a2392a8 100644 |
--- a/tests/html/document_test.dart |
+++ b/tests/html/document_test.dart |
@@ -21,12 +21,24 @@ main() { |
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); |
+ |
}); |
}); |
} |