[core] Do not make pending requests for already requested images.
so that processing for the corresponding tile does not suspend and the rendering performance is not affected.
This commit is contained in:
@@ -187,20 +187,14 @@ 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();
|
||||
ASSERT_TRUE(requestor.hasPendingRequests());
|
||||
|
||||
EXPECT_EQ(observer.count, 2);
|
||||
runLoop.runOnce();
|
||||
ASSERT_FALSE(requestor.hasPendingRequests());
|
||||
|
||||
// Another requestor shall not have pending requests for already obtained images.
|
||||
StubImageRequestor anotherRequestor(imageManager);
|
||||
|
||||
Reference in New Issue
Block a user