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

Unified Diff: ui/base/test/ios/ui_image_test_utils.h

Issue 2645653003: Expose thumbnails of pages to iOS share extensions. (Closed)
Patch Set: Addressed comments. Created 3 years, 10 months 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
« no previous file with comments | « ui/base/test/ios/OWNERS ('k') | ui/base/test/ios/ui_image_test_utils.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/test/ios/ui_image_test_utils.h
diff --git a/ui/base/test/ios/ui_image_test_utils.h b/ui/base/test/ios/ui_image_test_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..e253c48bb55c67d94feae96dcc6c33cb9c475997
--- /dev/null
+++ b/ui/base/test/ios/ui_image_test_utils.h
@@ -0,0 +1,32 @@
+// Copyright 2017 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 UI_BASE_TEST_IOS_UI_IMAGE_TEST_UTILS_H_
+#define UI_BASE_TEST_IOS_UI_IMAGE_TEST_UTILS_H_
+
+#import <UIKit/UIKit.h>
+
+namespace ui {
+namespace test {
+namespace uiimage_utils {
+
+// Returns a new UIImage of size |size| with a solid color of |color|.
+UIImage* UIImageWithSizeAndSolidColor(CGSize const& size, UIColor* color);
+
+// Disclaimer, this is a testing function with plenty of limitations:
+// Requires the UIImages to be backed by a CGImage, ignores colorspace, may
+// return false negatives, not efficient, and probably other things.
+//
+// Returns whether the pixels in |image_1| are equal to the pixels in
+// |image_2|.
+// This is unlike UIImage's |isEqual:| method which only returns YES if the
+// memory backing the images is the same (see Apple's response to
+// radar://30188145).
+bool UIImagesAreEqual(UIImage* image_1, UIImage* image_2);
+
+} // namespace uiimage_utils
+} // namespace test
+} // namespace ui
+
+#endif // UI_BASE_TEST_IOS_UI_IMAGE_TEST_UTILS_H_
« no previous file with comments | « ui/base/test/ios/OWNERS ('k') | ui/base/test/ios/ui_image_test_utils.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698