summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-07-21 15:24:27 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-07-26 09:50:38 -0700
commitc85193a0ad05fd4040ee711d606129e510dc45fe (patch)
tree25d88457636d503be2af35fab1ccd9aa62908f80 /test
parent7dde832dc6dedb79551cfab279acee5cc863a2c1 (diff)
downloadqtlocation-mapboxgl-c85193a0ad05fd4040ee711d606129e510dc45fe.tar.gz
[core] Replace API.ZoomHistory test with integration test
Diffstat (limited to 'test')
-rw-r--r--test/api/repeated_render.test.cpp63
-rw-r--r--test/fixtures/api/z0/expected.pngbin5042 -> 0 bytes
-rw-r--r--test/fixtures/api/z1/expected.pngbin5648 -> 0 bytes
3 files changed, 0 insertions, 63 deletions
diff --git a/test/api/repeated_render.test.cpp b/test/api/repeated_render.test.cpp
index 0e8a2715b7..be5336fe24 100644
--- a/test/api/repeated_render.test.cpp
+++ b/test/api/repeated_render.test.cpp
@@ -78,66 +78,3 @@ TEST(API, RepeatedRender) {
auto unchecked = flo->unchecked();
EXPECT_TRUE(unchecked.empty()) << unchecked;
}
-
-TEST(API, ZoomHistory) {
- util::RunLoop loop;
-
- const auto style = util::read_file("test/fixtures/api/empty.json");
-
- HeadlessBackend backend;
- BackendScope scope { backend };
- OffscreenView view { backend.getContext(), { 512, 512 } };
- DefaultFileSource fileSource(":memory:", ".");
- ThreadPool threadPool(4);
-
- Log::setObserver(std::make_unique<FixtureLogObserver>());
-
- float pixelRatio { 1 };
- StubRendererFrontend rendererFrontend {
- std::make_unique<Renderer>(backend, pixelRatio, fileSource, threadPool), view };
- Map map(rendererFrontend, MapObserver::nullObserver(), view.getSize(), pixelRatio, fileSource, threadPool, MapMode::Still);
- map.getStyle().loadJSON(style);
-
- auto geojson = mapbox::geojson::parse(R"t({ "type": "FeatureCollection", "features": [{ "type": "Feature", "properties": {}, "geometry": { "type": "LineString", "coordinates": [ [ -150, -75 ], [ 150, 75 ] ] } } ] })t");
- auto source = std::make_unique<mbgl::style::GeoJSONSource>("testSource");
- source->setGeoJSON(std::move(geojson));
- map.getStyle().addSource(std::move(source));
-
- auto layer = std::make_unique<mbgl::style::LineLayer>("testLayer", "testSource");
- layer->setLineDasharray({ { 1.0f, 2.0f } });
- layer->setLineWidth({ 16.0f });
- map.getStyle().addLayer(std::move(layer));
-
- {
- PremultipliedImage result;
- map.renderStill([&](std::exception_ptr) {
- result = view.readStillImage();
- });
-
- while (!result.valid()) {
- loop.runOnce();
- }
-
- test::checkImage("test/fixtures/api/z0", result, 0.0002, 0.1);
- }
-
- {
- map.setZoom(1.0);
-
- PremultipliedImage result;
- map.renderStill([&](std::exception_ptr) {
- result = view.readStillImage();
- });
-
- while (!result.valid()) {
- loop.runOnce();
- }
-
- test::checkImage("test/fixtures/api/z1", result, 0.0002, 0.1);
- }
-
- auto observer = Log::removeObserver();
- auto flo = dynamic_cast<FixtureLogObserver*>(observer.get());
- auto unchecked = flo->unchecked();
- EXPECT_TRUE(unchecked.empty()) << unchecked;
-}
diff --git a/test/fixtures/api/z0/expected.png b/test/fixtures/api/z0/expected.png
deleted file mode 100644
index 0867a8cbf6..0000000000
--- a/test/fixtures/api/z0/expected.png
+++ /dev/null
Binary files differ
diff --git a/test/fixtures/api/z1/expected.png b/test/fixtures/api/z1/expected.png
deleted file mode 100644
index 897dc196cc..0000000000
--- a/test/fixtures/api/z1/expected.png
+++ /dev/null
Binary files differ