Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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 UI_BASE_TEST_IOS_UI_IMAGE_TEST_UTILS_H_ | |
| 6 #define UI_BASE_TEST_IOS_UI_IMAGE_TEST_UTILS_H_ | |
| 7 | |
| 8 #import <UIKit/UIKit.h> | |
| 9 | |
| 10 namespace ui { | |
| 11 namespace test { | |
| 12 namespace uiimage_utils { | |
| 13 | |
| 14 // Returns a new UIImage of size |size| with a solid color of |color|. | |
| 15 UIImage* UIImageWithSizeAndSolidColor(CGSize const& size, UIColor* color); | |
| 16 | |
| 17 // Disclaimer, testing function with plenty of limitations: | |
| 18 // Requires the UIImages to be backed by a CGImage, ignores colorspace, may | |
| 19 // return false negatives, not efficient, and probably other things. | |
| 20 // | |
| 21 // Returns whether the pixels in |image1| are equal to the pixels in |image2|. | |
|
sdefresne
2017/01/30 16:56:20
Either use image1 in method too or use image_1 in
jif
2017/02/03 10:54:49
Done.
| |
| 22 // This is unlike UIImage's |isEqual:| method which only returns YES if the | |
| 23 // memory backing the images is the same. | |
| 24 bool UIImagesAreEqual(UIImage* image_1, UIImage* image_2); | |
| 25 | |
| 26 } // namespace uiimage_utils | |
| 27 } // namespace test | |
| 28 } // namespace ui | |
| 29 | |
| 30 #endif // UI_BASE_TEST_IOS_UI_IMAGE_TEST_UTILS_H_ | |
| OLD | NEW |