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

Unified Diff: third_party/WebKit/Source/platform/loader/fetch/FetchTestingPlatformSupport.cpp

Issue 2584423002: Loading: move core/fetch to platform/loader/fetch (Closed)
Patch Set: another try Created 3 years, 11 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/platform/loader/fetch/FetchTestingPlatformSupport.cpp
diff --git a/third_party/WebKit/Source/core/fetch/FetchTestingPlatformSupport.cpp b/third_party/WebKit/Source/platform/loader/fetch/FetchTestingPlatformSupport.cpp
similarity index 55%
rename from third_party/WebKit/Source/core/fetch/FetchTestingPlatformSupport.cpp
rename to third_party/WebKit/Source/platform/loader/fetch/FetchTestingPlatformSupport.cpp
index ce05ef4fb5c4e5bb98b8ad77c7884dcba3f66641..5f310469b16d744f48cf3f586509ef242cd48a84 100644
--- a/third_party/WebKit/Source/core/fetch/FetchTestingPlatformSupport.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/FetchTestingPlatformSupport.cpp
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "core/fetch/FetchTestingPlatformSupport.h"
+#include "platform/loader/fetch/FetchTestingPlatformSupport.h"
-#include "core/fetch/MockFetchContext.h"
+#include "platform/loader/fetch/MockFetchContext.h"
#include "platform/network/ResourceError.h"
#include "platform/testing/weburl_loader_mock_factory_impl.h"
#include "public/platform/Platform.h"
@@ -15,6 +15,35 @@
namespace blink {
+namespace {
+
+// WebURLLoader that does nothing. This instance should be passed as a default
+// WebURLLoader to create a WebURLLoader through WebURLLoaderMockFactory.
+class AssertWebURLLoader : public WebURLLoader {
+ public:
+ ~AssertWebURLLoader() override {}
+
+ // WebURLLoader:
+ void loadSynchronously(const WebURLRequest&,
+ WebURLResponse&,
+ WebURLError&,
+ WebData&,
+ int64_t& encodedDataLength,
+ int64_t& encodedBodyLength) override {
+ NOTREACHED();
+ }
+ void loadAsynchronously(const WebURLRequest&, WebURLLoaderClient*) override {
+ NOTREACHED();
+ }
+ void cancel() override { NOTREACHED(); }
+ void setDefersLoading(bool defer) override { NOTREACHED(); }
+ void setLoadingTaskRunner(base::SingleThreadTaskRunner*) override {
+ NOTREACHED();
+ }
+};
+
+} // namespace
+
FetchTestingPlatformSupport::FetchTestingPlatformSupport()
: m_urlLoaderMockFactory(new WebURLLoaderMockFactoryImpl(this)) {}
@@ -41,8 +70,7 @@ FetchTestingPlatformSupport::getURLLoaderMockFactory() {
}
WebURLLoader* FetchTestingPlatformSupport::createURLLoader() {
- return m_urlLoaderMockFactory->createURLLoader(
- m_oldPlatform->createURLLoader());
+ return m_urlLoaderMockFactory->createURLLoader(new AssertWebURLLoader);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698