From 77c2a40c76766034680531e475a7f5d360bfad8d Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Tue, 2 Nov 2010 13:28:45 -0700 Subject: [PATCH] Added textAlign left test --- test/canvas.test.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/canvas.test.js b/test/canvas.test.js index d6fbc9d..fa93973 100644 --- a/test/canvas.test.js +++ b/test/canvas.test.js @@ -747,6 +747,32 @@ module.exports = { , 'Context2d#strokeText()'); }, + '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 = 'right'; + ctx.fillText("Wahoo", 100, 100); + + assertChecksum( + canvas + , path + , 'cde33254c5c6de39e1a549edcb23d93e' + , 'Context2d#textAlign= left failed'); + }, + 'test Context2d#measureText()': function(assert){ var canvas = new Canvas(200, 200) , ctx = canvas.getContext('2d');