From 2c00a3cad8f646360e28b4a482428a094330724b Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Mon, 15 Nov 2010 20:40:19 -0800 Subject: [PATCH] Added test for createImageData(w,h) --- test/canvas.test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/canvas.test.js b/test/canvas.test.js index 2ea0c18..e715812 100644 --- a/test/canvas.test.js +++ b/test/canvas.test.js @@ -305,6 +305,16 @@ module.exports = { }); }, + 'test Context2d#createImageData(width, height)': function(assert){ + var canvas = new Canvas(20, 20) + , ctx = canvas.getContext('2d'); + + var imageData = ctx.createImageData(2,6); + assert.equal(2, imageData.width); + assert.equal(6, imageData.height); + assert.equal(2 * 6 * 4, imageData.data.length); + }, + 'test Context2d#getImageData()': function(assert){ var canvas = new Canvas(3, 6) , ctx = canvas.getContext('2d');