Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / public / platform / WebURLLoaderTestDelegate.h
blob200ab15b0fbd5c78747d88cfcbd328aeddc37fbb
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef WebURLLoaderTestDelegate_h
6 #define WebURLLoaderTestDelegate_h
8 #include "public/platform/WebCommon.h"
10 namespace blink {
12 class WebURLLoader;
13 class WebURLResponse;
14 class WebURLLoaderClient;
15 struct WebURLError;
17 // Use with WebUnitTestSupport::setLoaderDelegate to intercept calls to a
18 // WebURLLoaderClient for controlling network responses in a test. Default
19 // implementations of all methods just call the original method on the
20 // WebURLLoaderClient.
21 class BLINK_PLATFORM_EXPORT WebURLLoaderTestDelegate {
22 public:
23 WebURLLoaderTestDelegate();
24 virtual ~WebURLLoaderTestDelegate();
26 virtual void didReceiveResponse(WebURLLoaderClient* originalClient, WebURLLoader*, const WebURLResponse&);
27 virtual void didReceiveData(WebURLLoaderClient* originalClient, WebURLLoader*, const char* data, int dataLength, int encodedDataLength);
28 virtual void didFail(WebURLLoaderClient* originalClient, WebURLLoader*, const WebURLError&);
29 virtual void didFinishLoading(WebURLLoaderClient* originalClient, WebURLLoader*, double finishTime, int64_t totalEncodedDataLength);
32 } // namespace blink
34 #endif