Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Adding canvas test. #53

Open
wants to merge 1 commit into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 10, 2012
  1. @mattwkelly

    Adding canvas test.

    mattwkelly authored
This page is out of date. Refresh to see the latest.
Showing with 26 additions and 0 deletions.
  1. +4 −0 tests/canvas/config.yml
  2. +22 −0 tests/canvas/test.js
View
4 tests/canvas/config.yml
@@ -0,0 +1,4 @@
+---
+ r: 0
+ spec: "http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html"
+ title: "Canvas"
View
22 tests/canvas/test.js
@@ -0,0 +1,22 @@
+test("Canvas", function() {
+ var canvas = document.createElement("canvas");
+
+ assert( "getContext" in canvas, "canvas getContext supported" );
+ assert( "toDataURL" in canvas, "canvas toDataURL supported" );
+});
+
+test("Canvas 2D Context", function() {
+ var CanvasRenderingContext2D = window.CanvasRenderingContext2D,
+ canvas = document.createElement("canvas"),
+ context = canvas.getContext("2d");
+
+ assert( !!CanvasRenderingContext2D, "CanvasRenderingContext2D supported" );
+ assert( context instanceof CanvasRenderingContext2D, "context instanceof CanvasRenderingContext2D" );
+});
+
+test("Canvas 2D Text", function() {
+ var canvas = document.createElement("canvas"),
+ context = canvas.getContext("2d");
+
+ assert( !!context.fillText, "2D Text supported" );
+});
Something went wrong with that request. Please try again.