summaryrefslogtreecommitdiff
path: root/test/map
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-02-24 16:03:31 +0100
committerKonstantin Käfer <mail@kkaefer.com>2017-02-27 16:51:17 -0800
commit9ca9adf69c4ad1d946af611c3d08800e0e301fb8 (patch)
treedf70792e808ce57e0154f4a253a6a40dbb91b50d /test/map
parente3500c1f791be82d64b50c7fa80b29b4e3c8a031 (diff)
downloadqtlocation-mapboxgl-9ca9adf69c4ad1d946af611c3d08800e0e301fb8.tar.gz
[core] private OffscreenView implementation
Diffstat (limited to 'test/map')
-rw-r--r--test/map/map.test.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp
index a00a4efacc..618c2e6a74 100644
--- a/test/map/map.test.cpp
+++ b/test/map/map.test.cpp
@@ -34,7 +34,7 @@ struct MapTest {
TEST(Map, LatLngBehavior) {
MapTest test;
- Map map(test.backend, test.view.size, 1, test.fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
@@ -68,7 +68,7 @@ TEST(Map, Offline) {
fileSource.put(Resource::glyphs(prefix + "{fontstack}/{range}.pbf", {{"Helvetica"}}, {0, 255}), expiredItem("glyph.pbf"));
NetworkStatus::Set(NetworkStatus::Status::Offline);
- Map map(test.backend, test.view.size, 1, fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, fileSource, test.threadPool, MapMode::Still);
map.setStyleURL(prefix + "style.json");
test::checkImage("test/fixtures/map/offline",
@@ -92,7 +92,7 @@ TEST(Map, SetStyleInvalidJSON) {
});
{
- Map map(test.backend, test.view.size, 1, test.fileSource, test.threadPool,
+ Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool,
MapMode::Still);
map.setStyleJSON("invalid");
}
@@ -124,7 +124,7 @@ TEST(Map, SetStyleInvalidURL) {
}
});
- Map map(test.backend, test.view.size, 1, test.fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool, MapMode::Still);
map.setStyleURL("mapbox://bar");
test.runLoop.run();
@@ -133,7 +133,7 @@ TEST(Map, SetStyleInvalidURL) {
TEST(Map, DoubleStyleLoad) {
MapTest test;
- Map map(test.backend, test.view.size, 1, test.fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool, MapMode::Still);
map.setStyleJSON("");
map.setStyleJSON("");
}
@@ -144,7 +144,7 @@ TEST(Map, StyleFresh) {
MapTest test;
FakeFileSource fileSource;
- Map map(test.backend, test.view.size, 1, fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, fileSource, test.threadPool, MapMode::Still);
map.setStyleURL("mapbox://styles/test");
EXPECT_EQ(1u, fileSource.requests.size());
@@ -164,7 +164,7 @@ TEST(Map, StyleExpired) {
MapTest test;
FakeFileSource fileSource;
- Map map(test.backend, test.view.size, 1, fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, fileSource, test.threadPool, MapMode::Still);
map.setStyleURL("mapbox://styles/test");
EXPECT_EQ(1u, fileSource.requests.size());
@@ -191,7 +191,7 @@ TEST(Map, StyleExpiredWithAnnotations) {
MapTest test;
FakeFileSource fileSource;
- Map map(test.backend, test.view.size, 1, fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, fileSource, test.threadPool, MapMode::Still);
map.setStyleURL("mapbox://styles/test");
EXPECT_EQ(1u, fileSource.requests.size());
@@ -215,7 +215,7 @@ TEST(Map, StyleEarlyMutation) {
MapTest test;
FakeFileSource fileSource;
- Map map(test.backend, test.view.size, 1, fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, fileSource, test.threadPool, MapMode::Still);
map.setStyleURL("mapbox://styles/test");
map.addLayer(std::make_unique<style::BackgroundLayer>("bg"));
@@ -229,7 +229,7 @@ TEST(Map, StyleEarlyMutation) {
TEST(Map, StyleLoadedSignal) {
MapTest test;
- Map map(test.backend, test.view.size, 1, test.fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool, MapMode::Still);
// The map should emit a signal on style loaded
bool emitted = false;
@@ -252,7 +252,7 @@ TEST(Map, TEST_REQUIRES_SERVER(StyleNetworkErrorRetry)) {
MapTest test;
OnlineFileSource fileSource;
- Map map(test.backend, test.view.size, 1, fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, fileSource, test.threadPool, MapMode::Still);
map.setStyleURL("http://127.0.0.1:3000/style-fail-once-500");
test.backend.setMapChangeCallback([&](MapChange change) {
@@ -268,7 +268,7 @@ TEST(Map, TEST_REQUIRES_SERVER(StyleNotFound)) {
MapTest test;
OnlineFileSource fileSource;
- Map map(test.backend, test.view.size, 1, fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, fileSource, test.threadPool, MapMode::Still);
map.setStyleURL("http://127.0.0.1:3000/style-fail-once-404");
using namespace std::chrono_literals;
@@ -297,7 +297,7 @@ TEST(Map, TEST_REQUIRES_SERVER(StyleNotFound)) {
TEST(Map, AddLayer) {
MapTest test;
- Map map(test.backend, test.view.size, 1, test.fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
auto layer = std::make_unique<BackgroundLayer>("background");
@@ -319,7 +319,7 @@ TEST(Map, WithoutVAOExtension) {
DefaultFileSource fileSource(":memory:", "test/fixtures/api/assets");
#endif
- Map map(test.backend, test.view.size, 1, fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, fileSource, test.threadPool, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/water.json"));
test::checkImage("test/fixtures/map/no_vao", test::render(map, test.view), 0.002);
@@ -328,7 +328,7 @@ TEST(Map, WithoutVAOExtension) {
TEST(Map, RemoveLayer) {
MapTest test;
- Map map(test.backend, test.view.size, 1, test.fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
auto layer = std::make_unique<BackgroundLayer>("background");
@@ -353,7 +353,7 @@ TEST(Map, DisabledSources) {
return {};
};
- Map map(test.backend, test.view.size, 1, test.fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool, MapMode::Still);
map.setZoom(1);
// This stylesheet has two raster layers, one that starts at zoom 1, the other at zoom 0.
@@ -403,7 +403,7 @@ TEST(Map, DisabledSources) {
TEST(Map, Classes) {
MapTest test;
- Map map(test.backend, test.view.size, 1, test.fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
EXPECT_FALSE(map.getTransitionOptions().duration);
@@ -437,7 +437,7 @@ TEST(Map, Classes) {
TEST(Map, AddImage) {
MapTest test;
- Map map(test.backend, test.view.size, 1, test.fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool, MapMode::Still);
auto decoded1 = decodeImage(util::read_file("test/fixtures/sprites/default_marker.png"));
auto decoded2 = decodeImage(util::read_file("test/fixtures/sprites/default_marker.png"));
auto image1 = std::make_unique<SpriteImage>(std::move(decoded1), 1.0);
@@ -454,7 +454,7 @@ TEST(Map, AddImage) {
TEST(Map, RemoveImage) {
MapTest test;
- Map map(test.backend, test.view.size, 1, test.fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool, MapMode::Still);
auto decoded = decodeImage(util::read_file("test/fixtures/sprites/default_marker.png"));
auto image = std::make_unique<SpriteImage>(std::move(decoded), 1.0);
@@ -467,7 +467,7 @@ TEST(Map, RemoveImage) {
TEST(Map, GetImage) {
MapTest test;
- Map map(test.backend, test.view.size, 1, test.fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool, MapMode::Still);
auto decoded = decodeImage(util::read_file("test/fixtures/sprites/default_marker.png"));
auto image = std::make_unique<SpriteImage>(std::move(decoded), 1.0);
@@ -479,7 +479,7 @@ TEST(Map, GetImage) {
TEST(Map, DontLoadUnneededTiles) {
MapTest test;
- Map map(test.backend, test.view.size, 1, test.fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, test.view.getSize(), 1, test.fileSource, test.threadPool, MapMode::Still);
map.setStyleJSON(R"STYLE({
"sources": {
"a": { "type": "vector", "tiles": [ "a/{z}/{x}/{y}" ] }
@@ -552,7 +552,7 @@ TEST(Map, TEST_DISABLED_ON_CI(ContinuousRendering)) {
DefaultFileSource fileSource(":memory:", "test/fixtures/api/assets");
#endif
- Map map(backend, view.size, 1, fileSource, threadPool, MapMode::Continuous);
+ Map map(backend, view.getSize(), 1, fileSource, threadPool, MapMode::Continuous);
using namespace std::chrono_literals;