Fix tests for when not run with WebGL support

This commit is contained in:
tsauerwein
2014-11-24 13:26:45 +01:00
parent b8b48afc82
commit d6841e6d9d
4 changed files with 4 additions and 3 deletions

View File

@@ -30,7 +30,7 @@ ol.style.AtlasManagerInfo;
* atlas. After that, when new atlases are created, they will have * atlas. After that, when new atlases are created, they will have
* twice the size as the latest atlas (until `maxSize` is reached). * twice the size as the latest atlas (until `maxSize` is reached).
* *
* If an application uses a lot, or a lot of large images, it is recommend to * If an application uses a lot, or a lot of large images, it is recommended to
* set a higher `size` value to avoid the creation of too many atlases. * set a higher `size` value to avoid the creation of too many atlases.
* *
* @constructor * @constructor

View File

@@ -322,7 +322,7 @@ ol.style.RegularShape.prototype.render_ = function(atlasManager) {
var info = atlasManager.add( var info = atlasManager.add(
id, size, size, goog.bind(this.draw_, this, renderOptions), id, size, size, goog.bind(this.draw_, this, renderOptions),
renderHitDetectionCallback); renderHitDetectionCallback);
goog.asserts.assert(info !== null, 'shape size is too large'); goog.asserts.assert(!goog.isNull(info), 'shape size is too large');
this.canvas_ = info.image; this.canvas_ = info.image;
this.origin_ = [info.offsetX, info.offsetY]; this.origin_ = [info.offsetX, info.offsetY];

View File

@@ -5,6 +5,7 @@ goog.require('goog.asserts');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.log'); goog.require('goog.log');
goog.require('goog.object'); goog.require('goog.object');
goog.require('ol');
goog.require('ol.webgl.Buffer'); goog.require('ol.webgl.Buffer');
goog.require('ol.webgl.WebGLContextEventType'); goog.require('ol.webgl.WebGLContextEventType');

View File

@@ -251,7 +251,7 @@ describe('ol.style.AtlasManager', function() {
}); });
it('returns null if the size exceeds the maximum size', function() { it('returns null if the size exceeds the maximum size', function() {
var manager = new ol.style.AtlasManager({size: 128}); var manager = new ol.style.AtlasManager({size: 128, maxSize: 2048});
expect(manager.add('1', 100, 100, defaultRender, defaultRender)) expect(manager.add('1', 100, 100, defaultRender, defaultRender))
.to.be.ok(); .to.be.ok();
expect(manager.add('2', 2048, 2048, defaultRender, defaultRender)) expect(manager.add('2', 2048, 2048, defaultRender, defaultRender))