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

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

Issue 174523002: Reland "Move MemoryCache implementation details out of Resource" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 9 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/MemoryCache.cpp ('k') | Source/core/fetch/Resource.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 2af38828f1c89dcbdec0c74916ea589acefb7628..b59e513c6c85876fee22b3d359f8e2b54682a39a 100644
--- a/Source/core/fetch/MemoryCacheTest.cpp
+++ b/Source/core/fetch/MemoryCacheTest.cpp
@@ -184,7 +184,7 @@ TEST_F(MemoryCacheTest, LiveResourceEvictionAtEndOfTask)
memoryCache()->setCapacities(minDeadCapacity, maxDeadCapacity, totalCapacity);
const char data[6] = "abcde";
ResourcePtr<Resource> cachedDeadResource =
- new Resource(ResourceRequest(""), Resource::Raw);
+ new Resource(ResourceRequest("http://foo"), Resource::Raw);
cachedDeadResource->appendData(data, 3);
ResourcePtr<Resource> cachedLiveResource =
new FakeDecodedResource(ResourceRequest(""), Resource::Raw);
@@ -256,7 +256,7 @@ TEST_F(MemoryCacheTest, ClientRemoval)
{
const char data[6] = "abcde";
ResourcePtr<Resource> resource1 =
- new FakeDecodedResource(ResourceRequest(""), Resource::Raw);
+ new FakeDecodedResource(ResourceRequest("http://foo.com"), Resource::Raw);
MockImageResourceClient client1;
resource1->addClient(&client1);
resource1->appendData(data, 4);
@@ -267,7 +267,7 @@ TEST_F(MemoryCacheTest, ClientRemoval)
resource2->appendData(data, 4);
const unsigned minDeadCapacity = 0;
- const unsigned maxDeadCapacity = resource1->size() - 1;
+ const unsigned maxDeadCapacity = ((resource1->size() + resource2->size()) / 2) - 1;
const unsigned totalCapacity = maxDeadCapacity;
memoryCache()->setCapacities(minDeadCapacity, maxDeadCapacity, totalCapacity);
memoryCache()->add(resource1.get());
@@ -308,7 +308,7 @@ TEST_F(MemoryCacheTest, DecodeCacheOrder)
memoryCache()->setDelayBeforeLiveDecodedPrune(0);
memoryCache()->setMaxPruneDeferralDelay(0);
ResourcePtr<FakeDecodedResource> cachedImageLowPriority =
- new FakeDecodedResource(ResourceRequest(""), Resource::Raw);
+ new FakeDecodedResource(ResourceRequest("http://foo.com"), Resource::Raw);
ResourcePtr<FakeDecodedResource> cachedImageHighPriority =
new FakeDecodedResource(ResourceRequest(""), Resource::Raw);
« no previous file with comments | « Source/core/fetch/MemoryCache.cpp ('k') | Source/core/fetch/Resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698