diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-10-08 22:54:54 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-10-10 15:39:34 +0300 |
commit | ef8540b68373d2474449e6e5f17eaaaaab7c7f9a (patch) | |
tree | 9589dd86c00e4c8f6c3074992efa51f66cab9b78 /test | |
parent | 71047ab8534462def95537bc15ad7b726df5c1b3 (diff) | |
download | qtlocation-mapboxgl-ef8540b68373d2474449e6e5f17eaaaaab7c7f9a.tar.gz |
[core] Update ImageManager.OnStyleImageMissingBeforeSpriteLoaded unit test
So that it checks missing images requests coalescing.
Diffstat (limited to 'test')
-rw-r--r-- | test/renderer/image_manager.test.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/renderer/image_manager.test.cpp b/test/renderer/image_manager.test.cpp index 16700d713f..f1061ce59e 100644 --- a/test/renderer/image_manager.test.cpp +++ b/test/renderer/image_manager.test.cpp @@ -187,6 +187,20 @@ TEST(ImageManager, OnStyleImageMissingBeforeSpriteLoaded) { EXPECT_EQ(observer.count, 1); ASSERT_TRUE(notified); + // Repeated request of the same image shall not result another + // `ImageManagerObserver.onStyleImageMissing()` call. + imageManager.getImages(requestor, std::make_pair(dependencies, imageCorrelationID)); + runLoop.runOnce(); + + EXPECT_EQ(observer.count, 1); + + // Request for updated dependencies must be dispatched to the + // observer. + dependencies.emplace("post", ImageType::Icon); + imageManager.getImages(requestor, std::make_pair(dependencies, imageCorrelationID)); + runLoop.runOnce(); + + EXPECT_EQ(observer.count, 2); } TEST(ImageManager, OnStyleImageMissingAfterSpriteLoaded) { |