Setup a loaded image with src for TileLayer test
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user