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

Unified Diff: tests/html/document_test.dart

Issue 11823035: 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 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);
+
});
});
}
« 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