[ol.Tile] add ol.Tile.createConstructor and set width and height to the img archetype
This commit is contained in:
@@ -2,17 +2,18 @@ describe('ol.TileCache', function() {
|
||||
|
||||
describe('exceed the cache capacity', function() {
|
||||
|
||||
var tilecache, tile;
|
||||
var Tile, tilecache, tile;
|
||||
|
||||
beforeEach(function() {
|
||||
Tile = ol.Tile.createConstructor(200, 200);
|
||||
tilecache = new ol.TileCache(1);
|
||||
tile = new ol.Tile('url1');
|
||||
tile = new Tile('url1');
|
||||
tilecache.set('url1', tile);
|
||||
spyOn(tile, 'destroy');
|
||||
});
|
||||
|
||||
it('calls tile.destroy', function() {
|
||||
tilecache.set('url2', new ol.Tile('url2'));
|
||||
tilecache.set('url2', new Tile('url2'));
|
||||
expect(tile.destroy).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user