Chromium Code Reviews| Index: third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.h |
| diff --git a/third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.h b/third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.h |
| index 8fe9d11453917b5f6b0d718e4d9b16d7baece896..b1caaea06586a517265d5a5fac2096276521875f 100644 |
| --- a/third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.h |
| +++ b/third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.h |
| @@ -45,6 +45,10 @@ class WebURLLoaderMockFactoryImpl : public WebURLLoaderMockFactory { |
| const WebURLResponse& response, |
| const WebURLError& error) override; |
| void UnregisterURL(const WebURL& url) override; |
| + void RegisterURLProtocol(const WebString& protocol, |
| + const WebURLResponse& response, |
| + const WebString& file_path = WebString()) override; |
|
dcheng
2017/05/25 18:34:04
I know we violate this today, but we actually proh
pwnall
2017/05/25 20:01:11
Done.
Thank you very much for pointing out! I did
|
| + void UnregisterURLProtocol(const WebString& protocol) override; |
| void UnregisterAllURLsAndClearMemoryCache() override; |
| void ServeAsynchronousRequests() override; |
| void SetLoaderDelegate(WebURLLoaderTestDelegate* delegate) override { |
| @@ -84,6 +88,13 @@ class WebURLLoaderMockFactoryImpl : public WebURLLoaderMockFactory { |
| // Checks if the loader is pending. Otherwise, it may have been deleted. |
| bool IsPending(WeakPtr<WebURLLoaderMock> loader); |
| + // Looks up an URL in the mock URL table. |
| + // |
| + // If the URL is found, returns true and sets |error| and |response_info|. |
| + bool LookupURL(const WebURL& url, |
| + WebURLError* error, |
| + ResponseInfo* response_info); |
| + |
| // Reads |m_filePath| and puts its content in |data|. |
| // Returns true if it successfully read the file. |
| static bool ReadFile(const base::FilePath& file_path, WebData* data); |
| @@ -101,6 +112,11 @@ class WebURLLoaderMockFactoryImpl : public WebURLLoaderMockFactory { |
| using URLToResponseMap = HashMap<KURL, ResponseInfo>; |
| URLToResponseMap url_to_response_info_; |
| + // Table of the registered URL protocols and the responses that they should |
| + // receive. |
| + using ProtocolToResponseMap = HashMap<String, ResponseInfo>; |
| + ProtocolToResponseMap protocol_to_response_info_; |
| + |
| TestingPlatformSupport* platform_; |
| DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMockFactoryImpl); |