Browse Source

Added textAlign left test

v1.x
Tj Holowaychuk 14 years ago
parent
commit
0cf50e0bb5
  1. 32
      test/canvas.test.js

32
test/canvas.test.js

@ -747,10 +747,10 @@ module.exports = {
, 'Context2d#strokeText()');
},
'test Context2d#textAlign= left': function(assert){
'test Context2d#textAlign= right': function(assert){
var canvas = new Canvas(200, 200)
, ctx = canvas.getContext('2d')
, path = __dirname + '/images/textAlign-left.png';
, path = __dirname + '/images/textAlign-right.png';
ctx.strokeRect(0,0,200,200);
ctx.lineTo(0,100);
@ -770,7 +770,7 @@ module.exports = {
canvas
, path
, 'cde33254c5c6de39e1a549edcb23d93e'
, 'Context2d#textAlign= left failed');
, 'Context2d#textAlign= right failed');
},
'test Context2d#textAlign= center': function(assert){
@ -799,6 +799,32 @@ module.exports = {
, 'Context2d#textAlign= center failed');
},
'test Context2d#textAlign= left': function(assert){
var canvas = new Canvas(200, 200)
, ctx = canvas.getContext('2d')
, path = __dirname + '/images/textAlign-left.png';
ctx.strokeRect(0,0,200,200);
ctx.lineTo(0,100);
ctx.lineTo(200,100);
ctx.stroke();
ctx.beginPath();
ctx.lineTo(100,0);
ctx.lineTo(100,200);
ctx.stroke();
ctx.font = 'normal 20px Arial';
ctx.textAlign = 'left';
ctx.fillText("Wahoo", 100, 100);
assertChecksum(
canvas
, path
, 'f22146910b2df4b96550611f45dda77a'
, 'Context2d#textAlign= left failed');
},
'test Context2d#measureText()': function(assert){
var canvas = new Canvas(200, 200)
, ctx = canvas.getContext('2d');

Loading…
Cancel
Save