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

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

Issue 2182023002: Bug fix: Fix wrong assumption in ImageResource when adding observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address on hiroshige's review 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 | « third_party/WebKit/Source/core/fetch/ImageResource.cpp ('k') | 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 09937a62189e22198624953086078889bb59b310..ad2747c650f930e72cd9862101f528b7d2af5aa8 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp
+++ b/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp
@@ -231,6 +231,12 @@ TEST(ImageResourceTest, MultipartImage)
ASSERT_EQ(client->imageChangedCount(), 0);
ASSERT_FALSE(client->notifyFinishedCalled());
+ // Add a client to check an assertion error doesn't happen
+ // (crbug.com/630983).
+ Persistent<MockImageResourceClient> client2 = new MockImageResourceClient(cachedImage);
+ ASSERT_EQ(client2->imageChangedCount(), 0);
+ ASSERT_FALSE(client2->notifyFinishedCalled());
+
const char thirdPart[] = "--boundary";
cachedImage->appendData(thirdPart, strlen(thirdPart));
ASSERT_TRUE(cachedImage->resourceBuffer());
@@ -246,6 +252,8 @@ TEST(ImageResourceTest, MultipartImage)
ASSERT_EQ(cachedImage->getImage()->height(), 1);
ASSERT_EQ(client->imageChangedCount(), 1);
ASSERT_TRUE(client->notifyFinishedCalled());
+ ASSERT_EQ(client2->imageChangedCount(), 1);
+ ASSERT_TRUE(client2->notifyFinishedCalled());
}
TEST(ImageResourceTest, CancelOnDetach)
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698