Browse Source

Added test for createImageData(ImageData)

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

10
test/canvas.test.js

@ -315,6 +315,16 @@ module.exports = {
assert.equal(2 * 6 * 4, imageData.data.length);
},
'test Context2d#createImageData(ImageData)': function(assert){
var canvas = new Canvas(20, 20)
, ctx = canvas.getContext('2d');
var imageData = ctx.createImageData(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