Skip to content

Commit

Permalink
'tst
Browse files Browse the repository at this point in the history
  • Loading branch information
ftoromanoff committed Mar 13, 2024
1 parent 1b21ce6 commit 22dcc38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/Provider/Fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down Expand Up @@ -136,9 +137,9 @@ export default {
* @return {Promise<THREE.DataTexture>} 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;
Expand Down
6 changes: 3 additions & 3 deletions test/unit/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 22dcc38

Please sign in to comment.