Merge pull request #7165 from tschaub/test-fixes
More assorted test fixes
This commit is contained in:
@@ -4,9 +4,9 @@ goog.require('ol');
|
|||||||
goog.require('ol.AssertionError');
|
goog.require('ol.AssertionError');
|
||||||
|
|
||||||
describe('ol.AssertionError', function() {
|
describe('ol.AssertionError', function() {
|
||||||
it('generates a message', function() {
|
it('generates an error', function() {
|
||||||
var error = new ol.AssertionError(42);
|
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() {
|
it('generates a message with a versioned url', function() {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ describe('ol.style.IconImageCache', function() {
|
|||||||
expect(cache.cacheSize_).to.eql(4);
|
expect(cache.cacheSize_).to.eql(4);
|
||||||
|
|
||||||
src = '4';
|
src = '4';
|
||||||
iconImage = new ol.style.IconImage(src, null);
|
iconImage = new ol.style.IconImage(null, src);
|
||||||
cache.set(src, null, null, iconImage);
|
cache.set(src, null, null, iconImage);
|
||||||
expect(cache.cacheSize_).to.eql(5);
|
expect(cache.cacheSize_).to.eql(5);
|
||||||
|
|
||||||
@@ -47,14 +47,14 @@ describe('ol.style.IconImageCache', function() {
|
|||||||
expect(cache.cacheSize_).to.eql(3);
|
expect(cache.cacheSize_).to.eql(3);
|
||||||
|
|
||||||
src = '0';
|
src = '0';
|
||||||
iconImage = new ol.style.IconImage(src, null);
|
iconImage = new ol.style.IconImage(null, src);
|
||||||
ol.events.listen(iconImage, 'change',
|
ol.events.listen(iconImage, 'change',
|
||||||
ol.nullFunction, false);
|
ol.nullFunction, false);
|
||||||
cache.set(src, null, null, iconImage);
|
cache.set(src, null, null, iconImage);
|
||||||
expect(cache.cacheSize_).to.eql(4);
|
expect(cache.cacheSize_).to.eql(4);
|
||||||
|
|
||||||
src = '4';
|
src = '4';
|
||||||
iconImage = new ol.style.IconImage(src, null);
|
iconImage = new ol.style.IconImage(null, src);
|
||||||
ol.events.listen(iconImage, 'change',
|
ol.events.listen(iconImage, 'change',
|
||||||
ol.nullFunction, false);
|
ol.nullFunction, false);
|
||||||
cache.set(src, null, null, iconImage);
|
cache.set(src, null, null, iconImage);
|
||||||
|
|||||||
@@ -26,8 +26,12 @@ describe('ol.TileQueue', function() {
|
|||||||
++tileId;
|
++tileId;
|
||||||
var tileCoord = [tileId, tileId, tileId];
|
var tileCoord = [tileId, tileId, tileId];
|
||||||
var state = 0; // IDLE
|
var state = 0; // IDLE
|
||||||
var src = 'data:image/gif;base64,R0lGODlhAQABAPAAAP8AAP///' +
|
// The tile queue requires a unique URI for each item added.
|
||||||
'yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==#' + tileId;
|
// 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 ?
|
var tileLoadFunction = opt_tileLoadFunction ?
|
||||||
opt_tileLoadFunction : ol.source.Image.defaultImageLoadFunction;
|
opt_tileLoadFunction : ol.source.Image.defaultImageLoadFunction;
|
||||||
|
|||||||
Reference in New Issue
Block a user