Fix WebGLTile browser tests

The loader has to return a TypedArray, not ImageData
This commit is contained in:
Maximilian Krög
2022-05-15 07:38:16 +02:00
parent 744324859e
commit 302a9d51e1
+11 -11
View File
@@ -21,7 +21,7 @@ describe('ol/layer/WebGLTile', function () {
source: new DataTileSource({ source: new DataTileSource({
loader(z, x, y) { loader(z, x, y) {
return new Promise((resolve) => { return new Promise((resolve) => {
resolve(new ImageData(256, 256)); resolve(new ImageData(256, 256).data);
}); });
}, },
}), }),
@@ -278,15 +278,15 @@ describe('ol/layer/WebGLTile', function () {
attribute vec2 a_textureCoord; attribute vec2 a_textureCoord;
uniform mat4 u_tileTransform; uniform mat4 u_tileTransform;
uniform float u_texturePixelWidth; uniform float u_texturePixelWidth;
uniform float u_texturePixelHeight; uniform float u_texturePixelHeight;
uniform float u_textureResolution; uniform float u_textureResolution;
uniform float u_textureOriginX; uniform float u_textureOriginX;
uniform float u_textureOriginY; uniform float u_textureOriginY;
uniform float u_depth; uniform float u_depth;
varying vec2 v_textureCoord; varying vec2 v_textureCoord;
varying vec2 v_mapCoord; varying vec2 v_mapCoord;
void main() { void main() {
v_textureCoord = a_textureCoord; v_textureCoord = a_textureCoord;
@@ -419,7 +419,7 @@ describe('ol/layer/WebGLTile', function () {
source: new DataTileSource({ source: new DataTileSource({
loader(z, x, y) { loader(z, x, y) {
return new Promise((resolve) => { return new Promise((resolve) => {
resolve(new ImageData(256, 256)); resolve(new ImageData(256, 256).data);
}); });
}, },
}), }),
@@ -434,7 +434,7 @@ describe('ol/layer/WebGLTile', function () {
source: new DataTileSource({ source: new DataTileSource({
loader(z, x, y) { loader(z, x, y) {
return new Promise((resolve) => { return new Promise((resolve) => {
resolve(new ImageData(256, 256)); resolve(new ImageData(256, 256).data);
}); });
}, },
}), }),
@@ -450,7 +450,7 @@ describe('ol/layer/WebGLTile', function () {
source: new DataTileSource({ source: new DataTileSource({
loader(z, x, y) { loader(z, x, y) {
return new Promise((resolve) => { return new Promise((resolve) => {
resolve(new ImageData(256, 256)); resolve(new ImageData(256, 256).data);
}); });
}, },
}), }),
@@ -589,7 +589,7 @@ describe('ol/layer/WebGLTile', function () {
sourceless.setSource( sourceless.setSource(
new DataTileSource({ new DataTileSource({
loader(z, x, y) { loader(z, x, y) {
return new ImageData(256, 256); return new ImageData(256, 256).data;
}, },
}) })
); );