|
@ -53,6 +53,24 @@ module.exports = { |
|
|
img.src = png + 's'; |
|
|
img.src = png + 's'; |
|
|
assert.equal(img.src, png + 's'); |
|
|
assert.equal(img.src, png + 's'); |
|
|
|
|
|
|
|
|
|
|
|
beforeExit(function(){ |
|
|
|
|
|
assert.equal(1, n); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
'test Image#{width,height}': function(assert, beforeExit){ |
|
|
|
|
|
var img = new Image |
|
|
|
|
|
, n = 0; |
|
|
|
|
|
|
|
|
|
|
|
assert.strictEqual(0, img.width); |
|
|
|
|
|
assert.strictEqual(0, img.height); |
|
|
|
|
|
img.onload = function(){ |
|
|
|
|
|
++n; |
|
|
|
|
|
assert.strictEqual(150, img.width); |
|
|
|
|
|
assert.strictEqual(150, img.height); |
|
|
|
|
|
}; |
|
|
|
|
|
img.src = png; |
|
|
|
|
|
|
|
|
beforeExit(function(){ |
|
|
beforeExit(function(){ |
|
|
assert.equal(1, n); |
|
|
assert.equal(1, n); |
|
|
}); |
|
|
}); |
|
|