| Index: third_party/WebKit/Source/platform/testing/weburl_loader_mock.h
|
| diff --git a/third_party/WebKit/Source/platform/testing/weburl_loader_mock.h b/third_party/WebKit/Source/platform/testing/weburl_loader_mock.h
|
| index 94adbf4ef92ada950223599d3b61839d67032b74..491540431d311fa2aa34b3160714cc8d0dc7d399 100644
|
| --- a/third_party/WebKit/Source/platform/testing/weburl_loader_mock.h
|
| +++ b/third_party/WebKit/Source/platform/testing/weburl_loader_mock.h
|
| @@ -7,6 +7,7 @@
|
|
|
| #include "base/macros.h"
|
| #include "public/platform/WebURLLoader.h"
|
| +#include "public/platform/WebURLLoaderClient.h"
|
| #include "wtf/WeakPtr.h"
|
| #include <memory>
|
|
|
| @@ -14,7 +15,6 @@ namespace blink {
|
|
|
| class WebData;
|
| struct WebURLError;
|
| -class WebURLLoaderClient;
|
| class WebURLLoaderMockFactoryImpl;
|
| class WebURLLoaderTestDelegate;
|
| class WebURLRequest;
|
| @@ -25,8 +25,8 @@ const int kRedirectResponseOverheadBytes = 300;
|
| // A simple class for mocking WebURLLoader.
|
| // If the WebURLLoaderMockFactory it is associated with has been configured to
|
| // mock the request it gets, it serves the mocked resource. Otherwise it just
|
| -// forwards it to the default loader.
|
| -class WebURLLoaderMock : public WebURLLoader {
|
| +// forwards it to the default loader and acts as a proxy.
|
| +class WebURLLoaderMock : public WebURLLoader, private WebURLLoaderClient {
|
| public:
|
| // This object becomes the owner of |default_loader|.
|
| WebURLLoaderMock(WebURLLoaderMockFactoryImpl* factory,
|
| @@ -62,6 +62,16 @@ class WebURLLoaderMock : public WebURLLoader {
|
| WeakPtr<WebURLLoaderMock> GetWeakPtr();
|
|
|
| private:
|
| + void willFollowRedirect(WebURLLoader*, WebURLRequest&, const WebURLResponse&, int64_t) override { NOTREACHED(); }
|
| + void didSendData(WebURLLoader*, unsigned long long, unsigned long long) override { NOTREACHED(); }
|
| + void didReceiveResponse(WebURLLoader*, const WebURLResponse&) override;
|
| + void didReceiveResponse(WebURLLoader*, const WebURLResponse&, WebDataConsumerHandle*) override;
|
| + void didReceiveCachedMetadata(WebURLLoader*, const char* data, int length) override { NOTREACHED(); }
|
| + void didReceiveData(WebURLLoader*, const char*, int, int encodedDataLength, int encodedBodyLength) override;
|
| + void didDownloadData(WebURLLoader*, int, int) override { NOTREACHED(); }
|
| + void didFinishLoading(WebURLLoader*, double finishTime, int64_t encodedDataLength) override;
|
| + void didFail(WebURLLoader*, const WebURLError&) override;
|
| +
|
| WebURLLoaderMockFactoryImpl* factory_ = nullptr;
|
| WebURLLoaderClient* client_ = nullptr;
|
| std::unique_ptr<WebURLLoader> default_loader_;
|
|
|