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

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

Issue 2718943003: mv FetchTestingPlatformSupport to platform/loader/testing (Closed)
Patch Set: MCTest fix Created 3 years, 10 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/platform/loader/fetch/FetchTestingPlatformSupport.cpp b/third_party/WebKit/Source/platform/loader/fetch/FetchTestingPlatformSupport.cpp
deleted file mode 100644
index 78bbf33838ba8d8e206b6de4e1d53d0e7bdde0aa..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/platform/loader/fetch/FetchTestingPlatformSupport.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "platform/loader/fetch/FetchTestingPlatformSupport.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"
-#include "public/platform/WebURL.h"
-#include "public/platform/WebURLLoader.h"
-#include "public/platform/WebURLLoaderMockFactory.h"
-#include <memory>
-
-namespace blink {
-
-FetchTestingPlatformSupport::FetchTestingPlatformSupport()
- : m_urlLoaderMockFactory(new WebURLLoaderMockFactoryImpl(this)) {}
-
-FetchTestingPlatformSupport::~FetchTestingPlatformSupport() {
- // Shutdowns WebURLLoaderMockFactory gracefully, serving all pending requests
- // first, then flushing all registered URLs.
- m_urlLoaderMockFactory->serveAsynchronousRequests();
- m_urlLoaderMockFactory->unregisterAllURLsAndClearMemoryCache();
-}
-
-MockFetchContext* FetchTestingPlatformSupport::context() {
- if (!m_context) {
- m_context = MockFetchContext::create(
- MockFetchContext::kShouldLoadNewResource,
- currentThread()->scheduler()->loadingTaskRunner());
- }
- return m_context;
-}
-
-WebURLError FetchTestingPlatformSupport::cancelledError(
- const WebURL& url) const {
- return ResourceError(errorDomainBlinkInternal, -1, url.string(),
- "cancelledError for testing");
-}
-
-WebURLLoaderMockFactory*
-FetchTestingPlatformSupport::getURLLoaderMockFactory() {
- return m_urlLoaderMockFactory.get();
-}
-
-WebURLLoader* FetchTestingPlatformSupport::createURLLoader() {
- return m_urlLoaderMockFactory->createURLLoader(nullptr);
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698