From d151da372bad4cdae4610ad92c57fc1615b7a022 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 21 Mar 2018 13:51:05 -0700 Subject: [core] Convert test/api/zoom_history.cpp to render tests --- cmake/test-files.cmake | 1 - mapbox-gl-js | 2 +- test/api/zoom_history.cpp | 71 ----------------------------------------------- 3 files changed, 1 insertion(+), 73 deletions(-) delete mode 100644 test/api/zoom_history.cpp diff --git a/cmake/test-files.cmake b/cmake/test-files.cmake index 790198a55e..56327c5dce 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 index 4cd5570ad3..6ae5df821d 160000 --- a/mapbox-gl-js +++ b/mapbox-gl-js @@ -1 +1 @@ -Subproject commit 4cd5570ad3ed3e0ad71e2f795e795a78f5ccf603 +Subproject commit 6ae5df821d749b4ced013bf741fccf36d4433e04 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 -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -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(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("source"); - source->setGeoJSON({ LineString { { 45, -45 }, { -45, 45 } } }); - map->getStyle().addSource(std::move(source)); - - auto layer = std::make_unique("layer-1", "source"); - layer->setLineWidth(CameraFunction { ExponentialStops {{ { 0, 8 }, { 1, 16 } }} }); - layer->setLineDasharray({ std::vector { 1, 1 } }); - layer->setLineColor( { Color::black() } ); - map->getStyle().addLayer(std::move(layer)); - - layer = std::make_unique("layer-2", "source"); - layer->setLineWidth(CameraFunction { ExponentialStops {{ { 0, 4 }, { 1, 8 } }} }); - layer->setLineDasharray({ std::vector { 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); -} -- cgit v1.2.1