diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a864c96a3..a186d60626 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,6 +109,8 @@ if(FFHEADLESS_TESTS) set_property(TEST "ffheadless" APPEND PROPERTY ENVIRONMENT "TEST_SAVE_IMAGE=${TEST_SAVE_IMAGE}") set_property(TEST "total-coverage" APPEND PROPERTY DEPENDS "ffheadless") set_property(TEST "ffheadless" APPEND PROPERTY DEPENDS "get_data_files") + # We use some of the example images in the ffheadless tests + set_property(TEST "ffheadless" APPEND PROPERTY DEPENDS "build_examples") add_test( NAME "examplesheadless" diff --git a/examples/blog-lines/main.js b/examples/blog-lines/main.js index d9bc63ee35..7e25c0eac6 100644 --- a/examples/blog-lines/main.js +++ b/examples/blog-lines/main.js @@ -299,6 +299,7 @@ function geojsLinesTest(opts) { var geo = libraryReference(opts); + $(opts.node).removeClass('ready'); // create the map var map = geo.map({ node: opts.node, @@ -358,6 +359,10 @@ function geojsLinesTest(opts) { map.draw(); + map.onIdle(function () { + $(opts.node).addClass('ready'); + }); + // return references to the various objects return { map: map, diff --git a/examples/lines/main.js b/examples/lines/main.js index 4f695703eb..8be77cdae0 100644 --- a/examples/lines/main.js +++ b/examples/lines/main.js @@ -129,7 +129,7 @@ $(function () { * the line. */ function show_lines(rawdata) { - $('#map').removeClass('ready'); + $('#map').removeClass('ready').attr('segments', ''); if (!rawdata) { return; } @@ -146,7 +146,7 @@ $(function () { var text = 'Shown: ' + segments; $('#lines-shown').text(text).attr('title', text); map.onIdle(function () { - $('#map').addClass('ready'); + $('#map').addClass('ready').attr('segments', maxsegments); }); } @@ -291,9 +291,9 @@ $(function () { function select_preset(evt) { var update; var ctl = $(evt.target); - var keys = ['antialiasing', 'lineCap', 'lineJoin', 'lines', 'miterLimit', - 'showmap', 'strokeColor', 'strokeOffset', 'strokeOpacity', - 'strokeWidth']; + var keys = [ + 'antialiasing', 'lineCap', 'lineJoin', 'lines', 'miterLimit', 'showmap', + 'strokeColor', 'strokeOffset', 'strokeOpacity', 'strokeWidth']; skipdraw = true; $.each(keys, function (idx, key) { var value = ctl.attr(key); diff --git a/tests/example-cases/blog-lines.js b/tests/example-cases/blog-lines.js index b6dcc3f8e2..3006951475 100644 --- a/tests/example-cases/blog-lines.js +++ b/tests/example-cases/blog-lines.js @@ -32,7 +32,7 @@ describe('blog-lines example', function () { it('basic', function (done) { $('#map').attr('src', '/examples/blog-lines/index.html?mode=select'); - imageTest.imageTest('exampleBlogLines', '#map', 0.0015, done, ready, 500, 2); + imageTest.imageTest('exampleBlogLines', '#map', 0.0015, done, ready, 500, 2, '.leaflet-pane'); }, 10000); it('round line cap', function (done) { $('#map')[0].contentWindow.scrollTo(0, 130); @@ -42,6 +42,6 @@ describe('blog-lines example', function () { }, 20000); it('10,000 lines in geojs', function (done) { $('#map').attr('src', '/examples/blog-lines/index.html?renderer=vgl&data=roads&lines=10000&x=-73.7593015&y=42.8496799&zoom=13&strokeOpacity=1&strokeWidth=2&antialiasing=2&referenceLines=false'); - imageTest.imageTest('exampleBlogLines10k', '#map', 0.0015, done, null, 1000, 2); + imageTest.imageTest('exampleBlogLines10k', '#map', 0.0015, done, null, 1000, 2, '.geojs-map.ready'); }, 10000); }); diff --git a/tests/example-cases/lines.js b/tests/example-cases/lines.js index eb233e72ae..c6c8673198 100644 --- a/tests/example-cases/lines.js +++ b/tests/example-cases/lines.js @@ -15,7 +15,7 @@ describe('lines example', function () { it('more lines', function (done) { base$ = $('iframe#map')[0].contentWindow.jQuery; base$('#lines').val(100000).trigger('change'); - imageTest.imageTest('exampleLines100k', '#map', 0.0015, done, null, 0, 2, '#map.ready'); + imageTest.imageTest('exampleLines100k', '#map', 0.0015, done, null, 0, 2, '#map.ready[segments="100000"]'); }, 10000); it('thin preset', function (done) { base$('button.preset').eq(1).trigger('click'); diff --git a/tests/gl-cases/glLines.js b/tests/gl-cases/glLines.js index 61e07dc0bb..dd109d0429 100644 --- a/tests/gl-cases/glLines.js +++ b/tests/gl-cases/glLines.js @@ -142,5 +142,5 @@ describe('glLines', function () { imageTest.imageTest('glLinesOpts', null, 0.0015, done, myMap.onIdle, 0, 2); - }); + }, 10000); }); diff --git a/tests/gl-cases/glQuad.js b/tests/gl-cases/glQuad.js index 73541840b5..51eff89375 100644 --- a/tests/gl-cases/glQuad.js +++ b/tests/gl-cases/glQuad.js @@ -117,7 +117,6 @@ describe('glQuad', function () { myMap.draw(); - // use a short delay to allow all of the images to load imageTest.imageTest('glQuad', null, 0.0015, done, myMap.onIdle, 0, 2); }; diff --git a/tests/gl-cases/points.js b/tests/gl-cases/points.js index 01aeb44390..ecbfb8950a 100644 --- a/tests/gl-cases/points.js +++ b/tests/gl-cases/points.js @@ -113,7 +113,6 @@ describe('points', function () { feature.style('fillOpacity', 0.2) .style('strokeOpacity', 0.2); myMap.draw(); - // use a short delay to allow images to load imageTest.imageTest('glPointsWithQuad', null, 0.0015, done, myMap.onIdle, 0, 2); }, 1000); });