From d7465061f8357cf2c5882eaef83b3c57e6c77d74 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Tue, 2 Jun 2015 20:22:54 +0300 Subject: Do not call update() asynchronously on the test case We need to call it before checking if the tiles are loaded to give the Source a chance to request for more tiles if it is needed. --- test/style/resource_loading.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/style/resource_loading.cpp b/test/style/resource_loading.cpp index 5f7195d9b6..de3e6b812e 100644 --- a/test/style/resource_loading.cpp +++ b/test/style/resource_loading.cpp @@ -26,9 +26,7 @@ public: : env_(fileSource), envScope_(env_, ThreadType::Map, "Map"), data_(view, MapMode::Still), - asyncUpdate(std::make_unique(loop, [this] { update(); })), callback_(callback) { - asyncUpdate->unref(); data_.transform.resize(1000, 1000, 1.0, 1000, 1000); data_.transform.setLatLngZoom({0, 0}, 16); @@ -55,11 +53,11 @@ public: // Style::Observer implementation. void onTileDataChanged() override { + update(); + if (style_->isLoaded()) { callback_(nullptr); } - - asyncUpdate->send(); }; void onResourceLoadingFailed(std::exception_ptr error) override { @@ -76,8 +74,6 @@ private: std::unique_ptr