diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-06-02 20:22:54 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-06-02 20:43:29 +0300 |
commit | d7465061f8357cf2c5882eaef83b3c57e6c77d74 (patch) | |
tree | 1e7012d0e0c690aadfc3b5da184ec3a8dd599535 /test | |
parent | 5c4c6648d1bbc66b38d702cc28e8bac8c5485247 (diff) | |
download | qtlocation-mapboxgl-d7465061f8357cf2c5882eaef83b3c57e6c77d74.tar.gz |
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.
Diffstat (limited to 'test')
-rw-r--r-- | test/style/resource_loading.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
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<uv::async>(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<Style> style_; - std::unique_ptr<uv::async> asyncUpdate; - std::function<void(std::exception_ptr error)> callback_; }; |