Test cache size

This commit is contained in:
ahocevar
2019-02-21 01:35:40 +01:00
parent d06d00ccbb
commit 4166c80c6e

View File

@@ -59,6 +59,10 @@ describe('ol.source.Tile', function() {
expect(source).to.be.a(Source);
expect(source).to.be.a(TileSource);
});
it('sets a screen dependent cache size', function() {
const source = new TileSource({});
expect(source.tileCache.highWaterMark).to.be(4 * Math.ceil(screen.availWidth / 256) * Math.ceil(screen.availHeight / 256));
});
it('sets a custom cache size', function() {
const projection = getProjection('EPSG:4326');
const source = new TileSource({