From cab34cb220b25f9768d95373be28ec9128bb89f9 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sun, 20 Aug 2017 10:51:44 -0400 Subject: [PATCH 1/3] Avoid assertion about hardcoded "latest" url --- test/spec/ol/assertionerror.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/spec/ol/assertionerror.test.js b/test/spec/ol/assertionerror.test.js index dcf0bd4566..8b37f3a6a1 100644 --- a/test/spec/ol/assertionerror.test.js +++ b/test/spec/ol/assertionerror.test.js @@ -4,9 +4,9 @@ goog.require('ol'); goog.require('ol.AssertionError'); describe('ol.AssertionError', function() { - it('generates a message', function() { + it('generates an error', function() { var error = new ol.AssertionError(42); - expect(error.message).to.be('Assertion failed. See https://openlayers.org/en/latest/doc/errors/#42 for details.'); + expect(error).to.be.an(Error); }); it('generates a message with a versioned url', function() { From d23f000846cf128f3cbb6339258b0a62ab8044eb Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sun, 20 Aug 2017 11:02:49 -0400 Subject: [PATCH 2/3] Correctly create image icons in the tests --- test/spec/ol/style/iconimagecache.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/spec/ol/style/iconimagecache.test.js b/test/spec/ol/style/iconimagecache.test.js index a883f772ca..ef47345275 100644 --- a/test/spec/ol/style/iconimagecache.test.js +++ b/test/spec/ol/style/iconimagecache.test.js @@ -39,7 +39,7 @@ describe('ol.style.IconImageCache', function() { expect(cache.cacheSize_).to.eql(4); src = '4'; - iconImage = new ol.style.IconImage(src, null); + iconImage = new ol.style.IconImage(null, src); cache.set(src, null, null, iconImage); expect(cache.cacheSize_).to.eql(5); @@ -47,14 +47,14 @@ describe('ol.style.IconImageCache', function() { expect(cache.cacheSize_).to.eql(3); src = '0'; - iconImage = new ol.style.IconImage(src, null); + iconImage = new ol.style.IconImage(null, src); ol.events.listen(iconImage, 'change', ol.nullFunction, false); cache.set(src, null, null, iconImage); expect(cache.cacheSize_).to.eql(4); src = '4'; - iconImage = new ol.style.IconImage(src, null); + iconImage = new ol.style.IconImage(null, src); ol.events.listen(iconImage, 'change', ol.nullFunction, false); cache.set(src, null, null, iconImage); From da60dafd7f5e0edcdf7dc225fd1091a7b425e64a Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 21 Aug 2017 10:31:53 -0400 Subject: [PATCH 3/3] Valid and unique URI for images in the tile queue --- test/spec/ol/tilequeue.test.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/spec/ol/tilequeue.test.js b/test/spec/ol/tilequeue.test.js index 2e1ec1c1cb..5c01615663 100644 --- a/test/spec/ol/tilequeue.test.js +++ b/test/spec/ol/tilequeue.test.js @@ -26,8 +26,12 @@ describe('ol.TileQueue', function() { ++tileId; var tileCoord = [tileId, tileId, tileId]; var state = 0; // IDLE - var src = 'data:image/gif;base64,R0lGODlhAQABAPAAAP8AAP///' + - 'yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==#' + tileId; + // The tile queue requires a unique URI for each item added. + // Browsers still load the resource even if they don't understand + // the charset. So we create a unique URI by abusing the charset. + var src = 'data:image/gif;charset=junk-' + tileId + + ';base64,R0lGODlhAQABAPAAAP8AAP///' + + 'yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=='; var tileLoadFunction = opt_tileLoadFunction ? opt_tileLoadFunction : ol.source.Image.defaultImageLoadFunction;