Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ios / chrome / browser / net / mock_image_fetcher.h
blob2b12af90c82a8a06b9386edbc85288997661f1d2
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 IOS_CHROME_BROWSER_NET_MOCK_IMAGE_FETCHER_H_
6 #define IOS_CHROME_BROWSER_NET_MOCK_IMAGE_FETCHER_H_
8 #import "ios/chrome/browser/net/image_fetcher.h"
10 #include "testing/gmock/include/gmock/gmock.h"
12 namespace image_fetcher {
14 // Mock the ImageFetcher utility class, which can be used to asynchronously
15 // retrieve an image from an URL.
16 class MockImageFetcher : public ImageFetcher {
17 public:
18 explicit MockImageFetcher(const scoped_refptr<base::TaskRunner>& task_runner);
19 ~MockImageFetcher() override;
21 MOCK_METHOD4(StartDownload,
22 void(const GURL& url,
23 ImageFetchedCallback callback,
24 const std::string& referrer,
25 net::URLRequest::ReferrerPolicy referrer_policy));
26 MOCK_METHOD2(StartDownload,
27 void(const GURL& url, ImageFetchedCallback callback));
28 MOCK_METHOD1(SetRequestContextGetter,
29 void(const scoped_refptr<net::URLRequestContextGetter>&
30 request_context_getter));
33 } // namespace image_fetcher
35 #endif // IOS_CHROME_BROWSER_NET_MOCK_IMAGE_FETCHER_H_