OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 WebURLLoaderTestDelegate_h | 5 #ifndef WebURLLoaderTestDelegate_h |
6 #define WebURLLoaderTestDelegate_h | 6 #define WebURLLoaderTestDelegate_h |
7 | 7 |
8 #include "public/platform/WebCommon.h" | 8 #include "public/platform/WebCommon.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 class WebURLResponse; | 12 class WebURLResponse; |
13 class WebURLLoaderClient; | 13 class WebURLLoaderClient; |
14 struct WebURLError; | 14 struct WebURLError; |
15 | 15 |
16 // Use with WebUnitTestSupport::setLoaderDelegate to intercept calls to a | 16 // Use with WebUnitTestSupport::setLoaderDelegate to intercept calls to a |
17 // WebURLLoaderClient for controlling network responses in a test. Default | 17 // WebURLLoaderClient for controlling network responses in a test. Default |
18 // implementations of all methods just call the original method on the | 18 // implementations of all methods just call the original method on the |
19 // WebURLLoaderClient. | 19 // WebURLLoaderClient. |
20 class BLINK_PLATFORM_EXPORT WebURLLoaderTestDelegate { | 20 class BLINK_PLATFORM_EXPORT WebURLLoaderTestDelegate { |
21 public: | 21 public: |
22 WebURLLoaderTestDelegate(); | 22 WebURLLoaderTestDelegate(); |
23 virtual ~WebURLLoaderTestDelegate(); | 23 virtual ~WebURLLoaderTestDelegate(); |
24 | 24 |
25 virtual void didReceiveResponse(WebURLLoaderClient* originalClient, | 25 virtual void didReceiveResponse(WebURLLoaderClient* originalClient, |
26 const WebURLResponse&); | 26 const WebURLResponse&); |
27 virtual void didReceiveData(WebURLLoaderClient* originalClient, | 27 virtual void didReceiveData(WebURLLoaderClient* originalClient, |
28 const char* data, | 28 const char* data, |
29 int dataLength, | 29 int dataLength); |
30 int encodedDataLength); | |
31 virtual void didFail(WebURLLoaderClient* originalClient, | 30 virtual void didFail(WebURLLoaderClient* originalClient, |
32 const WebURLError&, | 31 const WebURLError&, |
33 int64_t totalEncodedDataLength, | 32 int64_t totalEncodedDataLength, |
34 int64_t totalEncodedBodyLength); | 33 int64_t totalEncodedBodyLength); |
35 virtual void didFinishLoading(WebURLLoaderClient* originalClient, | 34 virtual void didFinishLoading(WebURLLoaderClient* originalClient, |
36 double finishTime, | 35 double finishTime, |
37 int64_t totalEncodedDataLength, | 36 int64_t totalEncodedDataLength, |
38 int64_t totalEncodedBodyLength); | 37 int64_t totalEncodedBodyLength); |
39 }; | 38 }; |
40 | 39 |
41 } // namespace blink | 40 } // namespace blink |
42 | 41 |
43 #endif | 42 #endif |
OLD | NEW |