OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WebURLLoaderMockFactoryImpl_h | 5 #ifndef WebURLLoaderMockFactoryImpl_h |
6 #define WebURLLoaderMockFactoryImpl_h | 6 #define WebURLLoaderMockFactoryImpl_h |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 // A factory that creates WebURLLoaderMock to simulate resource loading in | 30 // A factory that creates WebURLLoaderMock to simulate resource loading in |
31 // tests. Since there are restriction and rules to follow, please read comments | 31 // tests. Since there are restriction and rules to follow, please read comments |
32 // in WebURLLoaderMockFactory carefully to use this class correctly. | 32 // in WebURLLoaderMockFactory carefully to use this class correctly. |
33 class WebURLLoaderMockFactoryImpl : public WebURLLoaderMockFactory { | 33 class WebURLLoaderMockFactoryImpl : public WebURLLoaderMockFactory { |
34 public: | 34 public: |
35 WebURLLoaderMockFactoryImpl(TestingPlatformSupport*); | 35 WebURLLoaderMockFactoryImpl(TestingPlatformSupport*); |
36 ~WebURLLoaderMockFactoryImpl() override; | 36 ~WebURLLoaderMockFactoryImpl() override; |
37 | 37 |
38 // WebURLLoaderMockFactory: | 38 // WebURLLoaderMockFactory: |
39 WebURLLoader* CreateURLLoader(WebURLLoader* default_loader) override; | 39 std::unique_ptr<WebURLLoader> CreateURLLoader( |
| 40 std::unique_ptr<WebURLLoader> default_loader) override; |
40 void RegisterURL(const WebURL& url, | 41 void RegisterURL(const WebURL& url, |
41 const WebURLResponse& response, | 42 const WebURLResponse& response, |
42 const WebString& file_path = WebString()) override; | 43 const WebString& file_path = WebString()) override; |
43 void RegisterErrorURL(const WebURL& url, | 44 void RegisterErrorURL(const WebURL& url, |
44 const WebURLResponse& response, | 45 const WebURLResponse& response, |
45 const WebURLError& error) override; | 46 const WebURLError& error) override; |
46 void UnregisterURL(const WebURL& url) override; | 47 void UnregisterURL(const WebURL& url) override; |
47 void UnregisterAllURLsAndClearMemoryCache() override; | 48 void UnregisterAllURLsAndClearMemoryCache() override; |
48 void ServeAsynchronousRequests() override; | 49 void ServeAsynchronousRequests() override; |
49 void SetLoaderDelegate(WebURLLoaderTestDelegate* delegate) override { | 50 void SetLoaderDelegate(WebURLLoaderTestDelegate* delegate) override { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 URLToResponseMap url_to_response_info_; | 102 URLToResponseMap url_to_response_info_; |
102 | 103 |
103 TestingPlatformSupport* platform_; | 104 TestingPlatformSupport* platform_; |
104 | 105 |
105 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMockFactoryImpl); | 106 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMockFactoryImpl); |
106 }; | 107 }; |
107 | 108 |
108 } // namespace blink | 109 } // namespace blink |
109 | 110 |
110 #endif // WebURLLoaderMockFactoryImpl_h | 111 #endif // WebURLLoaderMockFactoryImpl_h |
OLD | NEW |