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

Unified Diff: third_party/WebKit/Source/core/fetch/FetchTestingPlatformSupport.h

Issue 2644083003: ResourceFetcherTest: introduce FetchTestingPlatformSupport (Closed)
Patch Set: review #23 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/core/fetch/FetchTestingPlatformSupport.h
diff --git a/third_party/WebKit/Source/core/fetch/FetchTestingPlatformSupport.h b/third_party/WebKit/Source/core/fetch/FetchTestingPlatformSupport.h
new file mode 100644
index 0000000000000000000000000000000000000000..48c4d29d9f4bccfa259466ee0845ac6c27d5ce5c
--- /dev/null
+++ b/third_party/WebKit/Source/core/fetch/FetchTestingPlatformSupport.h
@@ -0,0 +1,40 @@
+// 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.
+
+#ifndef FetchTestingPlatformSupport_h
+#define FetchTestingPlatformSupport_h
+
+#include "platform/heap/Persistent.h"
+#include "platform/testing/TestingPlatformSupport.h"
+#include <memory>
+
+namespace blink {
+
+class MockFetchContext;
+
+class FetchTestingPlatformSupport
+ : public TestingPlatformSupportWithMockScheduler {
+ public:
+ FetchTestingPlatformSupport();
+ ~FetchTestingPlatformSupport() override;
+
+ MockFetchContext* context();
+
+ // Platform:
+ WebURLError cancelledError(const WebURL&) const override;
+ WebURLLoaderMockFactory* getURLLoaderMockFactory() override;
+ WebURLLoader* createURLLoader() override;
+
+ private:
+ class FetchTestingWebURLLoaderMockFactory;
+
+ Persistent<MockFetchContext> m_context;
+ std::unique_ptr<WebURLLoaderMockFactory> m_urlLoaderMockFactory;
+
+ DISALLOW_COPY_AND_ASSIGN(FetchTestingPlatformSupport);
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698