From 489700330f87d96136d20c6d755544078d2e0799 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Thu, 30 Sep 2010 11:06:16 -0700 Subject: [PATCH] Added globalAlpha test --- test/canvas.test.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/canvas.test.js b/test/canvas.test.js index a203a00..52266d4 100644 --- a/test/canvas.test.js +++ b/test/canvas.test.js @@ -339,5 +339,25 @@ module.exports = { , path , 'fc8bbf2cf6ae2d85fcf526103200e844' , 'Context2d#save() / resetore() failed'); + }, + + 'test Context2d#globalAlpha=': function(assert){ + var canvas = new Canvas(200, 200) + , ctx = canvas.getContext('2d') + , path = __dirname + '/images/globalAlpha.png'; + + ctx.fillRect(0,0,50,50); + ctx.translate(15,15); + ctx.globalAlpha = 0.6; + ctx.fillStyle = 'red'; + ctx.fillRect(0,0,20,20); + ctx.fillStyle = 'yellow'; + ctx.fillRect(0,0,10,10); + + assertChecksum( + canvas + , path + , 'd8365233f2beb420ba18ff78dc6d7405' + , 'Context2d#globalAlpha= failed'); } } \ No newline at end of file