Add test for initializing Zoomify source with custom tile size.

This commit is contained in:
Lasse Laakkonen
2017-10-19 17:54:46 +03:00
parent e41693816a
commit b8589acc6e

View File

@@ -1,5 +1,6 @@
goog.require('ol');
goog.require('ol.dom');
goog.require('ol.events');
goog.require('ol.proj.Projection');
@@ -30,6 +31,13 @@ describe('ol.source.Zoomify', function() {
size: size
});
}
function getZoomifySourceWith1024pxTiles() {
return new ol.source.Zoomify({
url: zoomifyUrl,
size: size,
tileSize: 1024
});
}
describe('constructor', function() {
@@ -148,6 +156,14 @@ describe('ol.source.Zoomify', function() {
}
});
it('has expected tileSize', function() {
var sources = [getZoomifySource(), getZoomifySourceWith1024pxTiles()];
var expectedTileSizes = [ol.DEFAULT_TILE_SIZE, 1024];
for (var i = 0; i < sources.length; i++) {
var tileGrid = sources[i].getTileGrid();
expect(tileGrid.getTileSize()).to.eql(expectedTileSizes[i]);
}
});
});
describe('tierSizeCalculation configuration', function() {