Run rendering tests with the rest of the tests

This commit is contained in:
Tim Schaub
2017-07-03 13:53:01 -06:00
parent 8e91d51d7c
commit 0dfd6da5a9
136 changed files with 158 additions and 296 deletions

View File

@@ -12,7 +12,7 @@
"install": "node tasks/install.js",
"postinstall": "closure-util update",
"start": "node tasks/serve.js",
"pretest": "eslint tasks test test_rendering src examples",
"pretest": "eslint tasks test src examples",
"lint-package": "eslint --fix build/package",
"test": "node tasks/test.js",
"debug-server": "node tasks/serve-lib.js",

View File

@@ -1,11 +1,23 @@
{
"env": {
"mocha": true
},
"rules": {
"openlayers-internal/no-missing-requires": 0,
"openlayers-internal/valid-provide": 0
},
"globals": {
"IMAGE_TOLERANCE": false,
"afterLoadText": false,
"assertWebGL": false,
"createMapDiv": true,
"disposeMap": true,
"resemble": true
"expect": false,
"expectResemble": false,
"proj4": false,
"resemble": false,
"resembleCanvas": false,
"sinon": false,
"where": false
}
}

View File

@@ -32,3 +32,26 @@ any time one of the source or spec files changes.
Tip for TDD'ers: to make PhantomJS run the test suite continuously each time
a spec file is changed you can use nosier (http://pypi.python.org/pypi/nosier)
and do `nosier -p test -p src "make test"`.
# Rendering tests
The `test/rendering` directory contains rendering tests which compare a rendered map with a
reference image using [resemble.js](http://huddle.github.io/Resemble.js/).
To run the tests in the browser, make sure the development server is running
(`make serve`) and open the URL
[http://localhost:3000/test_rendering/index.html](http://localhost:3000/test_rendering/index.html).
From the command-line the tests can be run with the build target `make test-rendering`.
## Adding new tests
When creating a new test case, a reference image has to be created. By appending `?generate`
to the URL, a canvas with the rendered map will be shown on the page when calling
`expectResemble`. Then the reference image can simply be created with a right-click
and "Save image as".
It is recommended to only run a single test case when generating the reference image.
## Image difference
When a test fails, an image showing the difference between the reference image and the
rendered map can be displayed by appending `?showdiff` to the URL.

View File

@@ -28,6 +28,9 @@ module.exports = function(karma) {
}, {
pattern: path.resolve(__dirname, require.resolve('proj4/dist/proj4.js')),
watched: false
}, {
pattern: path.resolve(__dirname, require.resolve('resemblejs/resemble.js')),
watched: false
}, {
pattern: path.resolve(__dirname, './test-extensions.js')
}, {
@@ -39,6 +42,7 @@ module.exports = function(karma) {
}
],
proxies: {
'/rendering/': '/base/rendering/',
'/spec/': '/base/spec/'
}
});

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View File

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 635 B

View File

Before

Width:  |  Height:  |  Size: 838 B

After

Width:  |  Height:  |  Size: 838 B

View File

Before

Width:  |  Height:  |  Size: 637 B

After

Width:  |  Height:  |  Size: 637 B

View File

Before

Width:  |  Height:  |  Size: 950 B

After

Width:  |  Height:  |  Size: 950 B

View File

Before

Width:  |  Height:  |  Size: 873 B

After

Width:  |  Height:  |  Size: 873 B

View File

Before

Width:  |  Height:  |  Size: 966 B

After

Width:  |  Height:  |  Size: 966 B

View File

Before

Width:  |  Height:  |  Size: 717 B

After

Width:  |  Height:  |  Size: 717 B

View File

Before

Width:  |  Height:  |  Size: 792 B

After

Width:  |  Height:  |  Size: 792 B

View File

Before

Width:  |  Height:  |  Size: 801 B

After

Width:  |  Height:  |  Size: 801 B

View File

Before

Width:  |  Height:  |  Size: 615 B

After

Width:  |  Height:  |  Size: 615 B

View File

Before

Width:  |  Height:  |  Size: 733 B

After

Width:  |  Height:  |  Size: 733 B

View File

Before

Width:  |  Height:  |  Size: 639 B

After

Width:  |  Height:  |  Size: 639 B

View File

Before

Width:  |  Height:  |  Size: 799 B

After

Width:  |  Height:  |  Size: 799 B

View File

@@ -57,7 +57,7 @@ describe('layer clipping', function() {
it('clips to all parts of the MultiPolygon', function(done) {
var source = new ol.source.XYZ({
url: 'spec/ol/data/tiles/osm/{z}/{x}/{y}.png'
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png'
});
var layer = new ol.layer.Tile({
@@ -100,7 +100,7 @@ describe('layer clipping', function() {
if (err) {
return done(err);
}
expectResemble(map, 'spec/ol/layer/expected/multipolygon-clip.png', IMAGE_TOLERANCE, done);
expectResemble(map, 'rendering/ol/layer/expected/multipolygon-clip.png', IMAGE_TOLERANCE, done);
});
map.addLayer(layer);

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 806 B

After

Width:  |  Height:  |  Size: 806 B

View File

Before

Width:  |  Height:  |  Size: 806 B

After

Width:  |  Height:  |  Size: 806 B

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 341 B

View File

Before

Width:  |  Height:  |  Size: 504 B

After

Width:  |  Height:  |  Size: 504 B

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -63,7 +63,7 @@ describe('ol.rendering.layer.Image', function() {
beforeEach(function() {
source = new ol.source.ImageStatic({
url: 'spec/ol/data/tiles/osm/5/5/12.png',
url: 'rendering/ol/data/tiles/osm/5/5/12.png',
imageExtent: ol.tilegrid.createXYZ().getTileCoordExtent(
[5, 5, -12 - 1]),
projection: ol.proj.get('EPSG:3857')
@@ -77,7 +77,7 @@ describe('ol.rendering.layer.Image', function() {
it('tests the canvas renderer', function(done) {
map = createMap('canvas');
waitForImages([source], {}, function() {
expectResemble(map, 'spec/ol/layer/expected/image-canvas.png',
expectResemble(map, 'rendering/ol/layer/expected/image-canvas.png',
IMAGE_TOLERANCE, done);
});
});
@@ -86,7 +86,7 @@ describe('ol.rendering.layer.Image', function() {
assertWebGL();
map = createMap('webgl');
waitForImages([source], {}, function() {
expectResemble(map, 'spec/ol/layer/expected/image-webgl.png',
expectResemble(map, 'rendering/ol/layer/expected/image-webgl.png',
IMAGE_TOLERANCE, done);
});
});
@@ -97,7 +97,7 @@ describe('ol.rendering.layer.Image', function() {
beforeEach(function() {
source = new ol.source.ImageStatic({
url: 'spec/ol/data/tiles/osm/5/5/12.png',
url: 'rendering/ol/data/tiles/osm/5/5/12.png',
imageExtent: ol.proj.transformExtent(
[-123, 37, -122, 38], 'EPSG:4326', 'EPSG:3857')
});
@@ -110,7 +110,7 @@ describe('ol.rendering.layer.Image', function() {
it('renders correctly', function(done) {
map = createMap('canvas');
waitForImages([source], {}, function() {
expectResemble(map, 'spec/ol/layer/expected/image-scaled.png',
expectResemble(map, 'rendering/ol/layer/expected/image-scaled.png',
IMAGE_TOLERANCE, done);
});
});

View File

@@ -72,7 +72,7 @@ describe('ol.rendering.layer.Tile', function() {
beforeEach(function() {
source = new ol.source.XYZ({
url: 'spec/ol/data/tiles/osm/{z}/{x}/{y}.png'
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png'
});
});
@@ -83,7 +83,7 @@ describe('ol.rendering.layer.Tile', function() {
it('tests the canvas renderer', function(done) {
map = createMap('canvas');
waitForTiles([source], {}, function() {
expectResemble(map, 'spec/ol/layer/expected/osm-canvas.png',
expectResemble(map, 'rendering/ol/layer/expected/osm-canvas.png',
IMAGE_TOLERANCE, done);
});
});
@@ -92,7 +92,7 @@ describe('ol.rendering.layer.Tile', function() {
assertWebGL();
map = createMap('webgl');
waitForTiles([source], {}, function() {
expectResemble(map, 'spec/ol/layer/expected/osm-webgl.png',
expectResemble(map, 'rendering/ol/layer/expected/osm-webgl.png',
IMAGE_TOLERANCE, done);
});
});
@@ -103,10 +103,10 @@ describe('ol.rendering.layer.Tile', function() {
beforeEach(function() {
source1 = new ol.source.XYZ({
url: 'spec/ol/data/tiles/osm/{z}/{x}/{y}.png'
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png'
});
source2 = new ol.source.XYZ({
url: 'spec/ol/data/tiles/stamen-labels/{z}/{x}/{y}.png'
url: 'rendering/ol/data/tiles/stamen-labels/{z}/{x}/{y}.png'
});
});
@@ -117,7 +117,7 @@ describe('ol.rendering.layer.Tile', function() {
it('tests the canvas renderer', function(done) {
map = createMap('canvas');
waitForTiles([source1, source2], {}, function() {
expectResemble(map, 'spec/ol/layer/expected/2-layers-canvas.png',
expectResemble(map, 'rendering/ol/layer/expected/2-layers-canvas.png',
IMAGE_TOLERANCE, done);
});
});
@@ -126,7 +126,7 @@ describe('ol.rendering.layer.Tile', function() {
assertWebGL();
map = createMap('webgl');
waitForTiles([source1, source2], {}, function() {
expectResemble(map, 'spec/ol/layer/expected/2-layers-webgl.png',
expectResemble(map, 'rendering/ol/layer/expected/2-layers-webgl.png',
IMAGE_TOLERANCE, done);
});
});
@@ -141,7 +141,7 @@ describe('ol.rendering.layer.Tile', function() {
it('tests canvas layer extent clipping', function(done) {
map = createMap('canvas');
waitForTiles([source1, source2], [{}, {extent: centerExtent(map)}], function() {
expectResemble(map, 'spec/ol/layer/expected/2-layers-canvas-extent.png',
expectResemble(map, 'rendering/ol/layer/expected/2-layers-canvas-extent.png',
IMAGE_TOLERANCE, done);
});
});
@@ -150,7 +150,7 @@ describe('ol.rendering.layer.Tile', function() {
map = createMap('canvas');
map.getView().setRotation(Math.PI / 2);
waitForTiles([source1, source2], [{}, {extent: centerExtent(map)}], function() {
expectResemble(map, 'spec/ol/layer/expected/2-layers-canvas-extent-rotate.png',
expectResemble(map, 'rendering/ol/layer/expected/2-layers-canvas-extent-rotate.png',
IMAGE_TOLERANCE, done);
});
});
@@ -158,7 +158,7 @@ describe('ol.rendering.layer.Tile', function() {
it('tests canvas layer extent clipping (HiDPI)', function(done) {
map = createMap('canvas', undefined, undefined, 2);
waitForTiles([source1, source2], [{}, {extent: centerExtent(map)}], function() {
expectResemble(map, 'spec/ol/layer/expected/2-layers-canvas-extent-hidpi.png',
expectResemble(map, 'rendering/ol/layer/expected/2-layers-canvas-extent-hidpi.png',
IMAGE_TOLERANCE, done);
});
});
@@ -167,7 +167,7 @@ describe('ol.rendering.layer.Tile', function() {
map = createMap('canvas', undefined, undefined, 2);
map.getView().setRotation(Math.PI / 2);
waitForTiles([source1, source2], [{}, {extent: centerExtent(map)}], function() {
expectResemble(map, 'spec/ol/layer/expected/2-layers-canvas-extent-rotate-hidpi.png',
expectResemble(map, 'rendering/ol/layer/expected/2-layers-canvas-extent-rotate-hidpi.png',
IMAGE_TOLERANCE, done);
});
});
@@ -179,7 +179,7 @@ describe('ol.rendering.layer.Tile', function() {
beforeEach(function() {
source = new ol.source.XYZ({
url: 'spec/ol/data/tiles/osm/{z}/{x}/{y}.png'
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png'
});
});
@@ -190,7 +190,7 @@ describe('ol.rendering.layer.Tile', function() {
it('tests the canvas renderer', function(done) {
map = createMap('canvas');
waitForTiles([source], {opacity: 0.2}, function() {
expectResemble(map, 'spec/ol/layer/expected/opacity-canvas.png',
expectResemble(map, 'rendering/ol/layer/expected/opacity-canvas.png',
IMAGE_TOLERANCE, done);
});
});
@@ -199,7 +199,7 @@ describe('ol.rendering.layer.Tile', function() {
assertWebGL();
map = createMap('webgl');
waitForTiles([source], {opacity: 0.2}, function() {
expectResemble(map, 'spec/ol/layer/expected/opacity-webgl.png',
expectResemble(map, 'rendering/ol/layer/expected/opacity-webgl.png',
IMAGE_TOLERANCE, done);
});
});
@@ -209,7 +209,7 @@ describe('ol.rendering.layer.Tile', function() {
function createSource(tileSize) {
return new ol.source.TileImage({
url: 'spec/ol/data/tiles/' + tileSize + '/{z}/{x}/{y}.png',
url: 'rendering/ol/data/tiles/' + tileSize + '/{z}/{x}/{y}.png',
tileGrid: ol.tilegrid.createXYZ({
tileSize: tileSize.split('x')
})
@@ -224,7 +224,7 @@ describe('ol.rendering.layer.Tile', function() {
var source = createSource('512x256');
map = createMap('canvas', [-10997148, 4569099]);
waitForTiles([source], {}, function() {
expectResemble(map, 'spec/ol/layer/expected/512x256-canvas.png',
expectResemble(map, 'rendering/ol/layer/expected/512x256-canvas.png',
IMAGE_TOLERANCE, done);
});
});
@@ -234,7 +234,7 @@ describe('ol.rendering.layer.Tile', function() {
var source = createSource('512x256');
map = createMap('webgl', [-10997148, 4569099]);
waitForTiles([source], {}, function() {
expectResemble(map, 'spec/ol/layer/expected/512x256-webgl.png',
expectResemble(map, 'rendering/ol/layer/expected/512x256-webgl.png',
IMAGE_TOLERANCE, done);
});
});
@@ -244,7 +244,7 @@ describe('ol.rendering.layer.Tile', function() {
map = createMap('canvas', [-11271098, 3747248], [100, 100], undefined,
source.getTileGrid().getResolutions());
waitForTiles([source], {}, function() {
expectResemble(map, 'spec/ol/layer/expected/192x256-canvas.png',
expectResemble(map, 'rendering/ol/layer/expected/192x256-canvas.png',
IMAGE_TOLERANCE, done);
});
});
@@ -255,7 +255,7 @@ describe('ol.rendering.layer.Tile', function() {
map = createMap('webgl', [-11271098, 3747248], [100, 100], undefined,
source.getTileGrid().getResolutions());
waitForTiles([source], {}, function() {
expectResemble(map, 'spec/ol/layer/expected/192x256-webgl.png',
expectResemble(map, 'rendering/ol/layer/expected/192x256-webgl.png',
IMAGE_TOLERANCE, done);
});
});
@@ -266,7 +266,7 @@ describe('ol.rendering.layer.Tile', function() {
beforeEach(function() {
source = new ol.source.XYZ({
url: 'spec/ol/data/tiles/osm/{z}/{x}/{y}.png'
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png'
});
onAddLayer = function(evt) {
evt.element.on('render', function(e) {
@@ -290,7 +290,7 @@ describe('ol.rendering.layer.Tile', function() {
map = createMap('canvas', undefined, [100, 100]);
map.getLayers().on('add', onAddLayer);
waitForTiles([source], {}, function() {
expectResemble(map, 'spec/ol/layer/expected/render-canvas.png',
expectResemble(map, 'rendering/ol/layer/expected/render-canvas.png',
IMAGE_TOLERANCE, done);
});
});

View File

@@ -92,7 +92,7 @@ describe('ol.rendering.layer.Vector', function() {
source: source
}));
map.once('postrender', function() {
expectResemble(map, 'spec/ol/layer/expected/vector-canvas.png',
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas.png',
17, done);
});
});
@@ -151,7 +151,7 @@ describe('ol.rendering.layer.Vector', function() {
})
}));
map.once('postrender', function() {
expectResemble(map, 'spec/ol/layer/expected/vector-canvas-rotated.png',
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas-rotated.png',
1.7, done);
});
});
@@ -177,7 +177,7 @@ describe('ol.rendering.layer.Vector', function() {
})
}));
map.once('postrender', function() {
expectResemble(map, 'spec/ol/layer/expected/vector-canvas-opaque.png',
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas-opaque.png',
24.34, done);
});
});
@@ -201,7 +201,7 @@ describe('ol.rendering.layer.Vector', function() {
})
}));
map.once('postrender', function() {
expectResemble(map, 'spec/ol/layer/expected/vector-canvas-stroke.png',
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas-stroke.png',
7, done);
});
});
@@ -252,9 +252,9 @@ describe('ol.rendering.layer.Vector', function() {
var referenceImage = canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height);
// now render the same with `overlaps: false`
layer.setSource(createSource(false));
// result should be exactly the same as with `overlaps: true`
// result should be similar to `overlaps: true`
map.once('postrender', function() {
expectResemble(map, referenceImage, 0, done);
expectResemble(map, referenceImage, 2, done);
});
});
});
@@ -362,7 +362,7 @@ describe('ol.rendering.layer.Vector', function() {
map.addLayer(layer);
map.once('postrender', function() {
expectResemble(map, 'spec/ol/layer/expected/inverted-star.png', 1, done);
expectResemble(map, 'rendering/ol/layer/expected/inverted-star.png', 1, done);
});
});
@@ -424,7 +424,7 @@ describe('ol.rendering.layer.Vector', function() {
})
}));
map.once('postrender', function() {
expectResemble(map, 'spec/ol/layer/expected/vector-canvas-simplified.png',
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas-simplified.png',
IMAGE_TOLERANCE, done);
});
});
@@ -436,7 +436,7 @@ describe('ol.rendering.layer.Vector', function() {
})
}));
map.once('postrender', function() {
expectResemble(map, 'spec/ol/layer/expected/vector-canvas-simplified-fill.png',
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas-simplified-fill.png',
IMAGE_TOLERANCE, done);
});
});
@@ -449,7 +449,7 @@ describe('ol.rendering.layer.Vector', function() {
})
}));
map.once('postrender', function() {
expectResemble(map, 'spec/ol/layer/expected/vector-canvas-simplified-stroke.png',
expectResemble(map, 'rendering/ol/layer/expected/vector-canvas-simplified-stroke.png',
IMAGE_TOLERANCE, done);
});
});

View File

@@ -64,7 +64,7 @@ describe('ol.rendering.layer.VectorTile', function() {
format: new ol.format.MVT(),
tileGrid: ol.tilegrid.createXYZ(),
tilePixelRatio: 16,
url: 'spec/ol/data/tiles/mvt/{z}-{x}-{y}.vector.pbf'
url: 'rendering/ol/data/tiles/mvt/{z}-{x}-{y}.vector.pbf'
});
});
@@ -75,7 +75,7 @@ describe('ol.rendering.layer.VectorTile', function() {
it('renders correctly with the canvas renderer', function(done) {
map = createMap('canvas');
waitForTiles(source, {}, function() {
expectResemble(map, 'spec/ol/layer/expected/vectortile-canvas.png',
expectResemble(map, 'rendering/ol/layer/expected/vectortile-canvas.png',
11.7, done);
});
});
@@ -84,7 +84,7 @@ describe('ol.rendering.layer.VectorTile', function() {
map = createMap('canvas');
map.getView().setRotation(Math.PI / 4);
waitForTiles(source, {}, function() {
expectResemble(map, 'spec/ol/layer/expected/vectortile-canvas-rotated.png',
expectResemble(map, 'rendering/ol/layer/expected/vectortile-canvas-rotated.png',
13.4, done);
});
});
@@ -92,7 +92,7 @@ describe('ol.rendering.layer.VectorTile', function() {
it('renders correctly with the canvas renderer (HiDPI)', function(done) {
map = createMap('canvas', 2);
waitForTiles(source, {}, function() {
expectResemble(map, 'spec/ol/layer/expected/vectortile-canvas-hidpi.png',
expectResemble(map, 'rendering/ol/layer/expected/vectortile-canvas-hidpi.png',
11.3, done);
});
});
@@ -101,7 +101,7 @@ describe('ol.rendering.layer.VectorTile', function() {
map = createMap('canvas', 2);
map.getView().setRotation(Math.PI / 4);
waitForTiles(source, {}, function() {
expectResemble(map, 'spec/ol/layer/expected/vectortile-canvas-rotated-hidpi.png',
expectResemble(map, 'rendering/ol/layer/expected/vectortile-canvas-rotated-hidpi.png',
14.8, done);
});
});

View File

@@ -89,14 +89,14 @@ describe('ol.rendering.Map', function() {
it('tests the canvas renderer', function(done) {
map = createMap('canvas');
expectResemble(
map, 'spec/ol/expected/render-canvas.png', IMAGE_TOLERANCE, done);
map, 'rendering/ol/expected/render-canvas.png', IMAGE_TOLERANCE, done);
});
it('tests the WebGL renderer', function(done) {
assertWebGL();
map = createMap('webgl');
expectResemble(
map, 'spec/ol/expected/render-webgl.png', IMAGE_TOLERANCE, done);
map, 'rendering/ol/expected/render-webgl.png', IMAGE_TOLERANCE, done);
});
});
@@ -109,7 +109,7 @@ describe('ol.rendering.Map', function() {
map = createMap('canvas');
map.getView().setCenter([10, 10]);
expectResemble(
map, 'spec/ol/expected/pan-canvas.png', IMAGE_TOLERANCE, done);
map, 'rendering/ol/expected/pan-canvas.png', IMAGE_TOLERANCE, done);
});
it('tests the WebGL renderer', function(done) {
@@ -117,7 +117,7 @@ describe('ol.rendering.Map', function() {
map = createMap('webgl');
map.getView().setCenter([10, 10]);
expectResemble(
map, 'spec/ol/expected/pan-webgl.png', IMAGE_TOLERANCE, done);
map, 'rendering/ol/expected/pan-webgl.png', IMAGE_TOLERANCE, done);
});
});
@@ -131,7 +131,7 @@ describe('ol.rendering.Map', function() {
map.getView().setRotation(90);
map.getView().setCenter([10, 10]);
expectResemble(
map, 'spec/ol/expected/rotate-canvas.png', 2.8, done);
map, 'rendering/ol/expected/rotate-canvas.png', 2.8, done);
});
it('tests the WebGL renderer', function(done) {
@@ -140,7 +140,7 @@ describe('ol.rendering.Map', function() {
map.getView().setRotation(90);
map.getView().setCenter([10, 10]);
expectResemble(
map, 'spec/ol/expected/rotate-webgl.png', IMAGE_TOLERANCE, done);
map, 'rendering/ol/expected/rotate-webgl.png', IMAGE_TOLERANCE, done);
});
});
@@ -154,7 +154,7 @@ describe('ol.rendering.Map', function() {
map.getView().setCenter([10, 10]);
map.getView().setResolution(2);
expectResemble(
map, 'spec/ol/expected/zoom-canvas.png', IMAGE_TOLERANCE, done);
map, 'rendering/ol/expected/zoom-canvas.png', IMAGE_TOLERANCE, done);
});
it('tests the WebGL renderer', function(done) {
@@ -163,7 +163,7 @@ describe('ol.rendering.Map', function() {
map.getView().setCenter([10, 10]);
map.getView().setResolution(2);
expectResemble(
map, 'spec/ol/expected/zoom-webgl.png', IMAGE_TOLERANCE, done);
map, 'rendering/ol/expected/zoom-webgl.png', IMAGE_TOLERANCE, done);
});
});
});

View File

@@ -44,7 +44,7 @@ describe('ol.render', function() {
vectorContext.drawGeometry(new ol.geom.Point([50, 50]));
resembleCanvas(context.canvas,
'spec/ol/expected/render-point.png', IMAGE_TOLERANCE, done);
'rendering/ol/expected/render-point.png', IMAGE_TOLERANCE, done);
});
@@ -64,7 +64,7 @@ describe('ol.render', function() {
]));
resembleCanvas(context.canvas,
'spec/ol/expected/render-linestring.png', IMAGE_TOLERANCE, done);
'rendering/ol/expected/render-linestring.png', IMAGE_TOLERANCE, done);
});
@@ -85,7 +85,7 @@ describe('ol.render', function() {
]));
resembleCanvas(context.canvas,
'spec/ol/expected/render-linestring-butt.png', IMAGE_TOLERANCE, done);
'rendering/ol/expected/render-linestring-butt.png', IMAGE_TOLERANCE, done);
});
@@ -106,7 +106,7 @@ describe('ol.render', function() {
]));
resembleCanvas(context.canvas,
'spec/ol/expected/render-linestring-bevel.png', IMAGE_TOLERANCE, done);
'rendering/ol/expected/render-linestring-bevel.png', IMAGE_TOLERANCE, done);
});
@@ -131,7 +131,7 @@ describe('ol.render', function() {
]));
resembleCanvas(context.canvas,
'spec/ol/expected/render-polygon.png', IMAGE_TOLERANCE, done);
'rendering/ol/expected/render-polygon.png', IMAGE_TOLERANCE, done);
});

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -38,7 +38,7 @@ describe('ol.rendering.reproj.Image', function() {
describe('image reprojections from EPSG:3857', function() {
beforeEach(function() {
source = new ol.source.ImageStatic({
url: 'spec/ol/data/tiles/osm/5/5/12.png',
url: 'rendering/ol/data/tiles/osm/5/5/12.png',
imageExtent: ol.tilegrid.createXYZ().getTileCoordExtent([5, 5, -13]),
projection: ol.proj.get('EPSG:3857')
});
@@ -48,7 +48,7 @@ describe('ol.rendering.reproj.Image', function() {
testSingleImage(source, 'EPSG:3857',
ol.tilegrid.createXYZ().getTileCoordExtent([5, 5, -13]),
2 * ol.proj.EPSG3857.HALF_SIZE / (256 * (1 << 5)), 1,
'spec/ol/data/tiles/osm/5/5/12.png', done);
'rendering/ol/data/tiles/osm/5/5/12.png', done);
});
it('to EPSG:4326', function(done) {
@@ -56,7 +56,7 @@ describe('ol.rendering.reproj.Image', function() {
ol.tilegrid.createForProjection('EPSG:4326').
getTileCoordExtent([6, 10, -10]),
360 / (256 * (1 << 4)), 1,
'spec/ol/reproj/expected/image-3857-to-4326.png', done);
'rendering/ol/reproj/expected/image-3857-to-4326.png', done);
});
});
});

View File

@@ -41,19 +41,19 @@ describe('ol.rendering.reproj.Tile', function() {
beforeEach(function() {
source = new ol.source.XYZ({
projection: 'EPSG:3857',
url: 'spec/ol/data/tiles/osm/{z}/{x}/{y}.png'
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png'
});
});
it('works for identity reprojection', function(done) {
testSingleTile(source, 'EPSG:3857', source.getTileGrid(), 5, 5, -13, 1,
'spec/ol/data/tiles/osm/5/5/12.png', 1, done);
'rendering/ol/data/tiles/osm/5/5/12.png', 1, done);
});
it('to EPSG:4326', function(done) {
var tileGrid = ol.tilegrid.createForProjection('EPSG:4326', 7, [64, 64]);
testSingleTile(source, 'EPSG:4326', tileGrid, 7, 21, -20, 1,
'spec/ol/reproj/expected/osm4326.png', 1, done);
'rendering/ol/reproj/expected/osm4326.png', 1, done);
});
it('to EPSG:5070', function(done) {
@@ -65,7 +65,7 @@ describe('ol.rendering.reproj.Tile', function() {
var tileGrid = ol.tilegrid.createForProjection('EPSG:5070', 5, [64, 64]);
testSingleTile(source, 'EPSG:5070', tileGrid, 5, 13, -15, 1,
'spec/ol/reproj/expected/osm5070.png', 1, done);
'rendering/ol/reproj/expected/osm5070.png', 1, done);
});
it('to ESRI:54009', function(done) {
@@ -76,7 +76,7 @@ describe('ol.rendering.reproj.Tile', function() {
var tileGrid = ol.tilegrid.createForProjection('ESRI:54009', 7, [64, 64]);
testSingleTile(source, 'ESRI:54009', tileGrid, 7, 27, -16, 1,
'spec/ol/reproj/expected/osm54009.png', 1, done);
'rendering/ol/reproj/expected/osm54009.png', 1, done);
});
});
@@ -84,14 +84,14 @@ describe('ol.rendering.reproj.Tile', function() {
beforeEach(function() {
source = new ol.source.XYZ({
projection: 'EPSG:3857',
url: 'spec/ol/data/tiles/osm/{z}/{x}/{y}.png'
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png'
});
});
it('to EPSG:4326', function(done) {
var tileGrid = ol.tilegrid.createForProjection('EPSG:4326', 7, [64, 64]);
testSingleTile(source, 'EPSG:4326', tileGrid, 7, 23, -21, 1,
'spec/ol/reproj/expected/stitch-osm4326.png', 2, done);
'rendering/ol/reproj/expected/stitch-osm4326.png', 2, done);
});
it('to EPSG:3740', function(done) {
@@ -103,7 +103,7 @@ describe('ol.rendering.reproj.Tile', function() {
var tileGrid = ol.tilegrid.createForProjection('EPSG:3740', 4, [64, 64]);
testSingleTile(source, 'EPSG:3740', tileGrid, 4, 4, -13, 1,
'spec/ol/reproj/expected/stitch-osm3740.png', 4, done);
'rendering/ol/reproj/expected/stitch-osm3740.png', 4, done);
});
});
@@ -112,19 +112,19 @@ describe('ol.rendering.reproj.Tile', function() {
source = new ol.source.XYZ({
projection: 'EPSG:4326',
maxZoom: 0,
url: 'spec/ol/data/tiles/4326/{z}/{x}/{y}.png'
url: 'rendering/ol/data/tiles/4326/{z}/{x}/{y}.png'
});
});
it('works for identity reprojection', function(done) {
testSingleTile(source, 'EPSG:4326', source.getTileGrid(), 0, 0, -1, 1,
'spec/ol/data/tiles/4326/0/0/0.png', 1, done);
'rendering/ol/data/tiles/4326/0/0/0.png', 1, done);
});
it('to EPSG:3857', function(done) {
var tileGrid = ol.tilegrid.createForProjection('EPSG:3857', 0, [64, 64]);
testSingleTile(source, 'EPSG:3857', tileGrid, 0, 0, -1, 1,
'spec/ol/reproj/expected/4326-to-3857.png', 1, done);
'rendering/ol/reproj/expected/4326-to-3857.png', 1, done);
});
});
@@ -132,20 +132,20 @@ describe('ol.rendering.reproj.Tile', function() {
beforeEach(function() {
source = new ol.source.XYZ({
projection: 'EPSG:3857',
url: 'spec/ol/data/tiles/osm-512x256/{z}/{x}/{y}.png',
url: 'rendering/ol/data/tiles/osm-512x256/{z}/{x}/{y}.png',
tileSize: [512, 256]
});
});
it('works for identity reprojection', function(done) {
testSingleTile(source, 'EPSG:3857', source.getTileGrid(), 5, 3, -13, 1,
'spec/ol/data/tiles/osm-512x256/5/3/12.png', 1, done);
'rendering/ol/data/tiles/osm-512x256/5/3/12.png', 1, done);
});
it('to 64x128 EPSG:4326', function(done) {
var tileGrid = ol.tilegrid.createForProjection('EPSG:4326', 7, [64, 128]);
testSingleTile(source, 'EPSG:4326', tileGrid, 7, 27, -10, 1,
'spec/ol/reproj/expected/512x256-to-64x128.png', 1, done);
'rendering/ol/reproj/expected/512x256-to-64x128.png', 1, done);
});
});
@@ -154,7 +154,7 @@ describe('ol.rendering.reproj.Tile', function() {
source = new ol.source.XYZ({
projection: 'EPSG:4326',
maxZoom: 0,
url: 'spec/ol/data/tiles/4326/{z}/{x}/{y}.png'
url: 'rendering/ol/data/tiles/4326/{z}/{x}/{y}.png'
});
});
@@ -165,7 +165,7 @@ describe('ol.rendering.reproj.Tile', function() {
var tileGrid = ol.tilegrid.createForProjection('merc_180', 0, [64, 64]);
testSingleTile(source, 'merc_180', tileGrid, 0, 0, -1, 1,
'spec/ol/reproj/expected/dateline-merc-180.png', 2, done);
'rendering/ol/reproj/expected/dateline-merc-180.png', 2, done);
});
it('displays north pole correctly (EPSG:3413)', function(done) {
@@ -176,7 +176,7 @@ describe('ol.rendering.reproj.Tile', function() {
var tileGrid = ol.tilegrid.createForProjection('EPSG:3413', 0, [64, 64]);
testSingleTile(source, 'EPSG:3413', tileGrid, 0, 0, -1, 1,
'spec/ol/reproj/expected/dateline-pole.png', 2, done);
'rendering/ol/reproj/expected/dateline-pole.png', 2, done);
});
});
});

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -43,7 +43,7 @@ describe('ol.rendering.source.TileWMS', function() {
'LAYERS': 'layer'
},
gutter: gutter,
url: 'spec/ol/data/tiles/wms/wms' + gutter + '.png'
url: 'rendering/ol/data/tiles/wms/wms' + gutter + '.png'
});
}
@@ -52,7 +52,7 @@ describe('ol.rendering.source.TileWMS', function() {
var map = createMap('canvas', 1);
var source = createSource(0);
tilesLoaded(source, function() {
expectResemble(map, 'spec/ol/source/expected/0_1.canvas.png', IMAGE_TOLERANCE, done);
expectResemble(map, 'rendering/ol/source/expected/0_1.canvas.png', IMAGE_TOLERANCE, done);
});
map.addLayer(new ol.layer.Tile({
source: source
@@ -64,7 +64,7 @@ describe('ol.rendering.source.TileWMS', function() {
var map = createMap('webgl', 1);
var source = createSource(0);
tilesLoaded(source, function() {
expectResemble(map, 'spec/ol/source/expected/0_1.webgl.png', IMAGE_TOLERANCE, done);
expectResemble(map, 'rendering/ol/source/expected/0_1.webgl.png', IMAGE_TOLERANCE, done);
});
map.addLayer(new ol.layer.Tile({
source: source
@@ -77,7 +77,7 @@ describe('ol.rendering.source.TileWMS', function() {
var map = createMap('canvas', 2);
var source = createSource(0);
tilesLoaded(source, function() {
expectResemble(map, 'spec/ol/source/expected/0_2.canvas.png', IMAGE_TOLERANCE, done);
expectResemble(map, 'rendering/ol/source/expected/0_2.canvas.png', IMAGE_TOLERANCE, done);
});
map.addLayer(new ol.layer.Tile({
source: source
@@ -89,7 +89,7 @@ describe('ol.rendering.source.TileWMS', function() {
var map = createMap('webgl', 2);
var source = createSource(0);
tilesLoaded(source, function() {
expectResemble(map, 'spec/ol/source/expected/0_2.webgl.png', IMAGE_TOLERANCE, done);
expectResemble(map, 'rendering/ol/source/expected/0_2.webgl.png', IMAGE_TOLERANCE, done);
});
map.addLayer(new ol.layer.Tile({
source: source
@@ -103,7 +103,7 @@ describe('ol.rendering.source.TileWMS', function() {
var map = createMap('canvas', 1);
var source = createSource(20);
tilesLoaded(source, function() {
expectResemble(map, 'spec/ol/source/expected/20_1.canvas.png', IMAGE_TOLERANCE, done);
expectResemble(map, 'rendering/ol/source/expected/20_1.canvas.png', IMAGE_TOLERANCE, done);
});
map.addLayer(new ol.layer.Tile({
source: source
@@ -115,7 +115,7 @@ describe('ol.rendering.source.TileWMS', function() {
var map = createMap('webgl', 1);
var source = createSource(20);
tilesLoaded(source, function() {
expectResemble(map, 'spec/ol/source/expected/20_1.webgl.png', IMAGE_TOLERANCE, done);
expectResemble(map, 'rendering/ol/source/expected/20_1.webgl.png', IMAGE_TOLERANCE, done);
});
map.addLayer(new ol.layer.Tile({
source: source
@@ -128,7 +128,7 @@ describe('ol.rendering.source.TileWMS', function() {
var map = createMap('canvas', 2);
var source = createSource(20);
tilesLoaded(source, function() {
expectResemble(map, 'spec/ol/source/expected/20_2.canvas.png', IMAGE_TOLERANCE, done);
expectResemble(map, 'rendering/ol/source/expected/20_2.canvas.png', IMAGE_TOLERANCE, done);
});
map.addLayer(new ol.layer.Tile({
source: source
@@ -140,7 +140,7 @@ describe('ol.rendering.source.TileWMS', function() {
var map = createMap('webgl', 2);
var source = createSource(20);
tilesLoaded(source, function() {
expectResemble(map, 'spec/ol/source/expected/20_2.webgl.png', IMAGE_TOLERANCE, done);
expectResemble(map, 'rendering/ol/source/expected/20_2.webgl.png', IMAGE_TOLERANCE, done);
});
map.addLayer(new ol.layer.Tile({
source: source

View File

@@ -186,7 +186,7 @@ describe('ol.rendering.style.Circle', function() {
it('tests the canvas renderer', function(done) {
map = createMap('canvas');
createFeatures();
expectResemble(map, 'spec/ol/style/expected/circle-canvas.png',
expectResemble(map, 'rendering/ol/style/expected/circle-canvas.png',
8.0, done);
});
@@ -194,7 +194,7 @@ describe('ol.rendering.style.Circle', function() {
assertWebGL();
map = createMap('webgl');
createFeatures();
expectResemble(map, 'spec/ol/style/expected/circle-webgl.png',
expectResemble(map, 'rendering/ol/style/expected/circle-webgl.png',
8.0, done);
});
});

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Some files were not shown because too many files have changed in this diff Show More