Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
HARP-13329: Add IBCT tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
atomicsulfate committed Dec 16, 2020
1 parent bdae956 commit d6259f4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion test/rendering/WebTileDataRendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Licensed under Apache 2.0, see full license in LICENSE
* SPDX-License-Identifier: Apache-2.0
*/
import { Projection, sphereProjection } from "@here/harp-geoutils";
import {
CopyrightInfo,
LookAtParams,
Expand All @@ -28,6 +29,7 @@ describe("MapView + WebTileData rendering test", function() {
interface WebTileTestOptions {
mochaTest: Mocha.Context;
testImageName: string;
projection?: Projection;
getTexture: (tile: Tile) => Promise<[THREE.Texture, CopyrightInfo[]]>;
lookAt?: Partial<LookAtParams>;
webTileOptions?: Partial<WebTileDataSourceOptions>;
Expand All @@ -44,7 +46,8 @@ describe("MapView + WebTileData rendering test", function() {
canvas,
theme: {},
preserveDrawingBuffer: true,
pixelRatio: 1
pixelRatio: 1,
projection: options.projection
});

const defaultLookAt: Partial<LookAtParams> = {
Expand Down Expand Up @@ -282,4 +285,38 @@ describe("MapView + WebTileData rendering test", function() {
runBeforeFinish
});
});

it("renders webtiles on antimeridian without cracks for planar projection", async function() {
this.timeout(5000);

await webTileTest({
mochaTest: this,
testImageName: "webtile-antimeridan-planar",
getTexture: (tile: Tile) => {
return Promise.all([new TextureLoader().load("../dist/resources/sea.png"), []]);
},
lookAt: {
target: { lat: 64, lng: 180 },
zoomLevel: 20
}
});
});

it("renders webtiles on antimeridian without cracks for sphere projection", async function() {
// To be fixed.
this.timeout(5000);

await webTileTest({
mochaTest: this,
testImageName: "webtile-antimeridan-sphere",
getTexture: (tile: Tile) => {
return Promise.all([new TextureLoader().load("../dist/resources/sea.png"), []]);
},
lookAt: {
target: { lat: 64, lng: 180 },
zoomLevel: 20
},
projection: sphereProjection
});
});
});
Binary file added test/resources/sea.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d6259f4

Please sign in to comment.