Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(979)

Unified Diff: third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp

Issue 2122123002: Add a test for a multipart image as cache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 daf35bd190b5dc7fb3e7d2aa8af05bc32d68e32f..1930c248b316b41e24964fc9f7a840689f75ac2a 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp
+++ b/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp
@@ -245,6 +245,13 @@ TEST(ImageResourceTest, MultipartImage)
ASSERT_EQ(cachedImage->getImage()->height(), 1);
ASSERT_EQ(client->imageChangedCount(), 1);
ASSERT_TRUE(client->notifyFinishedCalled());
+
+ // When the multipart image is retrieved from the cache, the image is empty.
+ cachedImage = ImageResource::create(ResourceRequest(testURL));
+ ASSERT_FALSE(cachedImage->resourceBuffer());
+ ASSERT_FALSE(cachedImage->errorOccurred());
+ ASSERT_FALSE(cachedImage->hasImage());
+ ASSERT_TRUE(cachedImage->getImage()->isNull());
}
TEST(ImageResourceTest, CancelOnDetach)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698