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

Unified Diff: third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp

Issue 1845323002: Remove WebUnitTestSupport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp
index ed069f85a634600e793560da4d5eb41cda6f4b2a..6d565e3369e5f16cc2f75af42d987695a7370783 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp
@@ -42,8 +42,8 @@
#include "platform/testing/URLTestHelpers.h"
#include "platform/weborigin/KURL.h"
#include "public/platform/Platform.h"
+#include "public/platform/WebURLLoaderMockFactory.h"
#include "public/platform/WebURLResponse.h"
-#include "public/platform/WebUnitTestSupport.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
@@ -134,12 +134,12 @@ TEST_F(ResourceFetcherTest, Vary)
ResourceFetcher* fetcher = ResourceFetcher::create(ResourceFetcherTestMockFetchContext::create());
FetchRequest fetchRequest = FetchRequest(url, FetchInitiatorInfo());
- Platform::current()->unitTestSupport()->registerMockedURL(url, WebURLResponse(), "");
+ Platform::current()->getURLLoaderMockFactory()->registerURL(url, WebURLResponse(), "");
Resource* newResource = fetcher->requestResource(fetchRequest, TestResourceFactory());
EXPECT_NE(resource, newResource);
newResource->loader()->cancel();
memoryCache()->remove(newResource);
- Platform::current()->unitTestSupport()->unregisterMockedURL(url);
+ Platform::current()->getURLLoaderMockFactory()->unregisterURL(url);
memoryCache()->remove(resource);
}
@@ -184,7 +184,7 @@ TEST_F(ResourceFetcherTest, VaryImage)
FetchRequest fetchRequestOriginal = FetchRequest(url, FetchInitiatorInfo());
Resource* resource = fetcher->requestResource(fetchRequestOriginal, TestResourceFactory(Resource::Image));
ASSERT_TRUE(resource);
- Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests();
+ Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests();
ASSERT_TRUE(resource->hasVaryHeader());
FetchRequest fetchRequest = FetchRequest(url, FetchInitiatorInfo());
@@ -192,13 +192,13 @@ TEST_F(ResourceFetcherTest, VaryImage)
EXPECT_EQ(resource, newResource);
memoryCache()->remove(newResource);
- Platform::current()->unitTestSupport()->unregisterMockedURL(url);
+ Platform::current()->getURLLoaderMockFactory()->unregisterURL(url);
}
TEST_F(ResourceFetcherTest, RevalidateWhileLoading)
{
KURL url(ParsedURLString, "http://127.0.0.1:8000/foo.html");
- Platform::current()->unitTestSupport()->registerMockedURL(url, WebURLResponse(), "");
+ Platform::current()->getURLLoaderMockFactory()->registerURL(url, WebURLResponse(), "");
ResourceFetcher* fetcher1 = ResourceFetcher::create(ResourceFetcherTestMockFetchContext::create());
ResourceRequest request1(url);
@@ -222,7 +222,7 @@ TEST_F(ResourceFetcherTest, RevalidateWhileLoading)
// Tidily(?) shut down the ResourceLoader.
resource1->loader()->cancel();
- Platform::current()->unitTestSupport()->unregisterMockedURL(url);
+ Platform::current()->getURLLoaderMockFactory()->unregisterURL(url);
}
TEST_F(ResourceFetcherTest, DontReuseMediaDataUrl)
@@ -242,7 +242,7 @@ class ServeRequestsOnCompleteClient : public RawResourceClient {
public:
void notifyFinished(Resource*) override
{
- Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests();
+ Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests();
}
// No callbacks should be received except for the notifyFinished()
@@ -277,7 +277,7 @@ TEST_F(ResourceFetcherTest, ResponseOnCancel)
ServeRequestsOnCompleteClient client;
resource->addClient(&client);
resource->loader()->cancel();
- Platform::current()->unitTestSupport()->unregisterMockedURL(url);
+ Platform::current()->getURLLoaderMockFactory()->unregisterURL(url);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/fetch/RawResourceTest.cpp ('k') | third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698