diff --git a/src/Provider/Fetcher.js b/src/Provider/Fetcher.js index f71f47030f..cc5dcaea55 100644 --- a/src/Provider/Fetcher.js +++ b/src/Provider/Fetcher.js @@ -11,6 +11,7 @@ function checkResponse(response) { } const arrayBuffer = (url, options = {}) => fetch(url, options).then((response) => { + console.warn('2-arrayBuffer.then'); checkResponse(response); return response.arrayBuffer(); }); @@ -136,9 +137,9 @@ export default { * @return {Promise} Promise containing the DataTexture. */ textureFloat(url, options = {}) { - console.warn('textureFloat'); + console.warn('1-Fetcher.textureFloat', url); return arrayBuffer(url, options).then((buffer) => { - console.warn('arrayBuffer.then'); + console.warn('3-arrayBuffer.then => buffer'); const floatArray = new Float32Array(buffer); const texture = getTextureFloat(floatArray, options.isWebGL2); return texture; diff --git a/test/unit/fetcher.js b/test/unit/fetcher.js index e6044d340c..81c9f8e4bc 100644 --- a/test/unit/fetcher.js +++ b/test/unit/fetcher.js @@ -104,21 +104,21 @@ describe('Fetcher', function () { 'LAYER=ELEVATION.ELEVATIONGRIDCOVERAGE.SRTM3&FORMAT=image/x-bil;bits=32' + '&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&STYLE=normal&' + 'TILEMATRIXSET=WGS84G&TILEMATRIX=3&TILEROW=2&TILECOL=8'; - console.warn(url); it('should get a WebGl2 texture float', (done) => { Fetcher.textureFloat(url, networkOptions) .then((texture) => { - console.warn('texture'); + console.warn('4a-Fetcher.textureFloat.then => texture'); assert.ok(texture instanceof DataTexture); assert.equal(texture.internalFormat, 'R32F'); assert.equal(texture.version, 1); done(); }) .catch(done); - }).timeout(5000); + }).timeout(50000); it('should get a texture float (without WebGL2)', (done) => { Fetcher.textureFloat(url, { ...networkOptions, isWebGL2: false }) .then((texture) => { + console.warn('4b-Fetcher.textureFloat.then => texture'); assert.ok(texture instanceof DataTexture); assert.equal(texture.internalFormat, null); done();