| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef IOS_WEB_PUBLIC_TEST_MOCK_IMAGE_DATA_FETCHER_H_ | |
| 6 #define IOS_WEB_PUBLIC_TEST_MOCK_IMAGE_DATA_FETCHER_H_ | |
| 7 | |
| 8 #import "ios/web/public/image_fetcher/image_data_fetcher.h" | |
| 9 | |
| 10 #include "testing/gmock/include/gmock/gmock.h" | |
| 11 | |
| 12 namespace web { | |
| 13 | |
| 14 // Mocks the ImageDataFetcher utility class, which can be used to asynchronously | |
| 15 // retrieve an image from an URL. | |
| 16 class MockImageDataFetcher : public ImageDataFetcher { | |
| 17 public: | |
| 18 explicit MockImageDataFetcher( | |
| 19 const scoped_refptr<base::TaskRunner>& task_runner); | |
| 20 ~MockImageDataFetcher() override; | |
| 21 | |
| 22 MOCK_METHOD4(StartDownload, | |
| 23 void(const GURL& url, | |
| 24 ImageFetchedCallback callback, | |
| 25 const std::string& referrer, | |
| 26 net::URLRequest::ReferrerPolicy referrer_policy)); | |
| 27 MOCK_METHOD2(StartDownload, | |
| 28 void(const GURL& url, ImageFetchedCallback callback)); | |
| 29 MOCK_METHOD1(SetRequestContextGetter, | |
| 30 void(const scoped_refptr<net::URLRequestContextGetter>& | |
| 31 request_context_getter)); | |
| 32 }; | |
| 33 | |
| 34 } // namespace web | |
| 35 | |
| 36 #endif // IOS_WEB_PUBLIC_TEST_MOCK_IMAGE_DATA_FETCHER_H_ | |
| OLD | NEW |