summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp
diff options
context:
space:
mode:
authorhiroshige <hiroshige@chromium.org>2016-03-25 17:50:09 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-26 00:52:02 +0000
commita4581858f57e20724f9b8a3166ef9c864f79a758 (patch)
treee4cd0359bc77080c16949c5f287f939906bb0aff /third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp
parenta36877470caa77972faf9a1313eba92d8cd67fde (diff)
downloadchromium_src-a4581858f57e20724f9b8a3166ef9c864f79a758.zip
chromium_src-a4581858f57e20724f9b8a3166ef9c864f79a758.tar.gz
chromium_src-a4581858f57e20724f9b8a3166ef9c864f79a758.tar.bz2
Split ImageResourceClient into ResourceClient and ImageResourceObserver [1/2]
We are planning to move ResourceClient to on-heap, but LayoutObject (an ImageResourceClient subclass) is hard to move to on-heap. This series of CLs splits ImageResourceClient into - ResourceClient (notified via Resource, to be moved to Oilpan heap) and - ImageResourceObserver (notified via ImageObserver, to remain non-heap) and makes LayoutObject to be ImageResourceObserver but not ResourceClient. This is the [1/2] CL that - Splits ImageResourceClient into ResourceClient and ImageResourceObserver, - Makes LayoutObject and all of its subclasses (except for LayoutImage and its subclasses) to be ImageResourceObserver but not ResourceClient. LayoutImage will be made non-ResourceClient by the [2/2] CL: https://codereview.chromium.org/1728313003/. Original CL: https://codereview.chromium.org/1697713002/ by Nate Chapin. In addition to Nate's original CL (Patch Set 1), this CL: - Fixes layout test (Patch Set 2). - Reuses ResourceClientWalker to iterate ImageResourceObserver (Patch Set 3). - Handles ResourceClient and ImageResourceObserver more similarly (Patch Set 4). - Renames methods to reflect whether they are for both ResourceClient and ImageResourceObserver (Patch Set 6). BUG=587663 Review URL: https://codereview.chromium.org/1706083002 Cr-Commit-Position: refs/heads/master@{#383425}
Diffstat (limited to 'third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp')
-rw-r--r--third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp b/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp
index c3ecd53..4e7a570 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp
+++ b/third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp
@@ -30,9 +30,8 @@
#include "core/fetch/ImageResource.h"
-#include "core/fetch/ImageResourceClient.h"
#include "core/fetch/MemoryCache.h"
-#include "core/fetch/MockImageResourceClient.h"
+#include "core/fetch/MockResourceClients.h"
#include "core/fetch/ResourceFetcher.h"
#include "core/fetch/ResourceLoader.h"
#include "core/fetch/UniqueIdentifier.h"
@@ -195,14 +194,14 @@ TEST(ImageResourceTest, DecodedDataRemainsWhileHasClients)
// The prune comes when the ImageResource still has clients. The image should not be deleted.
cachedImage->prune();
- ASSERT_TRUE(cachedImage->hasClients());
+ ASSERT_TRUE(cachedImage->hasClientsOrObservers());
ASSERT_TRUE(cachedImage->hasImage());
ASSERT_FALSE(cachedImage->getImage()->isNull());
// The ImageResource no longer has clients. The image should be deleted by prune.
client.removeAsClient();
cachedImage->prune();
- ASSERT_FALSE(cachedImage->hasClients());
+ ASSERT_FALSE(cachedImage->hasClientsOrObservers());
ASSERT_FALSE(cachedImage->hasImage());
ASSERT_TRUE(cachedImage->getImage()->isNull());
}