[core] Revert coalescing requests to the client for the same missing image

This commit is contained in:
Mikhail Pozdnyakov
2019-10-24 13:13:01 +03:00
parent 4fb75ba32c
commit 424cf20207
3 changed files with 33 additions and 79 deletions

View File

@@ -187,30 +187,6 @@ 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);
// Another requestor shall not have pending requests for already obtained images.
StubImageRequestor anotherRequestor(imageManager);
imageManager.getImages(anotherRequestor, std::make_pair(dependencies, ++imageCorrelationID));
ASSERT_FALSE(anotherRequestor.hasPendingRequests());
dependencies.emplace("unfamiliar", ImageType::Icon);
imageManager.getImages(anotherRequestor, std::make_pair(dependencies, ++imageCorrelationID));
EXPECT_TRUE(anotherRequestor.hasPendingRequests());
EXPECT_TRUE(anotherRequestor.hasPendingRequest("unfamiliar"));
}
TEST(ImageManager, OnStyleImageMissingAfterSpriteLoaded) {