7 testRunner
.dumpAsText();
9 canvas
= document
.createElement("canvas");
10 document
.body
.appendChild(canvas
);
13 ctx
= canvas
.getContext("2d");
15 ctx
.arc(25, 25, 25, Math
.PI
, 500*Math
.PI
, false);
19 ctx
.arc(75, 75, 25, 500*Math
.PI
, Math
.PI
, true);
20 ctx
.fillStyle
= '#0f0';
23 var result
= document
.getElementById("result");
26 checkPixel(25, 25, 0, 255, 0, 255);
27 checkPixel(75, 75, 0, 255, 0, 255);
28 if (passed
) result
.innerHTML
= "PASSED";
30 function checkPixel(x
, y
, r
, g
, b
, a
) {
31 var data
= ctx
.getImageData(x
,y
,1,1).data
;
38 result
.innerHTML
+= "Red should be "+r
+", but was "+red
+". ";
42 result
.innerHTML
+= "green should be "+g
+", but was "+green
+". ";
46 result
.innerHTML
+= "blue should be "+b
+", but was "+blue
+". ";
50 result
.innerHTML
+= "alpha should be "+a
+", but was "+alpha
+". ";