summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-06-27 13:28:05 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-06-28 16:31:48 -0700
commitab5e496219609b1e0a71508db9ed9d5fef29e7df (patch)
treef4f395c5fee2ab39a4c054782be1ecdce02a67b3
parentacbcf7e7e6b1575c1461354c807d4ca3ebfc7fb8 (diff)
downloadqtlocation-mapboxgl-ab5e496219609b1e0a71508db9ed9d5fef29e7df.tar.gz
[tests] Replaced the ZoomHistory test with a render test
-rw-r--r--cmake/test-files.cmake1
m---------mapbox-gl-js0
-rw-r--r--platform/node/test/ignores.json2
-rw-r--r--test/api/zoom_history.cpp71
-rw-r--r--test/fixtures/zoom_history/expected.pngbin3894 -> 0 bytes
5 files changed, 2 insertions, 72 deletions
diff --git a/cmake/test-files.cmake b/cmake/test-files.cmake
index a93f199d2a..ecd7700e97 100644
--- a/cmake/test-files.cmake
+++ b/cmake/test-files.cmake
@@ -19,7 +19,6 @@ set(MBGL_TEST_FILES
test/api/custom_layer.test.cpp
test/api/query.test.cpp
test/api/recycle_map.cpp
- test/api/zoom_history.cpp
# geometry
test/geometry/dem_data.test.cpp
diff --git a/mapbox-gl-js b/mapbox-gl-js
-Subproject f546de26b9b531a84fe621a5f51f4c0f791e57f
+Subproject e3f5816b2bfa9358a1302f31f70ebee5efdc3cd
diff --git a/platform/node/test/ignores.json b/platform/node/test/ignores.json
index 414108d46b..49ede03db9 100644
--- a/platform/node/test/ignores.json
+++ b/platform/node/test/ignores.json
@@ -28,6 +28,8 @@
"query-tests/line-width/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
"query-tests/feature-state/default": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
"query-tests/regressions/mapbox-gl-js#6555": "skip - no querySourceFeatures in mbgl-node; needs issue",
+ "query-tests/symbol/filtered-rotated-after-insert": "skip - https://github.com/mapbox/mapbox-gl-native/pull/12225",
+ "query-tests/symbol/rotated-sort": "skip - https://github.com/mapbox/mapbox-gl-native/pull/12225",
"render-tests/background-color/transition": "https://github.com/mapbox/mapbox-gl-native/issues/10619",
"render-tests/collator/resolved-locale": "Some test platforms don't resolve 'en' locale",
"render-tests/collator/default": "Some test platforms don't resolve 'en' locale",
diff --git a/test/api/zoom_history.cpp b/test/api/zoom_history.cpp
deleted file mode 100644
index df9b6ff2a3..0000000000
--- a/test/api/zoom_history.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-#include <mbgl/test/util.hpp>
-#include <mbgl/test/stub_file_source.hpp>
-
-#include <mbgl/gl/headless_frontend.hpp>
-#include <mbgl/map/map.hpp>
-#include <mbgl/renderer/backend_scope.hpp>
-#include <mbgl/storage/online_file_source.hpp>
-#include <mbgl/style/function/camera_function.hpp>
-#include <mbgl/style/function/exponential_stops.hpp>
-#include <mbgl/style/image.hpp>
-#include <mbgl/style/layers/line_layer.hpp>
-#include <mbgl/style/sources/geojson_source.hpp>
-#include <mbgl/style/style.hpp>
-#include <mbgl/util/default_thread_pool.hpp>
-#include <mbgl/util/exception.hpp>
-#include <mbgl/util/geometry.hpp>
-#include <mbgl/util/geojson.hpp>
-#include <mbgl/util/io.hpp>
-#include <mbgl/util/run_loop.hpp>
-
-using namespace mbgl;
-using namespace mbgl::style;
-
-TEST(API, ZoomHistory) {
- util::RunLoop loop;
-
- StubFileSource fileSource;
- ThreadPool threadPool(4);
- float pixelRatio { 1 };
-
- HeadlessFrontend frontend { pixelRatio, fileSource, threadPool };
- auto map = std::make_unique<Map>(frontend, MapObserver::nullObserver(), frontend.getSize(),
- pixelRatio, fileSource, threadPool, MapMode::Static);
-
- EXPECT_TRUE(map);
-
- map->getStyle().loadJSON(util::read_file("test/fixtures/api/empty.json"));
-
- auto source = std::make_unique<GeoJSONSource>("source");
- source->setGeoJSON({ LineString<double> { { 45, -45 }, { -45, 45 } } });
- map->getStyle().addSource(std::move(source));
-
- auto layer = std::make_unique<LineLayer>("layer-1", "source");
- layer->setLineWidth(CameraFunction<float> { ExponentialStops<float> {{ { 0, 8 }, { 1, 16 } }} });
- layer->setLineDasharray({ std::vector<float> { 1, 1 } });
- layer->setLineColor( { Color::black() } );
- map->getStyle().addLayer(std::move(layer));
-
- layer = std::make_unique<LineLayer>("layer-2", "source");
- layer->setLineWidth(CameraFunction<float> { ExponentialStops<float> {{ { 0, 4 }, { 1, 8 } }} });
- layer->setLineDasharray({ std::vector<float> { 2, 2 } });
- layer->setLineColor( { Color::red() } );
- map->getStyle().addLayer(std::move(layer));
-
- // ZoomHistory.lastIntegerZoom is 1.
- map->setZoom(1.0);
- frontend.render(*map);
-
- map->setZoom(0.0);
- frontend.render(*map);
-
- // ZoomHistory.lastIntegerZoom should be 0.
- map->setZoom(0.5);
- test::checkImage("test/fixtures/zoom_history", frontend.render(*map), 0.0002);
-
- map->setZoom(1.0);
- frontend.render(*map);
-
- map->setZoom(0.5);
- test::checkImage("test/fixtures/zoom_history", frontend.render(*map), 0.0002);
-}
diff --git a/test/fixtures/zoom_history/expected.png b/test/fixtures/zoom_history/expected.png
deleted file mode 100644
index 100dc508a4..0000000000
--- a/test/fixtures/zoom_history/expected.png
+++ /dev/null
Binary files differ