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

Unified Diff: Source/core/frame/ImageBitmapTest.cpp

Issue 1327653004: Have uses of MockImageResourceClient leak less. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clean up MockImageResourceClient somewhat Created 5 years, 3 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 | « Source/core/fetch/ResourceFetcherTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/ImageBitmapTest.cpp
diff --git a/Source/core/frame/ImageBitmapTest.cpp b/Source/core/frame/ImageBitmapTest.cpp
index 8f13a2806890f33ca7323c161b69b0aa442d6fa1..5f8593e2f1d95143a9baa751f4963775f62c5440 100644
--- a/Source/core/frame/ImageBitmapTest.cpp
+++ b/Source/core/frame/ImageBitmapTest.cpp
@@ -129,11 +129,10 @@ TEST_F(ImageBitmapTest, ImageBitmapLiveResourcePriority)
StaticBitmapImage::create(m_image).get());
imageOutsideCrop->setImageResource(cachedImageOutsideCrop.get());
- MockImageResourceClient mockClient1, mockClient2, mockClient3, mockClient4;
- cachedImageNoCrop->addClient(&mockClient1);
- cachedImageInteriorCrop->addClient(&mockClient2);
- cachedImageExteriorCrop->addClient(&mockClient3);
- cachedImageOutsideCrop->addClient(&mockClient4);
+ MockImageResourceClient mockClient1(cachedImageNoCrop);
+ MockImageResourceClient mockClient2(cachedImageInteriorCrop);
+ MockImageResourceClient mockClient3(cachedImageExteriorCrop);
+ MockImageResourceClient mockClient4(cachedImageOutsideCrop);
memoryCache()->add(cachedImageNoCrop.get());
memoryCache()->add(cachedImageInteriorCrop.get());
@@ -181,11 +180,6 @@ TEST_F(ImageBitmapTest, ImageBitmapLiveResourcePriority)
// There is still an ImageBitmap that references this image.
ASSERT_EQ(memoryCache()->priority(imageInteriorCrop->cachedImage()), MemoryCacheLiveResourcePriorityHigh);
imageBitmapInteriorCrop = nullptr;
-
- cachedImageNoCrop->removeClient(&mockClient1);
- cachedImageInteriorCrop->removeClient(&mockClient2);
- cachedImageExteriorCrop->removeClient(&mockClient3);
- cachedImageOutsideCrop->removeClient(&mockClient4);
}
// Verifies that ImageBitmaps constructed from HTMLImageElements hold a reference to the original Image if the HTMLImageElement src is changed.
« no previous file with comments | « Source/core/fetch/ResourceFetcherTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698