Browse Source

Added test for createImageData(w,h)

v1.x
Tj Holowaychuk 14 years ago
parent
commit
2c00a3cad8
  1. 10
      test/canvas.test.js

10
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');

Loading…
Cancel
Save