summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-01-18 18:43:58 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-01-19 16:06:37 +0200
commit2010fbb0e61cbe7c0b08560118ca887fc1d7193e (patch)
tree4b3c92499e47438fb7f64a046ab000037b81957c /test
parenta361ce47a19d37b96b48cd605c62c5ab79bba462 (diff)
downloadqtlocation-mapboxgl-2010fbb0e61cbe7c0b08560118ca887fc1d7193e.tar.gz
[linux] Replace PNG with WebP on tile source URL
This is a hack, in the same fashion as adding {ratio} to the tile URLs. We should update the raster tile sources to use WebP by default.
Diffstat (limited to 'test')
-rw-r--r--test/miscellaneous/mapbox.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/miscellaneous/mapbox.cpp b/test/miscellaneous/mapbox.cpp
index 02a08db9ee..d6f9948e66 100644
--- a/test/miscellaneous/mapbox.cpp
+++ b/test/miscellaneous/mapbox.cpp
@@ -37,10 +37,17 @@ TEST(Mapbox, SpriteURL) {
TEST(Mapbox, TileURL) {
try {
+#if defined(__ANDROID__) || defined(__APPLE__)
EXPECT_EQ("http://path.png/tile{ratio}.png", mbgl::util::mapbox::normalizeRasterTileURL("http://path.png/tile.png"));
EXPECT_EQ("http://path.png/tile{ratio}.png32", mbgl::util::mapbox::normalizeRasterTileURL("http://path.png/tile.png32"));
EXPECT_EQ("http://path.png/tile{ratio}.png70", mbgl::util::mapbox::normalizeRasterTileURL("http://path.png/tile.png70"));
EXPECT_EQ("http://path.png/tile{ratio}.png?access_token=foo", mbgl::util::mapbox::normalizeRasterTileURL("http://path.png/tile.png?access_token=foo"));
+#else
+ EXPECT_EQ("http://path.png/tile{ratio}.webp", mbgl::util::mapbox::normalizeRasterTileURL("http://path.png/tile.png"));
+ EXPECT_EQ("http://path.png/tile{ratio}.webp32", mbgl::util::mapbox::normalizeRasterTileURL("http://path.png/tile.png32"));
+ EXPECT_EQ("http://path.png/tile{ratio}.webp70", mbgl::util::mapbox::normalizeRasterTileURL("http://path.png/tile.png70"));
+ EXPECT_EQ("http://path.png/tile{ratio}.webp?access_token=foo", mbgl::util::mapbox::normalizeRasterTileURL("http://path.png/tile.png?access_token=foo"));
+#endif // defined(__ANDROID__) || defined(__APPLE__)
EXPECT_EQ("http://path.png/tile{ratio}.pbf", mbgl::util::mapbox::normalizeRasterTileURL("http://path.png/tile.pbf"));
EXPECT_EQ("http://path.png/tile{ratio}.pbf?access_token=foo", mbgl::util::mapbox::normalizeRasterTileURL("http://path.png/tile.pbf?access_token=foo"));
EXPECT_EQ("http://path.png/tile{ratio}.pbf?access_token=foo.png", mbgl::util::mapbox::normalizeRasterTileURL("http://path.png/tile.pbf?access_token=foo.png"));