Setup a loaded image with src for TileLayer test

This commit is contained in:
Marc Jansen
2016-10-19 09:56:16 +02:00
parent b89eb77f20
commit 2c200dcf5f

View File

@@ -8,6 +8,18 @@ goog.require('ol.source.XYZ');
describe('ol.renderer.canvas.TileLayer', function() {
var img = null;
beforeEach(function(done) {
img = new Image(1, 1);
img.onload = function() {
done();
};
img.src = 'data:image/gif;base64,' +
'R0lGODlhAQABAPAAAP8AAP///yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';
});
afterEach(function() {
img = null;
});
describe('#composeFrame()', function() {
it('uses correct draw scale when rotating (HiDPI)', function() {
@@ -45,7 +57,7 @@ describe('ol.renderer.canvas.TileLayer', function() {
return [0, 0, 0];
},
getImage: function() {
return new Image();
return img;
}
}];
renderer.composeFrame(frameState, layerState, context);