summaryrefslogtreecommitdiff
path: root/test/renderer/image_manager.test.cpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-08-25 11:47:34 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-08-25 12:39:19 +0300
commit11463b796b37183cdfb528f2492537613bf86511 (patch)
tree7ed11089942404d97363029403a33d7837852adb /test/renderer/image_manager.test.cpp
parente3af6503bd839e8283a280698c840f3bcbe5457d (diff)
downloadqtlocation-mapboxgl-upstream/revert-9739.tar.gz
[core] Added GeometryTileWorker-owned image correlation IDupstream/revert-9739
Diffstat (limited to 'test/renderer/image_manager.test.cpp')
-rw-r--r--test/renderer/image_manager.test.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/renderer/image_manager.test.cpp b/test/renderer/image_manager.test.cpp
index 5e6da5c005..ebe1bcd72f 100644
--- a/test/renderer/image_manager.test.cpp
+++ b/test/renderer/image_manager.test.cpp
@@ -108,11 +108,12 @@ TEST(ImageManager, RemoveReleasesBinPackRect) {
class StubImageRequestor : public ImageRequestor {
public:
- void onImagesAvailable(ImageMap images) final {
- if (imagesAvailable) imagesAvailable(images);
+ void onImagesAvailable(ImageMap images, uint64_t imageCorrelationID_) final {
+ if (imagesAvailable && imageCorrelationID == imageCorrelationID_) imagesAvailable(images);
}
std::function<void (ImageMap)> imagesAvailable;
+ uint64_t imageCorrelationID = 0;
};
TEST(ImageManager, NotifiesRequestorWhenSpriteIsLoaded) {
@@ -124,7 +125,8 @@ TEST(ImageManager, NotifiesRequestorWhenSpriteIsLoaded) {
notified = true;
};
- imageManager.getImages(requestor, {"one"});
+ uint64_t imageCorrelationID = 0;
+ imageManager.getImages(requestor, std::make_pair(std::set<std::string> {"one"}, imageCorrelationID));
ASSERT_FALSE(notified);
imageManager.setLoaded(true);
@@ -140,8 +142,9 @@ TEST(ImageManager, NotifiesRequestorImmediatelyIfDependenciesAreSatisfied) {
notified = true;
};
+ uint64_t imageCorrelationID = 0;
imageManager.addImage(makeMutable<style::Image::Impl>("one", PremultipliedImage({ 16, 16 }), 2));
- imageManager.getImages(requestor, {"one"});
+ imageManager.getImages(requestor, std::make_pair(std::set<std::string> {"one"}, imageCorrelationID));
ASSERT_TRUE(notified);
}