summaryrefslogtreecommitdiff
path: root/test/map/map.test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/map/map.test.cpp')
-rw-r--r--test/map/map.test.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp
index 98f8402706..50d5e50abb 100644
--- a/test/map/map.test.cpp
+++ b/test/map/map.test.cpp
@@ -584,3 +584,45 @@ TEST(Map, TEST_DISABLED_ON_CI(ContinuousRendering)) {
runLoop.run();
}
+
+TEST(Map, NoContentTiles) {
+ MapTest<DefaultFileSource> test {":memory:", "."};
+
+ using namespace std::chrono_literals;
+
+ // Insert a 204 No Content response for the 0/0/0 tile
+ Response response;
+ response.noContent = true;
+ response.expires = util::now() + 1h;
+ test.fileSource.put(Resource::tile("http://example.com/{z}-{x}-{y}.vector.pbf", 1.0, 0, 0, 0,
+ Tileset::Scheme::XYZ),
+ response);
+
+ test.map.getStyle().loadJSON(R"STYLE({
+ "version": 8,
+ "name": "Water",
+ "sources": {
+ "mapbox": {
+ "type": "vector",
+ "tiles": ["http://example.com/{z}-{x}-{y}.vector.pbf"]
+ }
+ },
+ "layers": [{
+ "id": "background",
+ "type": "background",
+ "paint": {
+ "background-color": "red"
+ }
+ }, {
+ "id": "water",
+ "type": "fill",
+ "source": "mapbox",
+ "source-layer": "water"
+ }]
+ })STYLE");
+
+ test::checkImage("test/fixtures/map/nocontent",
+ test.frontend.render(test.map),
+ 0.0015,
+ 0.1);
+}