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"
14 class WebURLLoaderClient
;
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
{
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
);