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

Unified Diff: Source/core/fetch/MemoryCacheTest.cpp

Issue 1167583003: Move Resource subclasses out of fetch/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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/ImageResourceTest.cpp ('k') | Source/core/fetch/MockImageResourceClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/MemoryCacheTest.cpp
diff --git a/Source/core/fetch/MemoryCacheTest.cpp b/Source/core/fetch/MemoryCacheTest.cpp
index 57e567d0bd02adbd7828f0f688808322f9e3c0b3..6c52331baf31b7b625a0d284fb2d4b4ad1b8dcf9 100644
--- a/Source/core/fetch/MemoryCacheTest.cpp
+++ b/Source/core/fetch/MemoryCacheTest.cpp
@@ -31,7 +31,6 @@
#include "config.h"
#include "core/fetch/MemoryCache.h"
-#include "core/fetch/MockImageResourceClient.h"
#include "core/fetch/RawResource.h"
#include "core/fetch/ResourcePtr.h"
#include "platform/network/ResourceRequest.h"
@@ -43,6 +42,11 @@
namespace blink {
+class MockResourceClient : public ResourceClient {
+public:
+ MockResourceClient() : ResourceClient() { }
+};
+
class MemoryCacheTest : public ::testing::Test {
public:
class FakeDecodedResource : public Resource {
@@ -125,7 +129,7 @@ TEST_F(MemoryCacheTest, VeryLargeResourceAccounting)
ASSERT_EQ(cachedResource->size(), memoryCache()->deadSize());
ASSERT_EQ(0u, memoryCache()->liveSize());
- MockImageResourceClient client;
+ MockResourceClient client;
cachedResource->addClient(&client);
ASSERT_EQ(0u, memoryCache()->deadSize());
ASSERT_EQ(cachedResource->size(), memoryCache()->liveSize());
@@ -201,7 +205,7 @@ static void TestLiveResourceEvictionAtEndOfTask(Resource* cachedDeadResource, co
memoryCache()->setCapacities(minDeadCapacity, maxDeadCapacity, totalCapacity);
const char data[6] = "abcde";
cachedDeadResource->appendData(data, 3u);
- MockImageResourceClient client;
+ MockResourceClient client;
cachedLiveResource->addClient(&client);
cachedLiveResource->appendData(data, 4u);
@@ -311,10 +315,10 @@ TEST_F(MemoryCacheTest, LiveResourceEvictionAtEndOfTask_MultipleResourceMaps)
static void TestClientRemoval(const ResourcePtr<Resource>& resource1, const ResourcePtr<Resource>& resource2)
{
const char data[6] = "abcde";
- MockImageResourceClient client1;
+ MockResourceClient client1;
resource1->addClient(&client1);
resource1->appendData(data, 4u);
- MockImageResourceClient client2;
+ MockResourceClient client2;
resource2->addClient(&client2);
resource2->appendData(data, 4u);
@@ -401,8 +405,8 @@ static void TestDecodeCacheOrder(const ResourcePtr<Resource>& cachedImageLowPrio
memoryCache()->setDelayBeforeLiveDecodedPrune(0);
memoryCache()->setMaxPruneDeferralDelay(0);
- MockImageResourceClient clientLowPriority;
- MockImageResourceClient clientHighPriority;
+ MockResourceClient clientLowPriority;
+ MockResourceClient clientHighPriority;
cachedImageLowPriority->addClient(&clientLowPriority);
cachedImageHighPriority->addClient(&clientHighPriority);
« no previous file with comments | « Source/core/fetch/ImageResourceTest.cpp ('k') | Source/core/fetch/MockImageResourceClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698