diff --git a/test/public/star.png b/test/public/star.png new file mode 100644 index 0000000..2ae3b4d Binary files /dev/null and b/test/public/star.png differ diff --git a/test/public/tests.js b/test/public/tests.js index 0b18c13..19b15cf 100644 --- a/test/public/tests.js +++ b/test/public/tests.js @@ -1510,6 +1510,20 @@ tests['shadow strokeText()'] = function(ctx){ ctx.strokeText("Shadow", 100, 100); }; +tests['shadow image'] = function(ctx, done){ + var img = new Image; + img.onload = function(){ + ctx.shadowColor = '#f3ac22'; + ctx.shadowBlur = 2; + ctx.shadowOffsetX = 8; + ctx.shadowOffsetY = 8; + ctx.drawImage(img, 0, 0); + done(); + }; + img.onerror = function(){} + img.src = 'star.png'; +}; + tests['shadow integration'] = function(ctx){ ctx.shadowBlur = 5; ctx.shadowOffsetX = 10; diff --git a/test/server.js b/test/server.js index 3e8c21f..19e2350 100644 --- a/test/server.js +++ b/test/server.js @@ -33,7 +33,8 @@ function testFn(req){ // no good way around this at the moment req.body.fn = req.body.fn .replace("'state.png'", "'" + __dirname + "/public/state.png'") - .replace("'face.jpeg'", "'" + __dirname + "/public/face.jpeg'"); + .replace("'face.jpeg'", "'" + __dirname + "/public/face.jpeg'") + .replace("'star.png'", "'" + __dirname + "/public/star.png'"); // Do not try this at home :) return eval('(' + req.body.fn + ')');