@@ -3,6 +3,19 @@ goog.provide('ol.test.source.TileJSON');
|
||||
|
||||
describe('ol.source.TileJSON', function() {
|
||||
|
||||
describe('#getState', function() {
|
||||
it('returns ol.source.State.ERROR on HTTP 404', function() {
|
||||
var changeSpy = sinon.spy(function(event) {
|
||||
expect(event.target.getState()).to.eql('error');
|
||||
});
|
||||
var source = new ol.source.TileJSON({
|
||||
url: 'invalid.jsonp'
|
||||
});
|
||||
goog.events.listen(source, 'change', changeSpy);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('tileUrlFunction', function() {
|
||||
|
||||
var source, tileGrid;
|
||||
@@ -74,5 +87,7 @@ describe('ol.source.TileJSON', function() {
|
||||
|
||||
});
|
||||
|
||||
goog.require('goog.events');
|
||||
goog.require('goog.net.Jsonp');
|
||||
goog.require('ol.source.State');
|
||||
goog.require('ol.source.TileJSON');
|
||||
|
||||
Reference in New Issue
Block a user