Index: third_party/WebKit/Source/platform/loader/fetch/MemoryCacheTest.cpp |
diff --git a/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheTest.cpp |
similarity index 97% |
rename from third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp |
rename to third_party/WebKit/Source/platform/loader/fetch/MemoryCacheTest.cpp |
index a6465be606cb37fec618d7f70f210ff48a02ce84..fc66cea97f03e7a866c44f75cf5f9a35c92e7e74 100644 |
--- a/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp |
+++ b/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheTest.cpp |
@@ -28,11 +28,12 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#include "core/fetch/MemoryCache.h" |
+#include "platform/loader/fetch/MemoryCache.h" |
-#include "core/fetch/MockResourceClient.h" |
-#include "core/fetch/RawResource.h" |
+#include "platform/loader/fetch/MockResourceClient.h" |
+#include "platform/loader/fetch/RawResource.h" |
#include "platform/network/ResourceRequest.h" |
+#include "platform/testing/TestingPlatformSupport.h" |
#include "platform/testing/UnitTestHelpers.h" |
#include "public/platform/Platform.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -180,20 +181,24 @@ static void testResourcePruningAtEndOfTask(Resource* resource1, |
WTF::bind(&runTask2, |
resource1->encodedSize() + resource1->overheadSize() + |
resource2->encodedSize() + resource2->overheadSize())); |
- testing::runPendingTasks(); |
} |
// Verified that when ordering a prune in a runLoop task, the prune |
// is deferred to the end of the task. |
TEST_F(MemoryCacheTest, ResourcePruningAtEndOfTask_Basic) { |
+ ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler> |
+ platform; |
Resource* resource1 = FakeDecodedResource::create( |
ResourceRequest("http://test/resource1"), Resource::Raw); |
Resource* resource2 = FakeDecodedResource::create( |
ResourceRequest("http://test/resource2"), Resource::Raw); |
testResourcePruningAtEndOfTask(resource1, resource2); |
+ platform->runUntilIdle(); |
} |
TEST_F(MemoryCacheTest, ResourcePruningAtEndOfTask_MultipleResourceMaps) { |
+ ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler> |
+ platform; |
{ |
Resource* resource1 = FakeDecodedResource::create( |
ResourceRequest("http://test/resource1"), Resource::Raw); |
@@ -201,6 +206,7 @@ TEST_F(MemoryCacheTest, ResourcePruningAtEndOfTask_MultipleResourceMaps) { |
ResourceRequest("http://test/resource2"), Resource::Raw); |
resource1->setCacheIdentifier("foo"); |
testResourcePruningAtEndOfTask(resource1, resource2); |
+ platform->runUntilIdle(); |
memoryCache()->evictResources(); |
} |
{ |
@@ -211,6 +217,7 @@ TEST_F(MemoryCacheTest, ResourcePruningAtEndOfTask_MultipleResourceMaps) { |
resource1->setCacheIdentifier("foo"); |
resource2->setCacheIdentifier("bar"); |
testResourcePruningAtEndOfTask(resource1, resource2); |
+ platform->runUntilIdle(); |
memoryCache()->evictResources(); |
} |
} |