Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: ios/web/public/test/mock_image_data_fetcher.h

Issue 2526773002: Move iOS ImageFetcher to ios/web/public (Closed)
Patch Set: Rename to image data fetcher Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/web/public/test/mock_image_data_fetcher.h
diff --git a/ios/web/public/test/mock_image_data_fetcher.h b/ios/web/public/test/mock_image_data_fetcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..fccbe8dfec344b3da64804c72f8b34abfc7dbcd9
--- /dev/null
+++ b/ios/web/public/test/mock_image_data_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.
+
+#ifndef IOS_WEB_PUBLIC_IMAGE_FETCHER_MOCK_RAW_IMAGE_FETCHER_H_
Eugene But (OOO till 7-30) 2016/12/01 16:52:01 IOS_WEB_PUBLIC_TEST_MOCK_IMAGE_DATA_FETCHER_H_
gambard 2016/12/02 08:06:12 Done.
+#define IOS_WEB_PUBLIC_IMAGE_FETCHER_MOCK_RAW_IMAGE_FETCHER_H_
+
+#import "ios/web/public/image_fetcher/image_data_fetcher.h"
+
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace web {
+
+// Mocks the ImageDataFetcher utility class, which can be used to asynchronously
+// retrieve an image from an URL.
+class MockImageDataFetcher : public ImageDataFetcher {
+ public:
+ explicit MockImageDataFetcher(
+ const scoped_refptr<base::TaskRunner>& task_runner);
+ ~MockImageDataFetcher() 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_

Powered by Google App Engine
This is Rietveld 408576698