Index: ios/web/public/image_fetcher/mock_raw_image_fetcher.h |
diff --git a/ios/web/public/image_fetcher/mock_raw_image_fetcher.h b/ios/web/public/image_fetcher/mock_raw_image_fetcher.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..96b2dfc2f968b32764f9aeb177adb43926503b2a |
--- /dev/null |
+++ b/ios/web/public/image_fetcher/mock_raw_image_fetcher.h |
@@ -0,0 +1,36 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
Eugene But (OOO till 7-30)
2016/11/30 17:28:53
Please move this to ios/web/public/test.
gambard
2016/12/01 09:25:13
Done.
|
+#ifndef IOS_WEB_PUBLIC_IMAGE_FETCHER_MOCK_RAW_IMAGE_FETCHER_H_ |
+#define IOS_WEB_PUBLIC_IMAGE_FETCHER_MOCK_RAW_IMAGE_FETCHER_H_ |
+ |
+#import "ios/web/public/image_fetcher/raw_image_fetcher.h" |
+ |
+#include "testing/gmock/include/gmock/gmock.h" |
+ |
+namespace web { |
+ |
+// Mock the RawImageFetcher utility class, which can be used to asynchronously |
Eugene But (OOO till 7-30)
2016/11/30 17:28:53
nit: s/Mock/Mocks
gambard
2016/12/01 09:25:13
Done.
|
+// retrieve an image from an URL. |
+class MockRawImageFetcher : public RawImageFetcher { |
+ public: |
+ explicit MockRawImageFetcher( |
+ const scoped_refptr<base::TaskRunner>& task_runner); |
+ ~MockRawImageFetcher() override; |
+ |
+ MOCK_METHOD4(StartDownload, |
+ void(const GURL& url, |
+ ImageFetchedCallback callback, |
+ const std::string& referrer, |
+ net::URLRequest::ReferrerPolicy referrer_policy)); |
+ MOCK_METHOD2(StartDownload, |
+ void(const GURL& url, ImageFetchedCallback callback)); |
+ MOCK_METHOD1(SetRequestContextGetter, |
+ void(const scoped_refptr<net::URLRequestContextGetter>& |
+ request_context_getter)); |
+}; |
+ |
+} // namespace web |
+ |
+#endif // IOS_WEB_PUBLIC_IMAGE_FETCHER_MOCK_RAW_IMAGE_FETCHER_H_ |