From d6841e6d9d75eccff3f43d63aba3de5ccbad8b20 Mon Sep 17 00:00:00 2001 From: tsauerwein Date: Mon, 24 Nov 2014 13:26:45 +0100 Subject: [PATCH] Fix tests for when not run with WebGL support --- src/ol/style/atlasmanager.js | 2 +- src/ol/style/regularshapestyle.js | 2 +- src/ol/webgl/context.js | 1 + test/spec/ol/style/atlasmanager.test.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ol/style/atlasmanager.js b/src/ol/style/atlasmanager.js index f300ee0cce..f53ccb3c24 100644 --- a/src/ol/style/atlasmanager.js +++ b/src/ol/style/atlasmanager.js @@ -30,7 +30,7 @@ ol.style.AtlasManagerInfo; * atlas. After that, when new atlases are created, they will have * 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. * * @constructor diff --git a/src/ol/style/regularshapestyle.js b/src/ol/style/regularshapestyle.js index 9eb5864ade..823ef86629 100644 --- a/src/ol/style/regularshapestyle.js +++ b/src/ol/style/regularshapestyle.js @@ -322,7 +322,7 @@ ol.style.RegularShape.prototype.render_ = function(atlasManager) { var info = atlasManager.add( id, size, size, goog.bind(this.draw_, this, renderOptions), 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.origin_ = [info.offsetX, info.offsetY]; diff --git a/src/ol/webgl/context.js b/src/ol/webgl/context.js index 50403e2341..6b91f6c2a7 100644 --- a/src/ol/webgl/context.js +++ b/src/ol/webgl/context.js @@ -5,6 +5,7 @@ goog.require('goog.asserts'); goog.require('goog.events'); goog.require('goog.log'); goog.require('goog.object'); +goog.require('ol'); goog.require('ol.webgl.Buffer'); goog.require('ol.webgl.WebGLContextEventType'); diff --git a/test/spec/ol/style/atlasmanager.test.js b/test/spec/ol/style/atlasmanager.test.js index 69c414ba07..3e28fd8e4d 100644 --- a/test/spec/ol/style/atlasmanager.test.js +++ b/test/spec/ol/style/atlasmanager.test.js @@ -251,7 +251,7 @@ describe('ol.style.AtlasManager', 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)) .to.be.ok(); expect(manager.add('2', 2048, 2048, defaultRender, defaultRender))