Merge pull request #5994 from marcjansen/fix-component-no-available-5993

Setup a loaded image with src for TileLayer test
This commit is contained in:
Marc Jansen
2016-10-19 10:50:32 +02:00
committed by GitHub

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