Index: third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp |
diff --git a/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp b/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp |
index 3224ca770e8408c423130bb22e676fcc47f811ee..5476023e900d940413b5d9706591df147ec88287 100644 |
--- a/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp |
+++ b/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp |
@@ -167,7 +167,7 @@ TEST(ImageResourceTest, MultipartImage) |
// This part finishes. The image is created, callbacks are sent, and the data buffer is cleared. |
cachedImage->loader()->didFinishLoading(nullptr, 0.0, 0); |
- ASSERT_FALSE(cachedImage->resourceBuffer()); |
+ ASSERT_TRUE(cachedImage->resourceBuffer()); |
ASSERT_FALSE(cachedImage->errorOccurred()); |
ASSERT_TRUE(cachedImage->hasImage()); |
ASSERT_FALSE(cachedImage->getImage()->isNull()); |
@@ -232,12 +232,14 @@ TEST(ImageResourceTest, DecodedDataRemainsWhileHasClients) |
ASSERT_TRUE(cachedImage->hasImage()); |
ASSERT_FALSE(cachedImage->getImage()->isNull()); |
- // The ImageResource no longer has clients. The image should be deleted by prune. |
+ // The ImageResource no longer has clients. The decoded image data should be |
+ // deleted by prune. |
client->removeAsClient(); |
cachedImage->prune(); |
ASSERT_FALSE(cachedImage->hasClientsOrObservers()); |
- ASSERT_FALSE(cachedImage->hasImage()); |
- ASSERT_TRUE(cachedImage->getImage()->isNull()); |
+ ASSERT_TRUE(cachedImage->hasImage()); |
+ // TODO(hajimehoshi): Should check cachedImage doesn't have decoded image |
+ // data. |
} |
TEST(ImageResourceTest, UpdateBitmapImages) |
@@ -287,9 +289,9 @@ TEST(ImageResourceTest, ReloadIfLoFi) |
cachedImage->reloadIfLoFi(fetcher); |
ASSERT_FALSE(cachedImage->errorOccurred()); |
- ASSERT_FALSE(cachedImage->resourceBuffer()); |
+ ASSERT_TRUE(cachedImage->resourceBuffer()); |
ASSERT_TRUE(cachedImage->hasImage()); |
- ASSERT_EQ(client->imageChangedCount(), 3); |
+ ASSERT_EQ(client->imageChangedCount(), 2); |
cachedImage->loader()->didReceiveResponse(nullptr, WrappedResourceResponse(resourceResponse), nullptr); |
cachedImage->loader()->didReceiveData(nullptr, reinterpret_cast<const char*>(jpeg.data()), jpeg.size(), jpeg.size()); |